From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966076AbdKQRJY (ORCPT ); Fri, 17 Nov 2017 12:09:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47278 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966052AbdKQRJL (ORCPT ); Fri, 17 Nov 2017 12:09:11 -0500 Date: Fri, 17 Nov 2017 18:09:15 +0100 From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: question about usb_rebind_intf Message-ID: <20171117170915.GA17018@kroah.com> References: <20171117163551.35u3jhimpow2ghw2@cantor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171117163551.35u3jhimpow2ghw2@cantor> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 17, 2017 at 09:35:51AM -0700, Jerry Snitselaar wrote: > Should this skip warning that the rebind failed if device_attach > is returning -EPROBE_DEFER? If I do something like 'rtcwake -m mem -s 30' > on a laptop I have here I will see a couple "rebind failed: -517" messages > as it comes back out of suspend. Since the device probe eventually happens > once probes are not deferred wondering if this warning this be given in that > case. > > > diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c > index 64262a9a8829..5d3408010112 100644 > --- a/drivers/usb/core/driver.c > +++ b/drivers/usb/core/driver.c > @@ -1070,7 +1070,7 @@ static void usb_rebind_intf(struct usb_interface *intf) > if (!intf->dev.power.is_prepared) { > intf->needs_binding = 0; > rc = device_attach(&intf->dev); > - if (rc < 0) > + if (rc < 0 && rc != -EPROBE_DEFER) > dev_warn(&intf->dev, "rebind failed: %d\n", rc); > } > } What USB driver is returning -EPROBE_DEFER to cause this to be an issue? Shouldn't that really only be for "platform" drivers and the like? USB interface drivers should all be "self-contained" within reason. thanks, greg k-h