From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.75]) by mx.groups.io with SMTP id smtpd.web12.32095.1655480245015173655 for ; Fri, 17 Jun 2022 08:37:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=PfVouWt0; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.237.75, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RFasrRH3XJDBweyyT1aQWhkIE7jkfDC2xkBrjr8RJuLceSkWUUTv8exziXiM5p5LSkpw2aNZEbNstn3JSnBerOaNA9foJnYqOSak3UUVn5biLVAanuaPvKTof08refeDunrygAScIg9GW/lq7e6VUtteDE6xIfP9rs1qt8etsgyL7wqTDuv9LNKjgC/hfI/1fWehz7Z5pF2ZrH71SF0ksdHezoL3wKGSaACkSQnfVv3l4mLhvuaDt0e79g9QAaq5lPsEF22zOReo26S9mqtVJSiWL7SkSRU7nyVN8TTU/cLIk/3tqzNBLWsbPdloe2D4IniDRNKkeKidX19PoUya0A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wcGsaqMq3QbBJwAml/FCkH78xiNxIQvTxoCJDARGnqs=; b=PWXVXgBWUQ3Ki1TRuTp4jKN+4C4bhns0Fwj0j9NvTFW/BtR8JByxGOjTt7qJwrt98KQlGkrlH/3La9ZJ1lpKItRsPilDfqteh8dKKxzPoDZR7w4shyj4K4V1Dy2Q5APExmOwzId0SsiMEjUG3mppl5+ysJVG/GnNkL/gvFXp8SpiIzvprkIH2MhtE4g4mkOX1uDP1vcIzmD8JNTQL340pxpUB/c8BampeIOV4hpILIKwdP8Gso/SSA1+UIfqr5ETjbs3ppM6xqyjcrRvcm92MDSv708NagouAjNHD8w0p/2boz9vQ57ymaJIk/JxwAAmjxtEPdKAIzp7vY9YNWWRQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wcGsaqMq3QbBJwAml/FCkH78xiNxIQvTxoCJDARGnqs=; b=PfVouWt0qKa+BEtDEpKW7QMACnpZj9RBtmp7I2O4JdaRyjHXTfaIjDC9eNDILgFZYWe1Fgk4eDBegzGgg5VKor5Wsqj0Uy/ZfV0xUPtJp2d7zmUfGxEzMbJoxfde0fKsiDjq05El9IU85nzj5TxjGGpUQeaMG937TpnafSnzikHgWVNaKVUDvh/Hds3/ozcRM0yYGzHT0AxXqHXU2NAU5BZhl8g7u5hwlDM/mbu0d72nGUY1tLog0742mhT6y3cCVWT0TbXvN2A9pBOsmrSwYQrc61yEyyABgZAzdH+XMVFAqdwyWlY2NHNOkYExYbK0gVPiumfpqNFGukfB+IKKhw== Received: from DS7PR12MB5789.namprd12.prod.outlook.com (2603:10b6:8:74::21) by BL1PR12MB5205.namprd12.prod.outlook.com (2603:10b6:208:308::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Fri, 17 Jun 2022 15:37:23 +0000 Received: from DS7PR12MB5789.namprd12.prod.outlook.com ([fe80::2d7a:a12e:f513:1db1]) by DS7PR12MB5789.namprd12.prod.outlook.com ([fe80::2d7a:a12e:f513:1db1%7]) with mapi id 15.20.5353.014; Fri, 17 Jun 2022 15:37:22 +0000 From: "Jeff Brasen" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH] MdeModulePkg/ScsiDisk: Change TPL to NOTIFY Thread-Topic: [PATCH] MdeModulePkg/ScsiDisk: Change TPL to NOTIFY Thread-Index: AQHX8RRfoUQRn/erkkeeGcXjsJcIr6wy3WYAgAAcxFCBIeOtUA== Date: Fri, 17 Jun 2022 15:37:22 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5ef64185-c7a3-42ab-658f-08da507745cd x-ms-traffictypediagnostic: BL1PR12MB5205:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iJqoWCA5bQFGvIt2d20l24QbXXJ2JXDYJV2VqW0pBJmWAdLvM8mM70knfpi+zfAw1O5v7soyMlQTB9uhW+YaKv6nMIa4ehqCMNMwy9v7+U0HjxfGwKdPOjPqtkLSLeTcYuaRJYmEBkLyuVmLNZiCEje1GP0R7CvEmrphysTR35K+0v9oWPgt/8qeJJd6KT8KvoFIaJZBRDEER7Wvt3dWDhJdGCL6AHWjVU+DeLQbpbzN7OVkYACggbGa9cCQw/pU76AyWooRpyz4TOh3H3uNGBUUbnb6i0jKwcCnq+VcxEGjGWOaNRwGzuvMXTb+Cey7bFZB/zNp2Te3AKXYGr+Q91ob0qV6hPUZmfvAOkcbixvqUfCCtzEmbhZyMSOVyl/W2v0h8qbhb/iRgWZeImPr0Zs6HuBJTLSM9YTpUOVblZuIf7Q0qr0S2dOlv2p5Cpqy6nWmL3B8ZHX+PvnPwF9Z/eM+ruMfZlCncm8LPAdbRuEnQW2FL6JECNheXEPYKnql6eTSEQzJpXtTA166PpmXGhk+cMidjWj+07IjKU5fV+pcbty9YGlSewScF2owlASY+0quOkTpr/RygyJmN2ol87eZUwM84XhwQ3wZH7z80kskD852cOdN27w+G8I/GW9kV+8s8ajynUefo74anfO4CjGRB5sj1dw/PP7z2AQB90N4ixxL6pwMsa1y9Pv2qqoZzVCVks9Ne3n+FBiOCcqQOQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB5789.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(122000001)(64756008)(38070700005)(508600001)(66476007)(52536014)(8936002)(83380400001)(66946007)(186003)(4326008)(8676002)(66446008)(66556008)(5660300002)(55016003)(2906002)(6506007)(7696005)(316002)(110136005)(33656002)(76116006)(71200400001)(53546011)(26005)(9686003)(86362001)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Z1YQBFP0nJS02URH/kXxQPTf13VZeJqWCQ6CvYJdDfsmyw9wKdtdx5HgNyKL?= =?us-ascii?Q?CErixwaESLPj0+GJu/JFJlSbnhNiqX9Aw3U1Qm6HQ2snIOtIJPhJamlinxZS?= =?us-ascii?Q?ZP1X2Al9+lPC3rJiAyblZQ39we2cJucyMIhuPUqM1mLOiE397sc0b16+pMs6?= =?us-ascii?Q?q5KgMsFZqXY8jDgusB0t7+nbHZ1cKC+Do1qq9YvEmHfawaYSOiMAPW/YJH3Q?= =?us-ascii?Q?PpPMINqAPigqkmPtYVxl2bsj2fb32TQHg9mFrCp7KfVQlXqD2tTUggN+RKUG?= =?us-ascii?Q?GaMQ7dprwaPEFdmLAjgyc43MuUMswsoXUGn6gxu/TEUBsG29bRAFX2Wv+Xa6?= =?us-ascii?Q?fAM0QZaF11WyXDPjw3VVAMhu7RUpvOnjHsqDJ6b44dJffM9aS3WfCmeKR9X1?= =?us-ascii?Q?O6XmP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7OyI70Md?= =?us-ascii?Q?94XwEFeODph8Mf/MxsZsWXCFdajc74gafmsminCBS94fFseAHhIOfn/+UdQP?= =?us-ascii?Q?YICScreEsJDO+rbDOzZmeiCYQ94l+JDmtDgZofJn6Qd9f9aBlHhRUcHg4+qp?= =?us-ascii?Q?tDcROHOuQROnCl5ElhscCqUWlyMMX4YsQuKACwZ5kFvzGUJMIQQJiJBV+3El?= =?us-ascii?Q?7npG6uU1tZJdKXDgHgJc1pcvXuxjXYmpl/nRGc2ghBl5WxKirbed127fx8HQ?= =?us-ascii?Q?5+3Ywz8QaPK6Sh/z8TVeGastkXbFv/7dkb3lSOBlPHWYNXqNbBK04d3Wu7qY?= =?us-ascii?Q?74jaVBU5UPw1zL0hvBxTzMkuH5jqqosgQNRg/AgF4USof3pm2fP6cVGBFiBi?= =?us-ascii?Q?dh4+ewkO6HbpzbncM9TzcUlX3+b2YMOevCdHcx+eTctNcPJ/mIEDINOi3GeC?= =?us-ascii?Q?gfJQeqdl0w=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB5789.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ef64185-c7a3-42ab-658f-08da507745cd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2022 15:37:22.8609 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Eh7cm3/st3HKy/SedcmxpC9fwbOSOzmb9m56RVrK8dkOWMpuXSSrmLt28giyfyOd/b2XQ6xpniJ2GOqX1NvZLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5205 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Resending this as I replying via edk2.groups.io doesn't seem to copy mainta= iners. Resuming this patch to see if there are any additional thoughts on this. In response to the query about DXE/BDS services we have some internal conne= ction logic that runs in DXE to connect the devices that are needed for arc= h services that have to be connected prior the end of dxe. Thanks, Jeff > -----Original Message----- > From: Jeff Brasen > Sent: Tuesday, December 14, 2021 9:48 PM > To: Wu, Hao A ; devel@edk2.groups.io > Cc: Ni, Ray > Subject: RE: [PATCH] MdeModulePkg/ScsiDisk: Change TPL to NOTIFY >=20 >=20 >=20 > > -----Original Message----- > > From: Wu, Hao A > > Sent: Tuesday, December 14, 2021 8:00 PM > > To: Jeff Brasen ; devel@edk2.groups.io > > Cc: Ni, Ray > > Subject: RE: [PATCH] MdeModulePkg/ScsiDisk: Change TPL to NOTIFY > > > > External email: Use caution opening links or attachments > > > > > > > -----Original Message----- > > > From: Jeff Brasen > > > Sent: Wednesday, December 15, 2021 1:59 AM > > > To: devel@edk2.groups.io > > > Cc: Wu, Hao A ; Ni, Ray ; Jeff > > > Brasen > > > Subject: [PATCH] MdeModulePkg/ScsiDisk: Change TPL to NOTIFY > > > > > > Increase TPL to TPL_NOTIFY to allow for use if caller is > TPL_CALLBA= CK. > > > This allows services like variable services that run at TPL_NOTIFY > > > to be hosted on ScsiDisks (i.e. UFS) > > > > > > Aligns with the eMMC driver that also uses a higher TPL. > > > This change was made in 3b1d8241d0dac25c5e678c364fa2754ac1731060 > > > > > > Sorry, my take is that this change is not equivalent to the one made > > in the SD/MMC stack. > > > > For the SD/MMC change you mentioned (commit > > 3b1d8241d0dac25c5e678c364fa2754ac1731060), the TPL is raised to > > TPL_NOTIFY only when: > > a) Operation to the linked lists that manage the asynchronous IO task= s > > b) Callback functions that process the asynchronous IO tasks The TPL > > remains TPL_CALLBACK during the BlockIO services and the majority of > > the > > BlockIO2 services (operations to asynchronous tasks linked list are > > the exceptions). > > > > But the proposed change in ScsiDisk modifies the TPL level of the > > entire > > BlockIO/BlockIO2 (and other protocols) services to TPL_NOTIFY. > > For me, this is not aligned with the "TPL Restrictions" documented in > > the UEFI specification. > > > > Best Regards, > > Hao Wu > > > > >=20 > I had sent out a query on this before and didn't see any response. The co= re > of the issue I am trying to solve it support variable services on a UFS d= evice. > When the UFS blockIO is invoked from variable services it is not allowed > (which does align from the UEFI spec perspective but does not allow me to > implement variables services on UFS) >=20 > The other way that worked was lowering the lock TPL level in the PCD dri= ver > and Variable down to callback. The PCD one seems like it should be done a= s > variable services is supposed to only be called from <=3D TPL_CALLBACK. > However, I was worried about that having a larger system impact on that > change. >=20 > > > > > > Signed-off-by: Jeff Brasen > > > --- > > > MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 22 > > > ++++++++++---------- > > > 1 file changed, 11 insertions(+), 11 deletions(-) > > > > > > diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > > > b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > > > index 98e84b4ea8..b6e5848e77 100644 > > > --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > > > +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c > > > @@ -514,7 +514,7 @@ ScsiDiskReset ( > > > SCSI_DISK_DEV *ScsiDiskDevice; > > > EFI_STATUS Status; > > > > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO (This); > > > > > > @@ -581,7 +581,7 @@ ScsiDiskReadBlocks ( > > > EFI_TPL OldTpl; > > > > > > MediaChange =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -733,7 +733,7 @@ ScsiDiskWriteBlocks ( > > > EFI_TPL OldTpl; > > > > > > MediaChange =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -898,7 +898,7 @@ ScsiDiskResetEx ( > > > SCSI_DISK_DEV *ScsiDiskDevice; > > > EFI_STATUS Status; > > > > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO2 (This); > > > > > > @@ -975,7 +975,7 @@ ScsiDiskReadBlocksEx ( > > > EFI_TPL OldTpl; > > > > > > MediaChange =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO2 (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -1154,7 +1154,7 @@ ScsiDiskWriteBlocksEx ( > > > EFI_TPL OldTpl; > > > > > > MediaChange =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO2 (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -1323,7 +1323,7 @@ ScsiDiskFlushBlocksEx ( > > > EFI_TPL OldTpl; > > > > > > MediaChange =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_BLKIO2 (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -1717,7 +1717,7 @@ ScsiDiskEraseBlocks ( > > > EFI_TPL OldTpl; > > > > > > MediaChange =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_ERASEBLK (This); > > > > > > if (!IS_DEVICE_FIXED (ScsiDiskDevice)) { @@ -1907,7 +1907,7 @@ > > > ScsiDiskReceiveData ( > > > AlignedBuffer =3D NULL; > > > MediaChange =3D FALSE; > > > AlignedBufferAllocated =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_STORSEC (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -2122,7 +2122,7 @@ ScsiDiskSendData ( > > > AlignedBuffer =3D NULL; > > > MediaChange =3D FALSE; > > > AlignedBufferAllocated =3D FALSE; > > > - OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); > > > + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); > > > ScsiDiskDevice =3D SCSI_DISK_DEV_FROM_STORSEC (This); > > > Media =3D ScsiDiskDevice->BlkIo.Media; > > > > > > @@ -2294,7 +2294,7 @@ ScsiDiskDetectMedia ( > > > > > > Status =3D gBS->CreateEvent ( > > > EVT_TIMER, > > > - TPL_CALLBACK, > > > + TPL_NOTIFY, > > > NULL, > > > NULL, > > > &TimeoutEvt > > > -- > > > 2.17.1