stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Robin Murphy <robin.murphy@arm.com>
Cc: "Johan Hovold" <johan@kernel.org>,
	"Alan Stern" <stern@rowland.harvard.edu>,
	"Christoph Hellwig" <hch@lst.de>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Andreas Färber" <afaerber@suse.de>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	stable <stable@vger.kernel.org>,
	"Sricharan R" <sricharan@codeaurora.org>,
	"Stefan Wahren" <stefan.wahren@i2se.com>
Subject: Re: [PATCH v2] dma-mapping: skip USB devices when configuring DMA during probe
Date: Thu, 3 Aug 2017 16:53:37 +0200	[thread overview]
Message-ID: <20170803145337.GW30136@localhost> (raw)
In-Reply-To: <ccee85b5-832f-b2b8-e4ac-69165efff184@arm.com>

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

  reply	other threads:[~2017-08-03 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 13:14 [PATCH v2] dma-mapping: skip USB devices when configuring DMA during probe Johan Hovold
2017-08-03 13:20 ` Robin Murphy
2017-08-03 14:04 ` Alan Stern
2017-08-03 14:23   ` Johan Hovold
2017-08-03 14:48     ` Robin Murphy
2017-08-03 14:53       ` Johan Hovold [this message]
2017-08-03 14:49     ` Johan Hovold
2017-08-03 15:57       ` Johan Hovold
2017-08-06 11:27 ` kbuild test robot

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=20170803145337.GW30136@localhost \
    --to=johan@kernel.org \
    --cc=afaerber@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=sricharan@codeaurora.org \
    --cc=stable@vger.kernel.org \
    --cc=stefan.wahren@i2se.com \
    --cc=stern@rowland.harvard.edu \
    /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).