All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Måns Rullgård" <mans@mansr.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: usb: core: skip interfaces disabled in devicetree
Date: Tue, 19 Feb 2019 14:42:44 +0100	[thread overview]
Message-ID: <20190219134244.GA6815@kroah.com> (raw)

On Tue, Feb 19, 2019 at 01:24:51PM +0000, Måns Rullgård wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > On Sat, Feb 16, 2019 at 05:04:52PM +0000, Mans Rullgard wrote:
> >> If an interface has an associated devicetree node with status disabled,
> >> do not register the device.  This is useful for boards with a built-in
> >> multifunction USB device where some functions are broken or otherwise
> >> undesired.
> >> 
> >> Signed-off-by: Mans Rullgard <mans@mansr.com>
> >> ---
> >>  drivers/usb/core/message.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >> 
> >> diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
> >> index bfa5eda0cc26..6b45d4835e41 100644
> >> --- a/drivers/usb/core/message.c
> >> +++ b/drivers/usb/core/message.c
> >> @@ -2007,6 +2007,10 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
> >>  	for (i = 0; i < nintf; ++i) {
> >>  		struct usb_interface *intf = cp->interface[i];
> >>  
> >> +		if (intf->dev.of_node &&
> >> +		    !of_device_is_available(intf->dev.of_node))
> >> +			continue;
> >
> > Shouldn't you at least print some message out saying you are skipping
> > this?  Odds are this is going to cause regressions in devices that were
> > not expecting this, right?  So pointing them at why their devices now no
> > longer work would be good :)
> 
> They will only be skipped if there is a device tree node for the
> interface _and_ it has and explicit status = "disabled" property.
> The default is still to create devices for all interfaces.

Yes, but today if you have such a status field set, it will not skip
them, so who knows who has their DT messed up :)

> That said, printing a message is probably a good idea anyway.  Would
> "info" level be appropriate for this?

That is a good idea.

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Måns Rullgård" <mans@mansr.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: core: skip interfaces disabled in devicetree
Date: Tue, 19 Feb 2019 14:42:44 +0100	[thread overview]
Message-ID: <20190219134244.GA6815@kroah.com> (raw)
In-Reply-To: <yw1xftsjykpo.fsf@mansr.com>

On Tue, Feb 19, 2019 at 01:24:51PM +0000, Måns Rullgård wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> 
> > On Sat, Feb 16, 2019 at 05:04:52PM +0000, Mans Rullgard wrote:
> >> If an interface has an associated devicetree node with status disabled,
> >> do not register the device.  This is useful for boards with a built-in
> >> multifunction USB device where some functions are broken or otherwise
> >> undesired.
> >> 
> >> Signed-off-by: Mans Rullgard <mans@mansr.com>
> >> ---
> >>  drivers/usb/core/message.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >> 
> >> diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
> >> index bfa5eda0cc26..6b45d4835e41 100644
> >> --- a/drivers/usb/core/message.c
> >> +++ b/drivers/usb/core/message.c
> >> @@ -2007,6 +2007,10 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
> >>  	for (i = 0; i < nintf; ++i) {
> >>  		struct usb_interface *intf = cp->interface[i];
> >>  
> >> +		if (intf->dev.of_node &&
> >> +		    !of_device_is_available(intf->dev.of_node))
> >> +			continue;
> >
> > Shouldn't you at least print some message out saying you are skipping
> > this?  Odds are this is going to cause regressions in devices that were
> > not expecting this, right?  So pointing them at why their devices now no
> > longer work would be good :)
> 
> They will only be skipped if there is a device tree node for the
> interface _and_ it has and explicit status = "disabled" property.
> The default is still to create devices for all interfaces.

Yes, but today if you have such a status field set, it will not skip
them, so who knows who has their DT messed up :)

> That said, printing a message is probably a good idea anyway.  Would
> "info" level be appropriate for this?

That is a good idea.

thanks,

greg k-h

             reply	other threads:[~2019-02-19 13:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 13:42 Greg Kroah-Hartman [this message]
2019-02-19 13:42 ` [PATCH] usb: core: skip interfaces disabled in devicetree Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2019-02-19 14:52 [v2] " Måns Rullgård
2019-02-19 14:52 ` [PATCH v2] " Mans Rullgard
2019-02-19 13:24 Måns Rullgård
2019-02-19 13:24 ` [PATCH] " Måns Rullgård
2019-02-19 13:11 Greg Kroah-Hartman
2019-02-19 13:11 ` [PATCH] " Greg Kroah-Hartman
2019-02-16 17:04 Måns Rullgård
2019-02-16 17:04 ` [PATCH] " Mans Rullgard

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=20190219134244.GA6815@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mans@mansr.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.