Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645051

Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters

From Oza Oza <oza.oza@broadcom.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters
Date 2017-05-19 03:40 +0200
Message-ID <tIF3A-3cN-23@gated-at.bofh.it> (permalink)
References <tHDdv-1qC-3@gated-at.bofh.it> <tHDdv-1qC-7@gated-at.bofh.it> <tIaMa-5Vz-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, May 17, 2017 at 10:40 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Tue, May 16, 2017 at 10:52:05AM +0530, Oza Pawandeep wrote:
>> current device framework and OF framework integration assumes
>
> s/current/The current/
>
>> dma-ranges in a way where memory-mapped devices define their
>> dma-ranges. (child-bus-address, parent-bus-address, length).
>>
>> of_dma_configure is specifically written to take care of memory
>> mapped devices. but no implementation exists for pci to take
>> care of pcie based memory ranges.
>
> s/pci/PCI/      (also other occurrences below)
> s/pcie/PCIe/
>
> I don't see how PCIe is relevant here.  The bridge might support PCIe,
> but I don't think anything here is actually specific to PCIe.  If
> that's the case, I think it's confusing to mention PCIe.

It attempts to fix of_dma_get_range for PCI master,
because it currently it is returning *size as 0 (to the caller of_dma_configure)
resulting into largest dma_mask which would be 64-bit mask on armv8.
which usually has worked so far, because any other SOC's PCI RC, do not
have the limitations as of Broadcom iproc based PCI RC.
our RC will drop 64bit IOVAs, because it is not capable of addressing
entire 64bit range.

infact there are 2 real problems, please allow me to explain.
please refer to my next mail in reply to Arnd Bergmann,

>
>> for e.g. iproc based SOCs and other SOCs(suc as rcar) have PCI
>> world dma-ranges.
>> dma-ranges = <0x43000000 0x00 0x00 0x00 0x00 0x80 0x00>;
>>
>> this patch serves following:
>>
>> 1) exposes interface to the pci host driver for their
>> inbound memory ranges
>>
>> 2) provide an interface to callers such as of_dma_get_ranges.
>> so then the returned size get best possible (largest) dma_mask.
>> because PCI RC drivers do not call APIs such as
>> dma_set_coherent_mask() and hence rather it shows its addressing
>> capabilities based on dma-ranges.
>> for e.g.
>> dma-ranges = <0x43000000 0x00 0x00 0x00 0x00 0x80 0x00>;
>> we should get dev->coherent_dma_mask=0x7fffffffff.
>>
>> 3) this patch handles multiple inbound windows and dma-ranges.
>> it is left to the caller, how it wants to use them.
>> the new function returns the resources in a standard and unform way
>>
>> 4) this way the callers of for e.g. of_dma_get_ranges
>> does not need to change.
>
> Please start sentences with a capital letter.

will take care of your comments.
Thanks,
Oza.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters Oza Pawandeep <oza.oza@broadcom.com> - 2017-05-16 07:30 +0200
  Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters Bjorn Helgaas <helgaas@kernel.org> - 2017-05-17 19:20 +0200
    Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters Oza Oza <oza.oza@broadcom.com> - 2017-05-19 03:40 +0200
  Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters Arnd Bergmann <arnd@arndb.de> - 2017-05-17 21:20 +0200
    Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters Oza Oza <oza.oza@broadcom.com> - 2017-05-19 05:00 +0200
    Re: [PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters Oza Oza <oza.oza@broadcom.com> - 2017-05-22 18:50 +0200

csiph-web