From patchwork Mon Jun 16 15:53:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 4360481 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DB95F9F314 for ; Mon, 16 Jun 2014 15:53:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF2AE20279 for ; Mon, 16 Jun 2014 15:53:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B55CA201C8 for ; Mon, 16 Jun 2014 15:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754043AbaFPPxl (ORCPT ); Mon, 16 Jun 2014 11:53:41 -0400 Received: from canardo.mork.no ([148.122.252.1]:43250 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752984AbaFPPxk (ORCPT ); Mon, 16 Jun 2014 11:53:40 -0400 Received: from nemi.mork.no (nemi.mork.no [IPv6:2001:4641:0:2:e8b:fdff:fe08:971]) (authenticated bits=0) by canardo.mork.no (8.14.4/8.14.4) with ESMTP id s5GFrYEJ026294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 16 Jun 2014 17:53:34 +0200 Received: from bjorn by nemi.mork.no with local (Exim 4.80) (envelope-from ) id 1WwZDy-0001Jg-6r; Mon, 16 Jun 2014 17:53:34 +0200 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Alan Stern Cc: Dan Williams , USB list , Linux-pm mailing list Subject: Re: v3.16-rc1 regression? unexpected usb_autopm_get_interface error Organization: m References: <874mzkga1p.fsf@nemi.mork.no> Date: Mon, 16 Jun 2014 17:53:33 +0200 In-Reply-To: <874mzkga1p.fsf@nemi.mork.no> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Mon, 16 Jun 2014 17:15:46 +0200") Message-ID: <8738f426ma.fsf@nemi.mork.no> User-Agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.98.1 at canardo X-Virus-Status: Clean Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Bjørn Mork writes: > Alan Stern writes: >> On Mon, 16 Jun 2014, Bjørn Mork wrote: >>> Bjørn Mork writes: >>> >>> > So the problem is related to runtime suspend before first use. I >>> > strongly suspect >>> > >>> > aae4518b3124 PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily >>> >>> Nope, that was not it. So if blind guessing isn't going to work, then I >>> guess there is no way around a bisect :-) >> >> You could simply wait for someone who knows the code to answer the >> question. :-) > > Wait? Do I look like I'm patient :-) > > Besides, it was actually relieving to bisect a reliably reproducible > non-crashing bug for once ;-) > >> I'm pretty sure this resulted from one of Dan Williams's changes to USB >> port runtime PM. A whole bunch of them were added in 3.15-rc1. > > You are *so* much better at guessing than me: > > 9262c19d14c433a6a1ba25c3ff897cb89e412309 is the first bad commit And for completeness, I just tried the following partial revert on top of v3.16-rc1 and can confirm that it works fine for me: But I'm not submitting that patch as I assume Dan wants to fix this up properly. Whatever that is... I don't understand any of the port magic. Bjørn From f8cba987220ae6cca98d662704256839968c6a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Mon, 16 Jun 2014 17:26:05 +0200 Subject: [PATCH] usb: fix port runtime pm regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a partial revert of commit 9262c19d14c4 ("usb: disable port power control if not supported in wHubCharacteristics") Fixes: 9262c19d14c4 ("usb: disable port power control if not supported in wHubCharacteristics") Signed-off-by: Bjørn Mork --- drivers/usb/core/port.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index 62036faf56c0..13a2ffb4b18a 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -411,15 +411,12 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1) pm_runtime_set_active(&port_dev->dev); - /* - * Do not enable port runtime pm if the hub does not support - * power switching. Also, userspace must have final say of - * whether a port is permitted to power-off. Do not enable - * runtime pm if we fail to expose pm_qos_no_power_off. + /* It would be dangerous if user space couldn't + * prevent usb device from being powered off. So don't + * enable port runtime pm if failed to expose port's pm qos. */ - if (hub_is_port_power_switchable(hub) - && dev_pm_qos_expose_flags(&port_dev->dev, - PM_QOS_FLAG_NO_POWER_OFF) == 0) + if (!dev_pm_qos_expose_flags(&port_dev->dev, + PM_QOS_FLAG_NO_POWER_OFF)) pm_runtime_enable(&port_dev->dev); device_enable_async_suspend(&port_dev->dev); -- 1.7.10.4