From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F20EBC07E95 for ; Fri, 16 Jul 2021 05:15:49 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E142661396 for ; Fri, 16 Jul 2021 05:15:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E142661396 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DBE381E14; Fri, 16 Jul 2021 07:15:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.b="nkb2zMlK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B835F81E47; Fri, 16 Jul 2021 07:15:44 +0200 (CEST) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F2B5A81664 for ; Fri, 16 Jul 2021 07:15:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mchang@suse.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1626412540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bBQ3bn//el+0JOVH/D4p3SvIUZN4yY6zi0zw59ALnlw=; b=nkb2zMlKKKNukczVz0VLmvLmMJGTmXKvXsG0Q3VFJNUvKFIoW3A2GhrkK0sBCnwFMkkYJC 9N1bRFfG9uJgAsZ4PeK6bN7BnMqcPuheWFHnWaV2Xd6y7ACHWf+DMmWouykPPBHs4baAi7 4ekJ8RD1c85YrNFvamSqimjVR1LgS04= Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2053.outbound.protection.outlook.com [104.47.1.53]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-40-oJ0IG4mOMbS0a9Kpf1tE-A-1; Fri, 16 Jul 2021 07:15:39 +0200 X-MC-Unique: oJ0IG4mOMbS0a9Kpf1tE-A-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDhNPVi1+maEQW5nwacQV7kHIwRBDUecGKxptzs+N5mV4m4VOkC/WbQfif3vsGoBXozffcc4Ml++cH9slnDGfChBR76UAXunw/Ey7730YdJaSgxrrdqrDujpuQWEAkiHDBR+jH+cFPDrFI+XY/CJ6XwRxLDwyQVpks6B5OuJeeAqxTsFwFHR5mXfC8RDg1/+O6hznfm/TGNAvoCervWJqyTREzGRm01qheAmKw0IKXa4uYC/MYUBL88O1LHdDBbAygLpavAQb1qZwdW/R4HstPJFA8DB7PItB6CKcu7QTuJQHFUqlW0/EHlHonCqnzxayC+MczzRYtAXCGykqrRo2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bBQ3bn//el+0JOVH/D4p3SvIUZN4yY6zi0zw59ALnlw=; b=Qay8PVCkT91DRsyqOkXhnWcriigHab0C0l2A8kvQTrzx8nHm+2S0sgHSbOptTvmNizFGFN6TNlMLfeXcAmpqLsFGSGvuOEslcC+RPdf05iLiqEDgPL+witU7nuHolIFEN5AN7OM/QFU+s901qurQ2QkglLfQ+l4XbhKXBGsEA4DIXCfgSsbsbuDGQ5yTJBn9qpjDaHfYmOAMcNFuLPY+JSklHKv0g2JkVaYf7ZuWVS096cxhwo1mqs4Qu/MKWFBOr8b3i/qZKarioTVNicfoTBtBu/Xw5E4QvXCJjD/4/A67ZrlcpRljrxLYclw2qUabbR7h1Nbn4SQ0QCyZkC6DOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: gmx.de; dkim=none (message not signed) header.d=none;gmx.de; dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) by DB9PR04MB8462.eurprd04.prod.outlook.com (2603:10a6:10:2be::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.23; Fri, 16 Jul 2021 05:15:38 +0000 Received: from DU2PR04MB8648.eurprd04.prod.outlook.com ([fe80::245b:a7da:fcc:25a1]) by DU2PR04MB8648.eurprd04.prod.outlook.com ([fe80::245b:a7da:fcc:25a1%4]) with mapi id 15.20.4308.027; Fri, 16 Jul 2021 05:15:37 +0000 Date: Fri, 16 Jul 2021 13:15:31 +0800 From: Michael Chang To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Alexander Graf Subject: Re: [PATCH] Disable timer check in file loading Message-ID: <20210716051531.GA5346@mercury> References: <20210708082250.11833-1-mchang@suse.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: HK0PR03CA0101.apcprd03.prod.outlook.com (2603:1096:203:b0::17) To DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (36.226.47.64) by HK0PR03CA0101.apcprd03.prod.outlook.com (2603:1096:203:b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 05:15:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 627280e7-c92b-4e2e-527c-08d94818bf54 X-MS-TrafficTypeDiagnostic: DB9PR04MB8462: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U3PRrO6Uw694suLvXD481a+ZQzx0s8JWCKnXSt6u9mSb+e1qXDpNGrmztliuDyIK8znS0iDFTEfvDVMf1bD7MKg6rKgZCvIqy3fLLLmaSIat5JAezJaL2JMlu/zf9jgyAD7wA8k9qXQP1V8fhXyOmTXq3aUEZwspzkf+LehripK1F6NiLZp1ivOxYOAOZ0ph87WNdONcAzRlV+jKF0vfH8eJBgsma1ydimOpPleJINh8jCFoxabqI2Zlg8zIO0IVPjzy3fdCbY1jmFiCc9peuwN6MTX+Px9d4z9IHzKeveklsypMe4G1NDJN4DPwps9AYAQJ66QOOn3QlRDuK6/nJnqs41fPuzodpLGVZCAzc1TXC0AwapxXj35Cn78sHABip6YXjmJ3YlQPkP9ZNFMfWQJR8NLCg3OJd+sq4XC2LEnpOtdHOIUoB+/pbJyCpqsrvRZlW1+sSC7+7TAp56bSdYgKyNxELy2icIYWhwhViBqKpx+1t+nAUPKxnH9fPKlC5NFytgDFYMils3hGNnqT6jIJ7Hg1kdPp63ZxSFn/vm2HjQdAsMG3l2IuQahoNqQIaJxMJeTCx5GA4GSNkwm0TaQ8aQ+pGS8l3ucVzgEkZ2cuiCKxMDWhMlXVO2iWVXoXE1bLwCsTHFFhJ1zcM9mu10SStE/xsLPfW+lnjqw3vRrenbyLP/zBgJVmEzYfFuFYExfQ3ITE8b/SfC8Bw52pBrYL3G9ooc2VK7zrREobQgA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8648.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(7916004)(136003)(396003)(376002)(346002)(39860400002)(366004)(316002)(6486002)(53546011)(26005)(33656002)(4326008)(8676002)(2906002)(83380400001)(6496006)(186003)(33716001)(66476007)(66946007)(6666004)(966005)(478600001)(8936002)(1076003)(6916009)(86362001)(9686003)(66556008)(5660300002)(38100700002)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3fggM9z/DoFvKhPq80kKOpWIQe2HjZtTMyHRI3JTln8qmhg7V/+/+oueAj2K?= =?us-ascii?Q?huHa1dM2ErxiXPLiB9X4T1ONdnYocfvvd9LA7JGaWfXqcwCDgrzN+fnTx46x?= =?us-ascii?Q?lFNxtglFcq0bF+/gwlczkvucISePTdW2exLxxDf9IhoJqSAs1wrIFaWKaFp/?= =?us-ascii?Q?gng2zDxToNUiqDTxQMdBhXDrTnlfxxuO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Q?mzDYoNx6gntxfxpBzOkm1EGS28R4pwq9vcoMqkvfB4yW60zLXEu8fOuKEseo?= =?us-ascii?Q?P/ues86JxnzNlsDHq5frnEgqX7zrxcZvEiJv1+eS32MavWUW/E7C6h6BLAej?= =?us-ascii?Q?+8x59ll1lu0TjveonP36BX2QO/nymapnogod6HtAJDGiQ3j+WvTnrO3Hf1S1?= =?us-ascii?Q?9tmQomoUTzQ21DJOKRln0ZtAuojX4uMKlE1OYyc0/lQrn4KHjonGfJ9iTJfB?= =?us-ascii?Q?SdrnOrvBncy7QwrK3GFQWZsz?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 627280e7-c92b-4e2e-527c-08d94818bf54 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8648.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2021 05:15:37.7857 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b/rwaLGGD89YbMh6DD+kto3G6UXjD5QhaHu5Hll5SqoVS0MNLdztHu1cMdpX+9jJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8462 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, Jul 15, 2021 at 04:51:35PM +0200, Heinrich Schuchardt wrote: > On 7/8/21 10:22 AM, Michael Chang wrote: > > The u-boot efi console service registers a timer to poll the keyboard > > input in every 50ns. In the efi block io service, this timer is > > The event is triggered every 5000 ns not 50 ns. See > lib/efi_loader/efi_console.c:1309. The SetTimer() parameter is in > multiples of 100 ns. UEFI spec 2.9 has this sentence: > "TimerRelative: The event is to be signaled in TriggerTime 100ns units." Indeed the value is mistakenly taken. Thanks to pointing this out and will correct that in followed version. > > evaluated on each block read, and since the timer interval is much less > > than the time needed to reading out a block (32kB) from the disk, the > > keyboard polling is therefore in the wake of each block read. > > > > Unfortunately USB keyboard spends too much time in polling. In my test > > usb_kbd_poll_for_event costs 40ms in usb_kbd_testc() to test if a > > I can't imagine that Linux is that slow. Why is U-Boot so slow? Please, > try to fix that code. Well I'm by no means a usb expert who is able to troubleshooting this myself so disabling the timer check is all I can do to mitigate the problem firstly. I certainly agree to investigate into usb_kbd_testc to understand what's happening under the hood, but please bear with me if that takes longer than expected to provide a solution/expaination along the way. For that I would have to seek for help internally from the company. > > character is in the queue. In combination with the number of blocks to > > be read from the disk, the extra amound of time delayed could be around > > 30 seconds to load linux and initrd. > > > > For that matters, the timer check is disabled in file loading to speed > > it up. The consequence would be losing the keystroke during the time > > file is loading, but that is acceptable IMHO. > > Disabling would mean that programs like iPXE cannot react to keyboard > input to interrupt a file transfer. Ok. fair enough. Thanks a lot for review. Regards, Michael > > Best regards > > Heinrich > > > > > Downstream bug reference: > > https://bugzilla.suse.com/show_bug.cgi?id=1171222 > > > > Signed-off-by: Michael Chang > > --- > > lib/efi_loader/efi_disk.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c > > index 307d5d759b..d090110b06 100644 > > --- a/lib/efi_loader/efi_disk.c > > +++ b/lib/efi_loader/efi_disk.c > > @@ -15,6 +15,7 @@ > > #include > > #include > > #include > > +#include > > > > struct efi_system_partition efi_system_partition; > > > > @@ -103,8 +104,7 @@ static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this, > > else > > n = blk_dwrite(desc, lba, blocks, buffer); > > > > - /* We don't do interrupts, so check for timers cooperatively */ > > - efi_timer_check(); > > + WATCHDOG_RESET(); > > > > EFI_PRINT("n=%lx blocks=%x\n", n, blocks); > > > > >