From patchwork Wed Aug 27 12:11:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 36084 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 355BE2054F for ; Wed, 27 Aug 2014 12:11:37 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf729747pab.1 for ; Wed, 27 Aug 2014 05:11:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=qPTuIy86tGW8X1yC6L6bLYJ3CSwMzaqwl/9qTv0QN5U=; b=SfPUtqHo2vdRNeNMYkv8AsIieP9qoWH9M5yM7WQGaGXkslkeQwepW5OKMpIsxYRcP9 m+ibSUaLyV9w7T3ebNIF1PcNa0eK/vpb2YlviZzVc/vKc1JWpy4DjSZKiTUQWWkJSXU+ eBZVygKEJ96oY8SG84hV1kcXxOESn44SFHJPnM4nruDaUkeC88/hEGLgviv3Tf0vraFz X7YtEHKrEvzkYnn4ZPilDYUvN0rYmwGp2/lSAXnL0PfbbEkw4O+u2zHzdBtlQZ5mEHlH wpJhliQnBuU0Coy1/7DYP/Mt4wDCsyGSjfXl9jgmEmcaTiPhHXRJGzGJaCptZ6yfOy8K M+aQ== X-Gm-Message-State: ALoCoQm5xnadrjHjsjLCcRP1L/tPsHO3cc873ogvvqzKqGbBQldLvXQV4OY8igS6EjEFjyASe0U8 X-Received: by 10.66.162.162 with SMTP id yb2mr12058073pab.39.1409141491548; Wed, 27 Aug 2014 05:11:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.99 with SMTP id n90ls90880qge.66.gmail; Wed, 27 Aug 2014 05:11:31 -0700 (PDT) X-Received: by 10.236.199.97 with SMTP id w61mr52755253yhn.36.1409141491443; Wed, 27 Aug 2014 05:11:31 -0700 (PDT) Received: from mail-yh0-f44.google.com (mail-yh0-f44.google.com [209.85.213.44]) by mx.google.com with ESMTPS id c58si34425yhn.171.2014.08.27.05.11.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 05:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.213.44 as permitted sender) client-ip=209.85.213.44; Received: by mail-yh0-f44.google.com with SMTP id f73so118741yha.31 for ; Wed, 27 Aug 2014 05:11:31 -0700 (PDT) X-Received: by 10.220.110.77 with SMTP id m13mr955316vcp.35.1409141491359; Wed, 27 Aug 2014 05:11:31 -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.221.45.67 with SMTP id uj3csp71468vcb; Wed, 27 Aug 2014 05:11:30 -0700 (PDT) X-Received: by 10.68.217.106 with SMTP id ox10mr44996687pbc.27.1409141490312; Wed, 27 Aug 2014 05:11:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rl7si8729534pab.218.2014.08.27.05.11.27 for ; Wed, 27 Aug 2014 05:11:28 -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 S933594AbaH0ML0 (ORCPT + 26 others); Wed, 27 Aug 2014 08:11:26 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:41077 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933520AbaH0MLY (ORCPT ); Wed, 27 Aug 2014 08:11:24 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s7RCBEsk004081; Wed, 27 Aug 2014 07:11:14 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7RCBEuJ024555; Wed, 27 Aug 2014 07:11:14 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 27 Aug 2014 07:11:14 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7RCBBf6025251; Wed, 27 Aug 2014 07:11:11 -0500 Message-ID: <53FDCADE.3040601@ti.com> Date: Wed, 27 Aug 2014 15:11:10 +0300 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: , CC: , , , , , , "[3.8+]" Subject: [PATCH v2] usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1 References: <1407145486-14013-1-git-send-email-rogerq@ti.com> In-Reply-To: <1407145486-14013-1-git-send-email-rogerq@ti.com> 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: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.213.44 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: , 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" Cc: [3.8+] Signed-off-by: Roger Quadros --- drivers/usb/core/hub.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 8a4dcbc..59b599d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1728,8 +1728,14 @@ 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); +#ifdef CONFIG_PM_RUNTIME + if (hdev->dev.power.autosuspend_delay >= 0) + pm_runtime_set_autosuspend_delay(&hdev->dev, 0); +#endif /* * Hubs have proper suspend/resume support, except for root hubs