linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Noam Liron <lnoam@marvell.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Yuval Shaia <yshaia@marvell.com>
Subject: Re: Enforce USB DMA allocations to specific range
Date: Mon, 28 Dec 2020 15:18:41 +0100	[thread overview]
Message-ID: <X+npQe45AXcsFGu1@kroah.com> (raw)
In-Reply-To: <BYAPR18MB274197EFE1391905899D2F07B9D91@BYAPR18MB2741.namprd18.prod.outlook.com>

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?  :)

> 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?
What host controller driver are you using?

thanks,

greg k-h

  reply	other threads:[~2020-12-28 14:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 13:54 Enforce USB DMA allocations to specific range Noam Liron
2020-12-28 14:18 ` Greg KH [this message]
2020-12-28 15:18   ` [EXT] " Noam Liron
2021-02-11  8:38   ` Noam Liron
2021-02-11  9:02     ` Greg Kroah-Hartman
2021-02-11 16:00     ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X+npQe45AXcsFGu1@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lnoam@marvell.com \
    --cc=yshaia@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).