From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.0.50; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=udit.kumar@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00050.outbound.protection.outlook.com [40.107.0.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B3190222CF1BB for ; Wed, 10 Jan 2018 01:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=r6QANc4NFXTxaxgBL2NpNApBcmlJa2gJ8Y9WYyDBhaQ=; b=FmDgeVeQgARbGDWeTunOoeHTZo9X712u9FphsrybyNjqRlK+LDc2SNJR91/G8m8ve+CB5sIDKlmBoxXWn/bq7udQfGmoej2Hd1rzRyCtjk0xOy9hVlMA9r9dgguZZMYjGIqiJl9F6NCviCKCWIAULUN0oUD8PKMnDNReADReF2k= Received: from AM6PR0402MB3334.eurprd04.prod.outlook.com (52.133.18.151) by HE1PR04MB1003.eurprd04.prod.outlook.com (10.162.25.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 09:43:08 +0000 Received: from AM6PR0402MB3334.eurprd04.prod.outlook.com ([fe80::9874:de1f:c35:abb8]) by AM6PR0402MB3334.eurprd04.prod.outlook.com ([fe80::9874:de1f:c35:abb8%13]) with mapi id 15.20.0386.009; Wed, 10 Jan 2018 09:43:07 +0000 From: Udit Kumar To: "Ni, Ruiyu" , Meenakshi Aggarwal , "edk2-devel@lists.01.org" , "Zeng, Star" CC: Ard Biesheuvel , "leif.lindholm@linaro.org" Thread-Topic: [edk2] [RFC] SATA : Implemented NXP errata A008402 Thread-Index: AQHTifXV1LNus4t+bU21whIVuvRhB6Ns2DrA Date: Wed, 10 Jan 2018 09:43:07 +0000 Message-ID: References: <1515410208-14559-1-git-send-email-meenakshi.aggarwal@nxp.com> <1515410208-14559-2-git-send-email-meenakshi.aggarwal@nxp.com> <4ea591d7-5218-d174-7fde-90ecf8a76f02@Intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=udit.kumar@nxp.com; x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR04MB1003; 7:vrNRvSjyXPUsBtxApFEDciQSK57XgLSxsR1GqIsOcDtsR5Do1VtSjjBgnVQjWEYp9UZBUQGq3uGs2Z/Y7KP3Z2mALCCNWUO14RlLvyNuHdhEZqb1+VSc7e4XI4Hn4P5U172lyihPsJQNmz/vKFYOPOPLQb6dDqjHVXnBFb21ODHqZ8b2etZuu3gtQ0DDJadVkhLaso7EK1BdYbUfxNkqRzwd8ZckxYzjj5o57uqaqPGRIkA2Q8mzzn+NwL1fV66C x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(39380400002)(366004)(396003)(376002)(346002)(39860400002)(199004)(189003)(13464003)(86362001)(9686003)(2950100002)(6246003)(66066001)(7736002)(6436002)(2906002)(53936002)(110136005)(316002)(229853002)(54906003)(97736004)(5660300001)(25786009)(3846002)(6116002)(8676002)(575784001)(68736007)(4326008)(81156014)(6306002)(55016002)(305945005)(33656002)(45080400002)(6506007)(2900100001)(966005)(7696005)(102836004)(74316002)(106356001)(2501003)(105586002)(93886005)(5250100002)(8936002)(59450400001)(99286004)(76176011)(478600001)(14454004)(81166006)(3660700001)(3280700002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1003; H:AM6PR0402MB3334.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7f18f0b2-aaf1-4876-0b9e-08d5580e8dd7 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:HE1PR04MB1003; x-ms-traffictypediagnostic: HE1PR04MB1003: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(162533806227266)(45079756050767); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3231023)(944501075)(3002001)(93006095)(93001095)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:HE1PR04MB1003; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR04MB1003; x-forefront-prvs: 0548586081 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nNYxQ7eiRzF5AsAsUXZCyIOq9jtYsnyDhtZblHL4sHIjuTdTm8gteht5Na3WfTkNRDgtP2Tju4fBwgeiaSmUAg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f18f0b2-aaf1-4876-0b9e-08d5580e8dd7 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2018 09:43:07.4791 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1003 Subject: Re: [RFC] SATA : Implemented NXP errata A008402 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: Wed, 10 Jan 2018 09:38:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ruiyu,=20 > -----Original Message----- > > > > And this change will not impact any other hardware so no one is basical= ly > impacted by this change. >=20 > Your buggy HW only need the value zero. But the addition of PCD exposes > an interface that can use any size of PRD. > I am not sure the AtaAtapiPassThru can work if some platform sets the PCD > value to others than 0 or 3F_FFFFh. I don't see someone using this driver will set Pcd randomly, but I agree on= this point other value should be handled.=20 Error or Assert could be added, if Pcd value is not 0 or 3F_FFFFh. > Can you please > just duplicate the AtaAtapiPassThru in your platform? > Because the driver is very stable today, not much code sync effort will b= e > needed if core version is changed. Duplicating is always a possibility :), but When we will push this duplicat= ed driver (just for one line change) for upstreaming. will this be acceptable ?? Thanks =20 > > > >>> > >>> Workaround: > >>> Set PRD length to 0 when creating a PRD entry for a maximum data > >>> transfer size of 4 MB to fix the erratum. > >>> > >>> Contributed-under: TianoCore Contribution Agreement 1.1 > >>> Signed-off-by: Meenakshi Aggarwal > >>> --- > >>> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 2 +- > >>> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf | 1 + > >>> MdeModulePkg/MdeModulePkg.dec | 3 +++ > >>> 3 files changed, 5 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > >> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > >>> index e6de5d6..fb6dc0b 100644 > >>> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > >>> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > >>> @@ -591,7 +591,7 @@ AhciBuildCommand ( > >>> if (RemainedData < EFI_AHCI_MAX_DATA_PER_PRDT) { > >>> AhciRegisters->AhciCommandTable- > >>> PrdtTable[PrdtIndex].AhciPrdtDbc =3D (UINT32)RemainedData - 1; > >>> } else { > >>> - AhciRegisters->AhciCommandTable- > >>> PrdtTable[PrdtIndex].AhciPrdtDbc =3D EFI_AHCI_MAX_DATA_PER_PRDT - 1; > >>> + AhciRegisters->AhciCommandTable- > >>> PrdtTable[PrdtIndex].AhciPrdtDbc =3D PcdGet32 (PcdPrdtMaxDataLength); > >>> } > >>> > >>> Data64.Uint64 =3D (UINT64)MemAddr; diff --git > >> a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > >> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > >>> index 82d5f7a..8921dd5 100644 > >>> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > >>> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf > >>> @@ -70,6 +70,7 @@ > >>> > >>> [Pcd] > >>> gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable ## > >> SOMETIMES_CONSUMES > >>> + gEfiMdeModulePkgTokenSpaceGuid.PcdPrdtMaxDataLength > >>> > >>> # [Event] > >>> # EVENT_TYPE_PERIODIC_TIMER ## SOMETIMES_CONSUMES diff --git > >>> a/MdeModulePkg/MdeModulePkg.dec > >> b/MdeModulePkg/MdeModulePkg.dec > >>> index 8efad57..b2f9f2b 100644 > >>> --- a/MdeModulePkg/MdeModulePkg.dec > >>> +++ b/MdeModulePkg/MdeModulePkg.dec > >>> @@ -1434,6 +1434,9 @@ > >>> # @Prompt Console Output Row of Text Setup > >>> > >> > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x40 > >> 00000e > >>> > >>> + ## This PCD specifies the Maximum data length for a PRD Entry > >>> + > >> > gEfiMdeModulePkgTokenSpaceGuid.PcdPrdtMaxDataLength|0x3FFFFF|UIN > >> T32|0x4000000f > >>> + > >>> [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, > >> PcdsDynamicEx] > >>> ## UART clock frequency is for the baud rate configuration. > >>> # @Prompt Serial Port Clock Rate. > >>> > >> > >> > >> -- > >> Thanks, > >> Ray > >> _______________________________________________ > >> edk2-devel mailing list > >> edk2-devel@lists.01.org > >> https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fl= i > >> st > >> s.01.org%2Fmailman%2Flistinfo%2Fedk2- > >> > devel&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7C60cadf13ac95 > >> > 48486c4908d55712d85c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0 > % > >> > 7C636510660888390946&sdata=3D4oW2agf8z869IMz%2F7%2B2di9vC%2BB3js7K > >> hJx1LR2b4Tc4%3D&reserved=3D0 > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fli= s > > ts.01.org%2Fmailman%2Flistinfo%2Fedk2- > devel&data=3D02%7C01%7Cudit.kumar% > > > 40nxp.com%7C0b697e2364f348745a7c08d5580cf5bf%7C686ea1d3bc2b4c6fa9 > 2cd99 > > > c5c301635%7C0%7C0%7C636511735060291299&sdata=3DeWI7ueE5wzr2oSNv0t > CP5hBE0 > > uEfB9S0PyABHWocBaA%3D&reserved=3D0 > > >=20 >=20 > -- > Thanks, > Ray > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Flist= s. > 01.org%2Fmailman%2Flistinfo%2Fedk2- > devel&data=3D02%7C01%7Cudit.kumar%40nxp.com%7C0b697e2364f348745a7c > 08d5580cf5bf%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636511 > 735060291299&sdata=3DeWI7ueE5wzr2oSNv0tCP5hBE0uEfB9S0PyABHWocBaA > %3D&reserved=3D0