public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Daniil Egranov <daniil.egranov@arm.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH 1/2] ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe: Remove calls to ArmDmaLib
Date: Sat, 24 Sep 2016 13:05:16 +0100	[thread overview]
Message-ID: <CAKv+Gu828Ojirdwg2Ka0_AyKvTYTgf+41J2VwFDPWpV2X1a5iw@mail.gmail.com> (raw)
In-Reply-To: <ff58d7b6-8450-8824-34df-c639c365ab70@arm.com>

On 23 September 2016 at 22:47, Daniil Egranov <daniil.egranov@arm.com> wrote:
>
>
> On 09/23/2016 11:21 AM, Ard Biesheuvel wrote:
>>
>> On 23 September 2016 at 17:20, Daniil Egranov <daniil.egranov@arm.com>
>> wrote:
>>>
>>> Hi Ard,
>>>
>>>
>>> On 09/23/2016 02:57 AM, Ard Biesheuvel wrote:
>>>>
>>>> Hi Daniil,
>>>>
>>>> On 22 September 2016 at 23:33, Daniil Egranov <daniil.egranov@arm.com>
>>>> wrote:
>>>>>
>>>>> The PCI on Juno is DMA coherent, which means it should not be
>>>>> using ArmDmaLib for PCI DMA.
>>>>>
>>>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>>>> Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
>>>>> ---
>>>>>
>>>>> ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>>>> | 2 +-
>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git
>>>>>
>>>>> a/ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>>>>
>>>>> b/ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>>>> index de28c80..597154c 100644
>>>>> ---
>>>>>
>>>>> a/ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>>>> +++
>>>>>
>>>>> b/ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf
>>>>> @@ -36,7 +36,7 @@
>>>>>      MemoryAllocationLib
>>>>>      DxeServicesTableLib
>>>>>      CacheMaintenanceLib
>>>>> -  DmaLib
>>>>> +  NullDmaLib
>>>>>
>>>> This is wrong. The module .inf lists library *classes* and the
>>>> platform .dsc decides how each class maps onto an implementation (aka
>>>> library resolution)
>>>
>>> Agree. However, this is platform specific module and as i understand, the
>>> behavior of it will not change so, I think, having NullDmaLib here will
>>> be
>>> appropriate as well. We can move it to .dsc file, if it fits better to
>>> the
>>> platform description/module dependencies structure.
>>>
>> What you could do is remove the DmaLib dependency altogether, and just
>> implement PciIo->Map and PciIo->Unmap directly, and always return the
>> host address.
>
> This implementation will be almost the same as NullDmaLib one :). If you
> think it will be better structure-wise to remap it in .dsc file, let's go
> this path and disregard this patch.
>

The [LibraryClasses] section expects library classes, and NullDmaLib
is not a library class. So putting this here is simply wrong. This is
not a matter of taste.

Also, another platform could potentially use the same PCIe IP and
integrate it in a non-coherent fashion, so it is not a property of the
device if it is coherent or not.

So forget about my suggestion to drop the DmaLib dependency. Just add
NullDmaLib to the .dsc, but for this driver only.


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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 22:32 [PATCH 0/2] Juno PCI fixes Daniil Egranov
2016-09-22 22:33 ` [PATCH 1/2] ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe: Remove calls to ArmDmaLib Daniil Egranov
2016-09-23  7:57   ` Ard Biesheuvel
2016-09-23 16:20     ` Daniil Egranov
2016-09-23 16:21       ` Ard Biesheuvel
2016-09-23 21:47         ` Daniil Egranov
2016-09-24 12:05           ` Ard Biesheuvel [this message]
2016-09-22 22:33 ` [PATCH 2/2] ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe: Fix for PCI Dual Address Cycle Daniil Egranov
2016-09-23  7:58   ` Ard Biesheuvel
2016-10-12  8:37     ` Ryan Harkin
2016-10-12  8:41       ` 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+Gu828Ojirdwg2Ka0_AyKvTYTgf+41J2VwFDPWpV2X1a5iw@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