RE: [EXT] Re: Enforce USB DMA allocations to specific range

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

 



-----Original Message-----
From: Greg KH <greg@xxxxxxxxx> 
Sent: Monday, December 28, 2020 4:19 PM
To: Noam Liron <lnoam@xxxxxxxxxxx>
Cc: linux-usb@xxxxxxxxxxxxxxx; Yuval Shaia <yshaia@xxxxxxxxxxx>
Subject: [EXT] Re: Enforce USB DMA allocations to specific range

External Email

----------------------------------------------------------------------
On Mon, Dec 28, 2020 at 01:54:41PM +0000, Noam Liron wrote:
> Hi Greg and thanks for your reply for my previous q. (Proper way to set a DMA_MASK on a USB device).
> 
> I am rephrasing my questions:
> 
> 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 at the range 0x200000000 -  0x220000000.
> This is a SoC constraint.
> Setting the controller dma_mask to 0x21FFFFFFF, didn't solve the problem, as I noticed that URB streaming DMA are first allocated by kmalloc and alike, which are not affected by the dma_mask.

Why not get support from who ever is forcing you to use that old kernel version?  You are paying them for this, right?  :)

[NL] As of now, this is the newest kernel version for this soc, and I am the developer of this soc.
The soc enforces that specific constraint, and AFAIK, USB infrastructure is already built to deal with it, and a newer kernel won't supply with better solution.

> I plan to do the following:
> Alloc coherent memory for the HCD using 'dma_declare_coherent_memory', and use the HCD_LOCAL_MEM so the usb core is told that it must copy data into local memory if the buffers happen to be placed in regular memory.
> 
> Is that the right way to deal with this case?

Have you looked at how all of the existing host controller drivers do this?  Why will they not "just work" properly for you as well?[NL]  I have looked at ohci-sm501.c as it seems to solve similar problem to the one I deal with.
What host controller driver are you using?[NL]  ehci-orion.c

thanks,

greg k-h




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux