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


Groups > linux.kernel > #1703179

Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA during probe

From Johan Hovold <johan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA during probe
Date 2017-08-03 17:00 +0200
Message-ID <uapLr-1ol-5@gated-at.bofh.it> (permalink)
References <uaocH-rc-29@gated-at.bofh.it> <uaoZ5-12B-31@gated-at.bofh.it> <uapip-1cj-11@gated-at.bofh.it> <uapBM-1kp-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 03, 2017 at 03:48:06PM +0100, Robin Murphy wrote:
> On 03/08/17 15:23, Johan Hovold wrote:
> > On Thu, Aug 03, 2017 at 10:04:21AM -0400, Alan Stern wrote:
> >> On Thu, 3 Aug 2017, Johan Hovold wrote:
> >>> diff --git a/include/linux/usb.h b/include/linux/usb.h

> >>> index cb9fbd54386e..f86ad9d8c756 100644
> >>> --- a/include/linux/usb.h
> >>> +++ b/include/linux/usb.h
> >>> @@ -1222,6 +1222,11 @@ struct usb_device_driver {
> >>>  
> >>>  extern struct bus_type usb_bus_type;
> >>>  
> >>> +static inline bool dev_is_usb(struct device *dev)
> >>> +{
> >>> +	return dev->bus == &usb_bus_type;
> >>> +}
> >>> +
> >>
> >> Will this work if the USB subsystem is built as a module?
> > 
> > Nope. :-/
> 
> Oh bum, I hadn't even realised usb_bus_type could be modular.
> 
> > Add another flag (e.g. skip_dma_configure) to struct device for now?
> 
> Would it be sufficient to look for dev->of_node_reused, or is it also
> possible for USB devices to have OF nodes of their own such that
> of_dma_configure() would still blat the mask with a 32-bit default?
> (Although that would still un-break Rpi3, even if strictly wrong)

Yes, USB devices can have their own OF nodes so of_node_reused would not
prevent of_dma_configure() from being called for them.

But testing against the platform bus instead of not-USB should do the
trick.

Johan

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


Thread

[PATCH v2] dma-mapping: skip USB devices when configuring DMA during probe Johan Hovold <johan@kernel.org> - 2017-08-03 15:20 +0200
  Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Robin Murphy <robin.murphy@arm.com> - 2017-08-03 15:30 +0200
  Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Alan Stern <stern@rowland.harvard.edu> - 2017-08-03 16:10 +0200
    Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Johan Hovold <johan@kernel.org> - 2017-08-03 16:30 +0200
      Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Robin Murphy <robin.murphy@arm.com> - 2017-08-03 16:50 +0200
        Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Johan Hovold <johan@kernel.org> - 2017-08-03 17:00 +0200
      Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Johan Hovold <johan@kernel.org> - 2017-08-03 16:50 +0200
        Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe Johan Hovold <johan@kernel.org> - 2017-08-03 18:00 +0200
  Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA  during probe kbuild test robot <lkp@intel.com> - 2017-08-06 13:30 +0200

csiph-web