From patchwork Fri Sep 26 09:43:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 37955 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0549520F2E for ; Fri, 26 Sep 2014 10:36:10 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id n3sf5503611wiv.9 for ; Fri, 26 Sep 2014 03:36:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=1XxJQ5S1QT4AGupgSx1E+yLkMx5FPkZt1QJx00BjyNc=; b=bpcgH6k8vEnZnjxozkEGIAtgGSTkOcK/JUvOGx8GBFnBzITdgK8T6yQZ6MYZqqlqhD q4XnPjzNRU5J+mA7LDcDqIwVlW7CM4/Mw2FlDu/7v+Ht3rq4nTMVqdLVlS6r2PR4ZH2U MxUAF0yx7ZxpT5C9ufy8cL9Z9C3HRvbGAk0uBGbJUVS5gUHAdq37Y+o2aCEO/BkttSvz NnfCi1LdLMIQssBTVZuCrMBvKW2lstzN5a2uRjUV1TPEhgrqAWMGCzTAGfpt+lCL3vS8 SYPSkcxJh6eREW46xjVl4dwQdy/HWjh+clomdadUBP/86WkccqudxDf/pAXjsX7U60o8 +kXQ== X-Gm-Message-State: ALoCoQmKU7QAMEA47P+WBl60EQvOaQKVZMCsPrNYZ1hHvQ/QW93hael+SXtLOj6cp9XB6jqW27Yt X-Received: by 10.112.52.165 with SMTP id u5mr320602lbo.12.1411727770206; Fri, 26 Sep 2014 03:36:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.97 with SMTP id r1ls357927lar.84.gmail; Fri, 26 Sep 2014 03:36:09 -0700 (PDT) X-Received: by 10.112.200.134 with SMTP id js6mr18350407lbc.0.1411727769949; Fri, 26 Sep 2014 03:36:09 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by mx.google.com with ESMTPS id li6si6575772lbc.87.2014.09.26.03.36.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 03:36:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id 10so12514790lbg.32 for ; Fri, 26 Sep 2014 03:36:09 -0700 (PDT) X-Received: by 10.152.5.168 with SMTP id t8mr19103117lat.67.1411727769714; Fri, 26 Sep 2014 03:36:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp36923lbb; Fri, 26 Sep 2014 03:36:08 -0700 (PDT) X-Received: by 10.70.89.132 with SMTP id bo4mr28568830pdb.35.1411727767742; Fri, 26 Sep 2014 03:36:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si8726500pds.34.2014.09.26.03.36.06 for ; Fri, 26 Sep 2014 03:36:07 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757155AbaIZKf5 (ORCPT + 27 others); Fri, 26 Sep 2014 06:35:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33004 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713AbaIZJp6 (ORCPT ); Fri, 26 Sep 2014 05:45:58 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AD889AD62; Fri, 26 Sep 2014 09:45:53 +0000 (UTC) Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1XXS65-0008Mi-8S; Fri, 26 Sep 2014 11:45:53 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Roger Quadros , Jiri Slaby Subject: [PATCH 3.12 026/142] usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1 Date: Fri, 26 Sep 2014 11:43:57 +0200 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: <406eb8e630446eff74211cba53a536f232bbefd1.1411724723.git.jslaby@suse.cz> References: <406eb8e630446eff74211cba53a536f232bbefd1.1411724723.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Roger Quadros 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit bdd405d2a5287bdb9b04670ea255e1f122138e66 upstream. If user specifies that USB autosuspend must be disabled by module parameter "usbcore.autosuspend=-1" then we must prevent autosuspend of USB hub devices as well. commit 596d789a211d introduced in v3.8 changed the original behaivour and stopped respecting the usbcore.autosuspend parameter for hubs. Fixes: 596d789a211d "USB: set hub's default autosuspend delay as 0" Signed-off-by: Roger Quadros Tested-by: Michael Welling Acked-by: Alan Stern Signed-off-by: Jiri Slaby --- drivers/usb/core/hub.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 557e8a9fe58a..156fe93fb3d9 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1704,8 +1704,12 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) * - Change autosuspend delay of hub can avoid unnecessary auto * suspend timer for hub, also may decrease power consumption * of USB bus. + * + * - If user has indicated to prevent autosuspend by passing + * usbcore.autosuspend = -1 then keep autosuspend disabled. */ - pm_runtime_set_autosuspend_delay(&hdev->dev, 0); + if (hdev->dev.power.autosuspend_delay >= 0) + pm_runtime_set_autosuspend_delay(&hdev->dev, 0); /* * Hubs have proper suspend/resume support, except for root hubs