From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22f; helo=mail-io0-x22f.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 84032209574F7 for ; Tue, 27 Feb 2018 01:21:05 -0800 (PST) Received: by mail-io0-x22f.google.com with SMTP id g21so20464008ioj.5 for ; Tue, 27 Feb 2018 01:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=dYEY8SdbC1YQ4Dx07ghqwS78w7OantmhD6ovZ7ydBlY=; b=Fbp5c89d9f6Zl5IJelACvSbZVWuX72GJGjh0OT34ePjPFqtdcxonVIfPdYVMUegtEX x6rVaLAdL53gbt2Y2P9g39rqDBRb5N1Pta6cId38X3pkjT9RezcRIKaHe08mAJcclW02 uNeZS1JBD4XDttI/nZj9mf17ahLXxmlQsJqjw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=dYEY8SdbC1YQ4Dx07ghqwS78w7OantmhD6ovZ7ydBlY=; b=qieXPw+idRZR4wXg0uEOnRPMDK6jq8qJnPYFztIoW07YrjYtWDRSg8OTNYuPTTPghn NMLv8MKPkiFzYW4+oEZ29ha3nj0J5nErHJy38v5u3IUW5FM3lVaCrbFFMxmXXVbB3e2N +jNQCxk0fIb8HTwAGu8eSIuK5Ukw4DTXhh2/qwUbtnpoJlE7bDUmTxj/27u8gk437oms a3uhm6sSDFghVoLG5gbXTGQtcYrTYvzQtTTLehdMonA6AXsPAYx+DmR1var6cqtD+iYv 2Y5z4zVdDWg1akpHnObbPx0S33yDDvtjMaDdlCaPYoOwYnK05xswY6zAUEn/U+K+m6Hx +/eQ== X-Gm-Message-State: APf1xPC1PP2dLIshBDWviL7guPX99bvFANazj1ArNKSe2m68VfU0Gqbh WDc1UgGbdRRMdX6s4ASV/7IfCQ== X-Google-Smtp-Source: AG47ELsGY98DQyyOXM8wW8VmReUH9D68hI+BMBV/Gb7hHmBRgMtIwwh3jucHIclx7O3s8JKhLEUe+w== X-Received: by 10.107.17.195 with SMTP id 64mr2083729ior.260.1519723630774; Tue, 27 Feb 2018 01:27:10 -0800 (PST) Received: from [10.50.0.62] ([45.56.155.162]) by smtp.gmail.com with ESMTPSA id o197sm7169940ioo.31.2018.02.27.01.27.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 01:27:10 -0800 (PST) To: "Ni, Ruiyu" , "leif.lindholm@linaro.org" , "linaro-uefi@lists.linaro.org" , "edk2-devel@lists.01.org" , "graeme.gregory@linaro.org" , "Zeng, Star" , "Dong, Eric" Cc: "huangming23@huawei.com" , "ard.biesheuvel@linaro.org" , "Gao, Liming" , "mengfanrong@huawei.com" , "guoheyi@huawei.com" , "zhangjinsong2@huawei.com" , "Kinney, Michael D" , "waip23@126.com" , "wanghuiqiang@huawei.com" , "huangdaode@hisilicon.com" References: <1519464575-38109-1-git-send-email-ming.huang@linaro.org> <1519464575-38109-2-git-send-email-ming.huang@linaro.org> <734D49CCEBEEF84792F5B80ED585239D5BBC26C6@SHSMSX104.ccr.corp.intel.com> From: Ming Huang Message-ID: Date: Tue, 27 Feb 2018 17:25:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5BBC26C6@SHSMSX104.ccr.corp.intel.com> Subject: Re: [RFC v1 1/1] MdeModulePkg/Usb: Use Pcd for UsbBootIoBlocks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 09:21:06 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US On 2018/2/27 13:25, Ni, Ruiyu wrote: > I don't prefer to add PCD, unless we cannot find: > 1. spec content to describe the max/min blocks There is no spec about the max/min blocks in my mind. I had checked this in several pdf document like Universal Serial Bus Mass Storage Class Specification Overview, Universal Serial Bus Mass Storage Specification For Bootability, Universal Serial Bus Mass Storage Class Bulk-Only Transport. > 2. error handling when the blocks number is bigger than HW expects. Where should error handling add to?  Error handing can't add to HW (end-point device), because HW is not in our control scope. > > Thanks/Ray > >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >> Ming Huang >> Sent: Saturday, February 24, 2018 5:30 PM >> To: leif.lindholm@linaro.org; linaro-uefi@lists.linaro.org; edk2- >> devel@lists.01.org; graeme.gregory@linaro.org; Zeng, Star >> ; Dong, Eric >> Cc: huangming23@huawei.com; ard.biesheuvel@linaro.org; Ming Huang >> ; Gao, Liming ; >> mengfanrong@huawei.com; guoheyi@huawei.com; >> zhangjinsong2@huawei.com; Kinney, Michael D >> ; waip23@126.com; >> wanghuiqiang@huawei.com; huangdaode@hisilicon.com >> Subject: [edk2] [RFC v1 1/1] MdeModulePkg/Usb: Use Pcd for >> UsbBootIoBlocks >> >> Booting from USB may fail while the macro USB_BOOT_IO_BLOCKS set to 128 >> because 128 blocks is exceeded the maximun blocks of some USB >> devices,like some virtual CD-ROM from BMC. So, give a chance to set the >> value of USB_BOOT_IO_BLOCKS by adding a Pcd. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ming Huang >> --- >> MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h | 7 >> +++++-- >> MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf | 4 >> ++++ >> MdeModulePkg/MdeModulePkg.dec | 4 ++++ >> MdeModulePkg/MdeModulePkg.uni | 4 ++++ >> 4 files changed, 17 insertions(+), 2 deletions(-) >> >> diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h >> b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h >> index 5ee50ac52a21..ca9240adbd5f 100644 >> --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h >> +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h >> @@ -16,6 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY >> KIND, EITHER EXPRESS OR IMPLIED. >> #ifndef _EFI_USB_MASS_BOOT_H_ >> #define _EFI_USB_MASS_BOOT_H_ >> >> +#include >> + >> // >> // The opcodes of various USB boot commands: >> // INQUIRY/REQUEST_SENSE are "No Timeout Commands" as specified @@ >> -66,9 +68,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY >> KIND, EITHER EXPRESS OR IMPLIED. >> #define USB_PDT_SIMPLE_DIRECT 0x0E ///< Simplified direct access >> device >> >> // >> -// Other parameters, Max carried size is 512B * 128 = 64KB >> +// Other parameters, Max carried size is depanded on Pcd. >> +// The default of PcdUsbBootIoBlocks is 128. 512B * 128 = 64KB >> // >> -#define USB_BOOT_IO_BLOCKS 128 >> +#define USB_BOOT_IO_BLOCKS (FixedPcdGet32 >> (PcdUsbBootIoBlocks)) >> >> // >> // Retry mass command times, set by experience diff --git >> a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf >> b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf >> index 26d15c7679bf..40426512f884 100644 >> --- >> a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf >> +++ >> b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf >> @@ -60,6 +60,7 @@ [Sources] >> UsbMassDiskInfo.c >> >> [Packages] >> + MdeModulePkg/MdeModulePkg.dec >> MdePkg/MdePkg.dec >> >> [LibraryClasses] >> @@ -83,5 +84,8 @@ [Protocols] >> # EVENT_TYPE_RELATIVE_TIMER ## CONSUMES >> # >> >> +[FixedPcd] >> + gEfiMdeModulePkgTokenSpaceGuid.PcdUsbBootIoBlocks >> + >> [UserExtensions.TianoCore."ExtraFiles"] >> UsbMassStorageDxeExtra.uni >> diff --git a/MdeModulePkg/MdeModulePkg.dec >> b/MdeModulePkg/MdeModulePkg.dec index 455979386e3f..fc40745315a0 >> 100644 >> --- a/MdeModulePkg/MdeModulePkg.dec >> +++ b/MdeModulePkg/MdeModulePkg.dec >> @@ -999,6 +999,10 @@ [PcdsFixedAtBuild] >> # @Prompt Enable UEFI Stack Guard. >> >> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0 >> x30001055 >> >> +## The Max blocks of usb transfer. The default is 128. >> +# @Prompt The Max blocks of usb transfer >> +gEfiMdeModulePkgTokenSpaceGuid.PcdUsbBootIoBlocks|128|UINT32|0x0 >> 000010B >> + >> [PcdsFixedAtBuild, PcdsPatchableInModule] >> ## Dynamic type PCD can be registered callback function for Pcd setting >> action. >> # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum >> number of callback function diff --git a/MdeModulePkg/MdeModulePkg.uni >> b/MdeModulePkg/MdeModulePkg.uni index f3fa616438b0..c996d6b4ebe0 >> 100644 >> --- a/MdeModulePkg/MdeModulePkg.uni >> +++ b/MdeModulePkg/MdeModulePkg.uni >> @@ -1243,3 +1243,7 @@ >> #string >> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEdkiiFpdtStringRecordEnableO >> nly_HELP #language en-US "Control which FPDT record format will be used >> to store the performance entry.\n" >> "On TRUE, the string FPDT >> record will be used to store every performance entry.\n" >> "On FALSE, the different >> FPDT record will be used to store the different performance entries." >> + >> +#string >> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdUsbBootIoBlocks_PROMPT >> #language en-US "The Max blocks of usb transfer." >> + >> +#string >> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdUsbBootIoBlocks_HELP >> #language en-US "The Max blocks of usb transfer. The default is 128." >> -- >> 1.9.1 >> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel