public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>,
	"Tian, Feng" <feng.tian@intel.com>,
	 "Zeng, Star" <star.zeng@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	 Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH 2/7] MdeModulePkg/EhciDxe: enable 64-bit PCI DMA
Date: Mon, 5 Sep 2016 13:44:09 +0100	[thread overview]
Message-ID: <CAKv+Gu-aZ=OkkWVGdKt6i43LcBHn+n20CorUucPgEj723jFObQ@mail.gmail.com> (raw)
In-Reply-To: <6c4c3202-81ef-c97f-11be-37b714381a5d@redhat.com>

On 5 September 2016 at 13:19, Laszlo Ersek <lersek@redhat.com> wrote:
> On 09/05/16 11:17, Ard Biesheuvel wrote:
>> PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE
>> attribute if the controller supports 64-bit DMA addressing.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c      | 22 +++++++++++++++++++-
>>  MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h      |  2 ++
>>  MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c |  2 +-
>>  3 files changed, 24 insertions(+), 2 deletions(-)
>>
>> diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
>> index 4e9e05f0e431..e4c7e59526de 100644
>> --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
>> +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
>> @@ -89,7 +89,7 @@ EhcGetCapability (
>>
>>    *MaxSpeed       = EFI_USB_SPEED_HIGH;
>>    *PortNumber     = (UINT8) (Ehc->HcStructParams & HCSP_NPORTS);
>> -  *Is64BitCapable = (UINT8) (Ehc->HcCapParams & HCCP_64BIT);
>> +  *Is64BitCapable = (UINT8) Ehc->Support64BitDma;
>>
>>    DEBUG ((EFI_D_INFO, "EhcGetCapability: %d ports, 64 bit %d\n", *PortNumber, *Is64BitCapable));
>>
>> @@ -1877,6 +1877,26 @@ EhcDriverBindingStart (
>>      goto CLOSE_PCIIO;
>>    }
>>
>> +  //
>> +  // Enable 64-bit DMA support in the PCI layer if this controller
>> +  // supports it.
>> +  //
>> +  if ((Ehc->HcCapParams & HCCP_64BIT) != 0) {
>
> How about using the nice EHC_BIT_IS_SET macro here (inspired by the
> previous use in EhcInitSched(), at the bottom of this patch)?
>

I just moved the test from the previous hunk here. I don't care either
way, so I will let the maintainers decide. Feng, Star?

>> +    Status = PciIo->Attributes (
>> +                      PciIo,
>> +                      EfiPciIoAttributeOperationEnable,
>> +                      EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE,
>> +                      NULL
>> +                      );
>> +    if (!EFI_ERROR (Status)) {
>> +      Ehc->Support64BitDma = TRUE;
>> +    } else {
>> +      DEBUG ((EFI_D_WARN,
>> +        "EhcDriverBindingStart: failed to enable 64-bit DMA on 64-bit capable controller @ %p (%r)\n",
>> +        Controller, Status));
>
> Same comment as for 5/7, i.e. %a and __FUNCTION__.
>

The surrounding code never uses that. I started out using %a and
__FUNCTION__, and then removed it again to align with the existing
code.

> Again, whether you want to change these is up to you.
>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>

Thanks a lot!

> (I won't try to review the rest of the patches.)
>

No worries. I did build test all of them, but I currently have no way
of testing the NVM and SDHCI patches, so I am hoping they are
'obviously correct'

-- 
Ard.


  reply	other threads:[~2016-09-05 12:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05  9:17 [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for 64-bit PCI DMA Ard Biesheuvel
2016-09-05  9:17 ` [PATCH 1/7] MdeModulePkg/AtaAtapiPassThru: enable " Ard Biesheuvel
2016-09-05  9:17 ` [PATCH 2/7] MdeModulePkg/EhciDxe: " Ard Biesheuvel
2016-09-05 12:19   ` Laszlo Ersek
2016-09-05 12:44     ` Ard Biesheuvel [this message]
2016-09-05 13:06       ` Laszlo Ersek
2016-09-05  9:17 ` [PATCH 3/7] MdeModulePkg/NvmExpressDxe: " Ard Biesheuvel
2016-09-05  9:17 ` [PATCH 4/7] MdeModulePkg/SdMmcPciHcDxe: " Ard Biesheuvel
2016-09-05  9:17 ` [PATCH 5/7] MdeModulePkg/XhciDxe: " Ard Biesheuvel
2016-09-05 12:14   ` Laszlo Ersek
2016-09-05  9:17 ` [PATCH 6/7] MdeModulePkg/PciHostBridgeDxe: restrict 64-bit DMA to devices that support it Ard Biesheuvel
2016-09-05 12:04   ` Laszlo Ersek
2016-09-05  9:17 ` [PATCH 7/7] ArmVirtPkg/FdtPciHostBridgeLib: enable 64-bit PCI DMA Ard Biesheuvel
2016-09-05 12:04   ` Laszlo Ersek
2016-09-06  7:48 ` [PATCH 0/7] MdeModulePkg ArmVirtPkg: fixes for " Ard Biesheuvel
2016-09-06  8:04   ` Zeng, Star
2016-09-06  8:54   ` Ni, Ruiyu
2016-09-06 10:36     ` Ard Biesheuvel
2016-09-06 12:41       ` Tian, Feng
2016-09-06 14:48         ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKv+Gu-aZ=OkkWVGdKt6i43LcBHn+n20CorUucPgEj723jFObQ@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox