From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from a7-18.smtp-out.eu-west-1.amazonses.com (a7-18.smtp-out.eu-west-1.amazonses.com [54.240.7.18]) by mx.groups.io with SMTP id smtpd.web11.21668.1688648529341410655 for ; Thu, 06 Jul 2023 06:02:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ipxe.org header.s=cphpx6z2rfcgehlykjjh3gknqe3hsoe2 header.b=Q5d2tll2; spf=pass (domain: eu-west-1.amazonses.com, ip: 54.240.7.18, mailfrom: 010201892b4badcf-078f8af5-8d8c-4e1e-903b-60c005a5b8a8-000000@eu-west-1.amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=cphpx6z2rfcgehlykjjh3gknqe3hsoe2; d=ipxe.org; t=1688648527; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=QSgktiNOt1961dL2PoNqO3hXGNJgk9c3ErFhadXIr+I=; b=Q5d2tll2IhmTPzJMfSiyuG7sP7nlEeomUgdKyAHuJcVwFB7LgQZDcyvvAmxwdR1/ mTFteDo7N2bn2MHDj02keru7nePCk2aJAKXZWKBc/cVDRveD0OJihRqW98l1vOgVEi1 OcAiV0MzvsFg2PUOpKLrY67tiv7GXluAMu0IdfJq/zyRLlsfqVU8UOjy7emedKhiwE6 LxvLxDZYLHoYr6STmOR1J4Hi5NH7VSq8FPC1y2F3fFvfCeJ/WXCdVZPh7wQym9snx/v Fq95zdmSl/A9+q8nZbVnf84xILrZB45adJuol30wDAbLukdenVXUoxRTiX/4lu8Q3z/ vhW4vkDKGw== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=shh3fegwg5fppqsuzphvschd53n6ihuv; d=amazonses.com; t=1688648527; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=QSgktiNOt1961dL2PoNqO3hXGNJgk9c3ErFhadXIr+I=; b=a1ITCZAtkfMxps0Cp+DiRnDIUjC39e0nwfIiw7QjUPIGquW+ABOYnji93Y70fSwQ kOfDDIeUDRL/lLGIUwpixppB51yyTv7WVD1NmRc0AT/cx3pnEQZlpLnqtI2bHCBriqz 95BHMbJE6nZKV6qQPlxfwsx/N3VpiD2IWTQRXEw0= Message-ID: <010201892b4badcf-078f8af5-8d8c-4e1e-903b-60c005a5b8a8-000000@eu-west-1.amazonses.com> Date: Thu, 6 Jul 2023 13:02:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/XhciDxe: Use Performance Timer for XHCI Timeouts To: devel@edk2.groups.io, patrick.henz@hpe.com References: From: "Michael Brown" In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_DBL_BLOCKED_OPENDNS,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on blyat.fensystems.co.uk Feedback-ID: 1.eu-west-1.fspj4M/5bzJ9NLRzJP0PaxRwxrpZqiDQJ1IF94CF2TA=:AmazonSES X-SES-Outgoing: 2023.07.06-54.240.7.18 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05/07/2023 21:15, Henz, Patrick wrote: > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2948 > > XhciDxe uses the timer functionality provided by the > boot services table to detect timeout conditions. This > breaks the driver's ExitBootServices call back, as > CoreExitBootServices halts the timer before signaling > the ExitBootServices event. If the host controller > fails to halt in the call back, the timeout condition > will never occur and the boot gets stuck in an indefinite > spin loop. Use the free running timer provided by > TimerLib to calculate timeouts, avoiding the potential > hang. Two points: 1. The XhcGetElapsedTime() function feels like a generally reusable abstraction that should exist within TimerLib, rather than being open-coded within XhciDxe. 2. Is the performance counter guaranteed to exist and work as expected on all platforms and CPU architectures? (For example: what if the CPU does not support a constant TSC?) Thanks, Michael