Received: by 10.223.164.202 with SMTP id h10csp1282915wrb; Fri, 17 Nov 2017 18:03:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMYonD77PammSMkqgMgggwUWGpfFS+0hsc/uif1WxlL6WYC4F+egqvpT7fR8LAnnkJ/AXD/a X-Received: by 10.98.20.74 with SMTP id 71mr4011764pfu.77.1510970613863; Fri, 17 Nov 2017 18:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510970613; cv=none; d=google.com; s=arc-20160816; b=WFQye64nDGEG7MjavfAxHn+BqPFojk9YLPQoM4OLhBAZjQ1Z9JLChD10ICVjbBINME 5PsGXB0sspcIZTFftZPBqDTWBiPrc5Yoasgn5iRhv/gkVC4BltSQ5rIYgGqOURsPk4nc FEazdQ6Mik2WcnrWmcVkphAIy+aeUIYhmJRIGVH1fb3MYiSV7m1feIkAOhW+3hX4cf0/ KmHw8RWN4yqJsXdXMiUFB8auwxuL+Xp+bE1KJGy+f782YXu0MFzqdxtOfhbgiGRChFYQ yC/KiSuthlApilK3p4KXyyl0lCdM5VYeGoUf04nzrCdpY5oSVziya+cyz0xuPo5lOWpe hUdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=3u9+eNHymj2PGSk+MPwA9TL0zyyFnxGvzhn1UpOorxo=; b=Cn+35rpOr9KEbWu+SILTMwkDXm8MEpsMS1DlMXkoN56xdjmGpciQrRpBj1ufSlfy3b +dCl0OyjODMrX1+Xpyh2JFfNBKFWe1VtCSVTjL0ox2rstrxcE9WNWL6RDdOPu0y6G3Ei iWXkWA01FBtDig7cZQ+gDGDT8VpQq5US8j3McKfV/UCrnYAiP+Blkb087W0aa2CUs2Vv SWBTwhuv80OX303nth6qooeWBf3TZzLtw66ermmBWORWRjAZDVsW4TJkcRaw1z+5awTB Ygq4uv2vjpKJVcL0JbBmIrKQYohy2KR2hLkZtyukhRrv3zftH2FpjO7/Rm9om49Df/MO huQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132si3645782pga.176.2017.11.17.18.03.20; Fri, 17 Nov 2017 18:03:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760268AbdKQSVh (ORCPT + 93 others); Fri, 17 Nov 2017 13:21:37 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:47366 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752501AbdKQSV3 (ORCPT ); Fri, 17 Nov 2017 13:21:29 -0500 Received: (qmail 3392 invoked by uid 2102); 17 Nov 2017 13:21:28 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 17 Nov 2017 13:21:28 -0500 Date: Fri, 17 Nov 2017 13:21:28 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Mathias Nyman cc: Greg Kroah-Hartman , , Subject: Re: question about usb_rebind_intf In-Reply-To: <8ffe9b05-8a45-fa8f-8230-e97fb7dda466@linux.intel.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Nov 2017, Mathias Nyman wrote: > On 17.11.2017 19:09, Greg Kroah-Hartman wrote: > > 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. > > > > I see this as well with btusb driver in resume if port was reset. > > drivers/base/dd.c really_probe() returns -EPROBE_DEFER if it's called before > device_unblock_probing() is called. > > drivers/base/power/main/dpm_complete() will unlock probing after it has > finished resuming all devices and called all the pm_ops .complete callbacks. > > The usb_device_pm_ops .complete callback will try to rebind the interface driver > if device was reset at resume, leading to them -EPROBE_DEFER. > > I guess we either need to rework a few things, or remove that warning. I agree, and the patch seems like a good idea for now. The real fix would be to change the interface drivers by adding proper support for reset-resume. Otherwise there will always be a time window following resume during which the interface is non-functional. Alan Stern From 1584358768200882951@xxx Fri Nov 17 23:44:25 +0000 2017 X-GM-THRID: 1584356270873252269 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread