From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web12.12929.1619621887466826622 for ; Wed, 28 Apr 2021 07:58:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=Ln1iiz+8; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 13SEggmV006369; Wed, 28 Apr 2021 07:58:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=ZsbnEz9FrJ583dV6NkNdl6s0WLYKp0ujWTTl2N7zxtg=; b=Ln1iiz+8uh3eQ686wVWbov2TwHkgb3/X2FSkYKc2203x/gp/wC+1bSnw6nwarOsTqcsJ RH2MR8axFzt5je/tnxDprF1eVTCeVBCDg6+as7WRBhten4aG9e/iVNEHjKvGzeSFLxrV vj4cUS8DRQmDp7+XiC5OM1zwND5EBJpVgEQSqIsNXc/1aDImsYLtlSM7aZc+Semt/Tvi dF7IIyzHOZ0obZ46cWxMmWU8A7NQvt4zfBzLAUcMcre+nAxAgLYayaCH7DJmH5CtRIbP ltAoG9t0Jf3+53E1bJ8lVRAKXUgRjL2VhD9Z1UQn/BA+vLzRr9xvIZo1H1l76MkNUEhZ eA== Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 385342vspe-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 28 Apr 2021 07:58:06 -0700 Received: from rn-mailsvcp-mmp-lapp02.rno.apple.com (rn-mailsvcp-mmp-lapp02.rno.apple.com [17.179.253.15]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.7.20201203 64bit (built Dec 3 2020)) with ESMTPS id <0QSA00M9K48REN80@rn-mailsvcp-mta-lapp01.rno.apple.com>; Wed, 28 Apr 2021 07:58:03 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp02.rno.apple.com by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.7.20201203 64bit (built Dec 3 2020)) id <0QSA00Z0044U9Z00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Wed, 28 Apr 2021 07:58:03 -0700 (PDT) X-Va-A: X-Va-T-CD: 1d229401e2a03eaf6e2fd012984df24e X-Va-E-CD: f4dd3ccc251b56941c826d2c70ead673 X-Va-R-CD: 6353a72eb7abb219a4e9576c7769c664 X-Va-CD: 0 X-Va-ID: 733a34be-8802-4d42-b681-2f9257fade9e X-V-A: X-V-T-CD: 1d229401e2a03eaf6e2fd012984df24e X-V-E-CD: f4dd3ccc251b56941c826d2c70ead673 X-V-R-CD: 6353a72eb7abb219a4e9576c7769c664 X-V-CD: 0 X-V-ID: a2377eb2-570f-4df4-a787-f6b492bab99d X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-04-28_09:2021-04-28,2021-04-28 signatures=0 Received: from [17.235.52.178] (unknown [17.235.52.178]) by rn-mailsvcp-mmp-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.7.20201203 64bit (built Dec 3 2020)) with ESMTPSA id <0QSA0113X48Q5Y00@rn-mailsvcp-mmp-lapp02.rno.apple.com>; Wed, 28 Apr 2021 07:58:03 -0700 (PDT) From: "Andrew Fish" Message-id: <37E06ACE-68A5-463F-A979-1C80B556FE3D@apple.com> MIME-version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.1\)) Subject: Re: [edk2-devel] [PATCH V5 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver Date: Wed, 28 Apr 2021 07:58:02 -0700 In-reply-to: Cc: Mike Kinney , edk2-devel-groups-io , "Loh, Tien Hock" , "thloh85@gmail.com" , Leif Lindholm , Ard Biesheuvel To: Ard Biesheuvel References: <20210322032439.9312-1-tien.hock.loh@intel.com> <20210322032439.9312-2-tien.hock.loh@intel.com> <09F9E77A-9B6B-4D5F-A7FF-F49EAFA03FEB@apple.com> X-Mailer: Apple Mail (2.3654.20.0.2.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-04-28_09:2021-04-28,2021-04-28 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_3D630F60-8BA3-44CE-AF6F-ED35A07DA111" --Apple-Mail=_3D630F60-8BA3-44CE-AF6F-ED35A07DA111 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 28, 2021, at 6:03 AM, Ard Biesheuvel wrote: >=20 > On Tue, 27 Apr 2021 at 21:31, Kinney, Michael D > > = wrote: >>=20 >> This is an example of another approach. This module uses PCI I/O or = IoLib based on the type of device. >>=20 >>=20 >>=20 >> = https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Pci/PciSioS= erialDxe >>=20 >>=20 >>=20 >> No additional protocols or lib classes/instances. Instead, the = register access APIs are included in the module and based on the type of = device detected, it uses PCI I/O or IoLib: >>=20 >>=20 >>=20 >> = https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f548ad23b6ab22= d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1327 >>=20 >> = https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f548ad23b6ab22= d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1358 >>=20 >>=20 >>=20 >> This technique could for PCI I/O vs MMIO register access. You would = need to add more APIs for the use of PCI I/O or DmaLib for DMA access. >>=20 >=20 > Is it really worth the effort to rewrite this code? >=20 > This patch has been circulating for a while now, and I fail to see the > point of refactoring and splitting up this code, given how unlikely it > is that DesignWare will ever put a real PCI frontend on this IP. The > SD/MMC override protocol was intended for implementations that are > almost SDHCI compliant, but have some quirks that need to be worked > around. Ard, If we don=E2=80=99t see any potential value for making it more portable = I=E2=80=99m OK with going with the current patch style.=20 Thanks, Andrew Fish= --Apple-Mail=_3D630F60-8BA3-44CE-AF6F-ED35A07DA111 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Apr 28, 2021, at 6:03 AM, Ard Biesheuvel <ardb@kernel.org> = wrote:

On Tue, 27 Apr 2021 at 21:31, Kinney, Michael D
<michael.d.kinney@intel.com> wrote:

This is an example of = another approach.  This module uses PCI I/O or IoLib based on the = type of device.



https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/= Pci/PciSioSerialDxe



No additional protocols or lib classes/instances. =  Instead, the register access APIs are included in the module and = based on the type of device detected, it uses PCI I/O or IoLib:



https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f54= 8ad23b6ab22d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1327

https://github.com/tianocore/edk2/blob/5b90b8abb4049e2d98040f54= 8ad23b6ab22d5d19/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c#L1358



This technique = could for PCI I/O vs MMIO register access.  You would need to add = more APIs for the use of PCI I/O or DmaLib for DMA access.


Is it really worth the effort to rewrite this code?

This patch has been circulating = for a while now, and I fail to see the
point of refactoring and splitting up this code, given how = unlikely it
is that = DesignWare will ever put a real PCI frontend on this IP. The
SD/MMC override protocol was = intended for implementations that are
almost SDHCI compliant, but have some quirks that need to be = worked
around.

Ard,

If we don=E2=80=99t see any potential value for making it = more portable I=E2=80=99m OK with going with the current patch = style. 

Thanks,

Andrew Fish
= --Apple-Mail=_3D630F60-8BA3-44CE-AF6F-ED35A07DA111--