Received: by 10.223.164.202 with SMTP id h10csp1185990wrb; Fri, 17 Nov 2017 15:44:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMasEjHiEgpHoZaanguLvxb4RK6eF91g72c7oIfDrrIBsdQ4i+N3J16Xz0uWFfT8PVaozb9Z X-Received: by 10.101.85.3 with SMTP id f3mr6541313pgr.45.1510962265377; Fri, 17 Nov 2017 15:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510962265; cv=none; d=google.com; s=arc-20160816; b=xONPyWMLYcvqOppr+vTfRWUL6qNDYbN+ZmE90Y9KtaA3SnZV4ACfSAGhqMolF4Z99y iBiRqn65/yLoWXUcWGTtbhW1oRP7g6jSDGGoU75zXQzVljB3I4PNtbsYtsXmVYDZvc9F uCioz0ytvoaI8NdKuGzW1v6ae66K1pRIiezVbGkOGB2G/jhxS09FbSZMXI/Wowmv84F8 ryZxLyOuqYyxbr5rH64nbzHoW9Rw8zpsyJ3WOLbEjHpbFpnXwRE3RsFLw2eh60kuFG0V DZMTWHxbUBfb/SJefvn2Q7474p9wNFDJMDPsxxo65LCm/twj4ZgnJKiy4fDjyF33Q0YI s0uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=Na27vJAdbsRzG+TB8Cuvtb4cTni67HON4KrIfCcFuhE=; b=vIvGMVZjlCTbpdn1hr395fTpdhTi+sVROY3wMZFXQjB8732sbBSD0W6YNYv5n66JAw 61e7C7W75mDXJ+WjLnddlhOWz7HP2bhjNm9z9XN9WZQpECudx63fki6SxJTAb/WPANg0 8HqE9vwU0PswhDm+lHWYAgo5jIYbfw+7vjIWxD6e43tdYpfQGhLE7kSruzBq61kG93sG WMNjtsVSCbqAt8qS0hlxu6p3+MIILn+dwYcGtEKTK8ZOIdsZmchVesRKOF7HIWfk6sMV l0Vx5MJWmz3+fQG+2AmcaACb91iWyl8wKIDb7dqDAwW0xwagjRn2NTR41u3JDJ1MbVl8 rMrA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33si3571076pld.210.2017.11.17.15.44.12; Fri, 17 Nov 2017 15:44:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759964AbdKQRn0 (ORCPT + 93 others); Fri, 17 Nov 2017 12:43:26 -0500 Received: from mga09.intel.com ([134.134.136.24]:48388 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752830AbdKQRnR (ORCPT ); Fri, 17 Nov 2017 12:43:17 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Nov 2017 09:43:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,410,1505804400"; d="scan'208";a="2807780" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.164]) ([10.237.72.164]) by fmsmga004.fm.intel.com with ESMTP; 17 Nov 2017 09:43:15 -0800 Subject: Re: question about usb_rebind_intf To: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171117163551.35u3jhimpow2ghw2@cantor> <20171117170915.GA17018@kroah.com> Cc: Alan Stern From: Mathias Nyman Message-ID: <8ffe9b05-8a45-fa8f-8230-e97fb7dda466@linux.intel.com> Date: Fri, 17 Nov 2017 19:45:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171117170915.GA17018@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -Mathias From 1584356335180091902@xxx Fri Nov 17 23:05:44 +0000 2017 X-GM-THRID: 1584356270873252269 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread