From patchwork Thu Sep 18 14:07:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 37587 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D81C2054E for ; Thu, 18 Sep 2014 14:09:36 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf607611wgh.0 for ; Thu, 18 Sep 2014 07:09:35 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=AhiKPoEkta8fl/T82rbw48FwyOK+gPa+Yyq9eLzNTlM=; b=ZuJQkhSimnZxF50PkxMxmO/ItmJqhB9hJkuLnBK5V0sQ6wehqObmod6zUooOD0CuIU SCEfT+lq+w5Ni0+rhSbQ6H81w4CTpFVUUiSRzU0LP0KJzlojYgRkwG8zvEFXe4bIzHyg KnVXzCjapZU4AjjY6yCZRnJ0ddkPMkq/YiSCWsCupSC/4pVf9S6U5yiZ6ydBz03Yd2+a /v4JWnn8UPjKPhwj80PhDMYqHeLLmTkRBGUMUVOLGddH5GLzLbIXfWLXbNHtJqXUT8cy U6GakWeyDk36fx8LHLGwcyRPoYXHSmTwa9kgLrgwEJbmsF/KV2Lc2vRWiclp60aDsj+8 /5+g== X-Gm-Message-State: ALoCoQn/Jlpdywb9ScMzhlrsHgJKjxvqnrGVy8ohziyMFWZn8C6S9bOffLws6TakocphzQ1T3d+g X-Received: by 10.194.121.72 with SMTP id li8mr775331wjb.1.1411049375722; Thu, 18 Sep 2014 07:09:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.74 with SMTP id w10ls241296laj.99.gmail; Thu, 18 Sep 2014 07:09:35 -0700 (PDT) X-Received: by 10.152.28.134 with SMTP id b6mr5126049lah.33.1411049375461; Thu, 18 Sep 2014 07:09:35 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id s10si32992576lae.43.2014.09.18.07.09.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Sep 2014 07:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id l4so1197761lbv.5 for ; Thu, 18 Sep 2014 07:09:35 -0700 (PDT) X-Received: by 10.152.7.8 with SMTP id f8mr5060686laa.27.1411049375393; Thu, 18 Sep 2014 07:09:35 -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 of9csp762212lbb; Thu, 18 Sep 2014 07:09:34 -0700 (PDT) X-Received: by 10.70.35.197 with SMTP id k5mr5443275pdj.87.1411049342238; Thu, 18 Sep 2014 07:09:02 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gx11si6733043pbd.145.2014.09.18.07.09.01 for ; Thu, 18 Sep 2014 07:09:02 -0700 (PDT) Received-SPF: none (google.com: stable-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 S1756492AbaIROIu (ORCPT + 1 other); Thu, 18 Sep 2014 10:08:50 -0400 Received: from townshendhl-gw.townshend.cz ([193.165.72.158]:41908 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756223AbaIROIb (ORCPT ); Thu, 18 Sep 2014 10:08:31 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1XUcNj-0001wS-Pf; Thu, 18 Sep 2014 16:08:23 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Roger Quadros , Jiri Slaby Subject: [patch added to the 3.12 stable tree] usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1 Date: Thu, 18 Sep 2014 16:07:10 +0200 Message-Id: <1411049303-7278-17-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411049303-7278-1-git-send-email-jslaby@suse.cz> References: <1411049303-7278-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.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.174 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 This patch has been added to the 3.12 stable tree. If you have any objections, please let us 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