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

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

 



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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]