[PATCH v2 00/18] Improve PCI memory mapping API
Damien Le Moal
dlemoal at kernel.org
Wed Apr 3 00:58:42 PDT 2024
On 4/3/24 16:50, Manivannan Sadhasivam wrote:
> On Sat, Mar 30, 2024 at 01:19:10PM +0900, Damien Le Moal wrote:
>> This series introduces the new functions pci_epc_map_align(),
>> pci_epc_mem_map() and pci_epc_mem_unmap() to improve handling of the
>> PCI address mapping alignment constraints of endpoint controllers in a
>> controller independent manner.
>>
>> The issue fixed is that the fixed alignment defined by the "align" field
>> of struct pci_epc_features assumes that the alignment of the endpoint
>> memory used to map a RC PCI address range is independent of the PCI
>> address being mapped. But that is not the case for the rk3399 SoC
>> controller: in endpoint mode, this controller uses the lower bits of the
>> local endpoint memory address as the lower bits for the PCI addresses
>> for data transfers. That is, when mapping local memory, one must take
>> into account the number of bits of the RC PCI address that change from
>> the start address of the mapping.
>>
>> To fix this, the new endpoint controller method .map_align is introduced
>> and called from pci_epc_map_align(). This method is optional and for
>> controllers that do not define it, the mapping information returned
>> is based of the fixed alignment constraint as defined by the align
>> feature.
>>
>> The functions pci_epc_mem_map() is a helper function which obtains
>> mapping information, allocates endpoint controller memory according to
>> the mapping size obtained and maps the memory. pci_epc_mem_map() unmaps
>> and frees the endpoint memory.
>>
>> This series is organized as follows:
>> - Patch 1 tidy up the epc core code
>> - Patch 2 and 3 introduce the new map_align endpoint controller method
>> and related epc functions.
>> - Patch 4 to 6 modify the test endpoint driver to use these new
>> functions and improve the code of this driver.
>
> While posting the next version, please split the endpoint patches into a
> separate series. It helps in code review and can be applied separately.
Which patches ? They are all endpoint related:
(1) Core code
(2) test function driver
(3) rockchip rk3399 controller
(2) and (3) depend on the patches in (1), so splitting the series is a big
possible only if (1) is applied first, so that is a source of delays and breaks
the context of the patches...
--
Damien Le Moal
Western Digital Research
More information about the linux-arm-kernel
mailing list