Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1654127

RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity

From David Laight <David.Laight@ACULAB.COM>
Newsgroups linux.kernel
Subject RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity
Date 2017-05-31 13:10 +0200
Message-ID <tN9FL-3Xv-1@gated-at.bofh.it> (permalink)
References <tAjtf-3t4-7@gated-at.bofh.it> <tDSE9-77p-7@gated-at.bofh.it> <tM8Vr-4dv-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Wolfram Sang
> Sent: 28 May 2017 17:04
> 
> On Fri, May 05, 2017 at 02:08:31PM -0700, Florian Fainelli wrote:
> > On 04/25/2017 05:56 PM, Florian Fainelli wrote:
> > > Changes in v3:
> > >
> > > - added check in usb_gadget_map_request_by_dev (Felipe), new patch
> > > - improved commit message description (Clemens)
> > > - added additiona checks for urb->setup_packet (Alan)
> > >
> > > Changes in v2:
> > >
> > > - moved the check from usb_start_wait_urb() to usb_hcd_map_urb_for_dma()
> >
> > Is this version looking good now? Thanks!
> 
> So, it seems I am in a similar situation with the I2C subsystem right
> now. I need to check the message buffers if they are DMA capable.
> 
> Because you have basically the same checks in 3 different places, and I
> need something similar for I2C, I wondered about a generic place to put
> these checks. Especially since we want future improvements to these
> checks applied everywhere immediately. Here is a small diff on what I
> have now:
...
> +			} else if (!is_dma_capable_addr(urb->transfer_buffer)) {

For a generic function I'd pass the length as well.
It might be that buffers that don't cross page boundaries might be
deemed 'dma-able'.

Possibly more useful would be a variant of (IIRC) dma_map_for_device()
that will allocate a suitable bounce buffer for non-dma memory.
I think it can already do so for memory that is outside the address
range that the device can address (eg for a 32bit PCIe master in 64bit
system).

	David

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity Wolfram Sang <wsa@the-dreams.de> - 2017-05-28 18:10 +0200
  RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity David Laight <David.Laight@ACULAB.COM> - 2017-05-31 13:10 +0200
    Re: RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity Vignesh R <vigneshr@ti.com> - 2017-05-31 14:00 +0200
      Re: RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity Wolfram Sang <wsa@the-dreams.de> - 2017-05-31 18:00 +0200
        Re: RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity Wolfram Sang <wsa@the-dreams.de> - 2017-05-31 21:30 +0200
  Re: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity Vignesh R <vigneshr@ti.com> - 2017-05-31 14:00 +0200
    Re: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity Wolfram Sang <wsa@the-dreams.de> - 2017-05-31 17:20 +0200

csiph-web