Re: [PATCH] PCI: dwc: Modify the check about MSI DMA mask 32-bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> --------- Original Message ---------
> Sender : Christoph Hellwig <hch@xxxxxxxxxxxxx>
> Date : 2022-03-31 00:45 (GMT+9)
> Title : Re: [PATCH] PCI: dwc: Modify the check about MSI DMA mask 32-bit
> 
> On Wed, Mar 30, 2022 at 11:35:26AM +0200, Alexander Lobakin wrote:
>> I'm not super familiar with the DMA internals, so adding Chris here,
>> maybe he'd like to comment, but anyway, the lower/arch layer must
>> not give the DMA addresses wider than the number of bits passed to
>> dma_set_mask() if that call returned 0.
> 
> So, the basic assumption in the kernel is that 32-bit DMA is always
> supported, and dma_set_maks for that should not fail.  If the
> system (or root port, internal interconnect) supports less than that
> we'll bounce buffer.  But how and why would you hand out addresses
> larger than that?  It really is not valid, but I can't even see how
> it could happen.

Hello,
thank you for your review.

Yes, the dma address should not be used in excess of the mask value
set through dma_set_mask().

If I want to use 33+bit dma address on 64bit system, I have to call
dma_set_mask(33+) again after below code in dw_pcie_host_init() is
performed.
This is because dw_pcie_host_init(32) is always called in 
dw_pcie_host_init() without any conditions.
Is this right?

Also, if I assign 33+bit dma address before dw_pcie_host_init() to 
use 33+bit dma address on 64bit system, dma_set_mask(32) is called 
and dma_mask is changed to 32 but dma address is maintained 33+,
so error occurs.
it is not a issue with the dma_set_mask() function, but the 
called condition must need to be modified.

Thank you.




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux