lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170803145337.GW30136@localhost>
Date:   Thu, 3 Aug 2017 16:53:37 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Robin Murphy <robin.murphy@....com>
Cc:     Johan Hovold <johan@...nel.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Christoph Hellwig <hch@....de>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andreas Färber <afaerber@...e.de>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-rpi-kernel@...ts.infradead.org,
        stable <stable@...r.kernel.org>,
        Sricharan R <sricharan@...eaurora.org>,
        Stefan Wahren <stefan.wahren@...e.com>
Subject: Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA
 during probe

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ