* Proper way to set a DMA_MASK on a USB device
@ 2020-12-25 8:18 Noam Liron
2020-12-25 11:56 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Noam Liron @ 2020-12-25 8:18 UTC (permalink / raw)
To: linux-usb@vger.kernel.org
Hi All,
I am working on LK 4.14.76, on a SOC in which RAM starts at 0x200000000, and need to limit DMA buffer allocations to be below 0x220000000.
I planned to do it by setting dma_mask to 0x21FFFFFFF.
But in drivers/usb/core/usb.c:590 I see the following:
Note: calling dma_set_mask() on a USB device would set the
mask for the entire HCD, so don't do that.
I also found related message:
https://marc.info/?l=linux-usb&m=160023769800697&w=2 : "... as the dma_mask is set by default for most busses".
So how can I set properly the dma_mask?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Proper way to set a DMA_MASK on a USB device
2020-12-25 8:18 Proper way to set a DMA_MASK on a USB device Noam Liron
@ 2020-12-25 11:56 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-12-25 11:56 UTC (permalink / raw)
To: Noam Liron; +Cc: linux-usb@vger.kernel.org
On Fri, Dec 25, 2020 at 08:18:14AM +0000, Noam Liron wrote:
> Hi All,
>
> I am working on LK 4.14.76, on a SOC in which RAM starts at 0x200000000, and need to limit DMA buffer allocations to be below 0x220000000.
> I planned to do it by setting dma_mask to 0x21FFFFFFF.
>
> But in drivers/usb/core/usb.c:590 I see the following:
> Note: calling dma_set_mask() on a USB device would set the
> mask for the entire HCD, so don't do that.
>
> I also found related message:
> https://marc.info/?l=linux-usb&m=160023769800697&w=2 : "... as the dma_mask is set by default for most busses".
>
> So how can I set properly the dma_mask?
Your USB host controller device sets that up properly, no need to do it
for any individual USB device. I think the resources that the
controller gets assigned for this should handle it for you.
greg k-h
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-25 12:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-25 8:18 Proper way to set a DMA_MASK on a USB device Noam Liron
2020-12-25 11:56 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).