From patchwork Mon Aug 4 09:44:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 34823 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29EEB21F5F for ; Mon, 4 Aug 2014 09:45:08 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp18sf36847829obc.9 for ; Mon, 04 Aug 2014 02:45:05 -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:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=kK0VzOX51G3poYBl/klEc0ShiMx5ALtkuWMtutVL6fU=; b=d1Diu1QGn2wklkWTL0N9S9P+aEvE0iefkTQpElXcsPlmYjAttx0sRzKwiG+6Ks25pl yWPK2q1VsGGpyiJJRYn/46IAhJuPluVVtgJdevUnswUcvAG3mvmOhWY3rb4AkY8GFJsB gikcl75lRJhRxbsYJc2Kly8+GdYavkq9KshhxcCB5WTUX7b0T5MOAVdubSSK0/0hx1Cs PHWkGJsrF5iUn8O9UY3V4JtdnIN9U/MaNzS7uGYX3fF2D4HUuuNYttPQKTPoy3gG/OTr NB+aly1uOVScENZopW4FnM6nTyTMDBxeqdZChDI6LIdfAgDX26hSvwyzG3+wNGewsIn8 8U/g== X-Gm-Message-State: ALoCoQlnRT6IrkNIkRPB+Dyr9ko8crK1+Afrn5t9VP2YbpQaC0Xff+W3g94wlSb2cbQ39Y0ckTET X-Received: by 10.50.49.33 with SMTP id r1mr8391785ign.3.1407145505082; Mon, 04 Aug 2014 02:45:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.227 with SMTP id e90ls73503qgf.72.gmail; Mon, 04 Aug 2014 02:45:04 -0700 (PDT) X-Received: by 10.52.88.74 with SMTP id be10mr4076898vdb.54.1407145504953; Mon, 04 Aug 2014 02:45:04 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id xw5si11615062vcb.11.2014.08.04.02.45.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Aug 2014 02:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so10544092vcb.23 for ; Mon, 04 Aug 2014 02:45:04 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr18723797vdc.40.1407145504794; Mon, 04 Aug 2014 02:45:04 -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.37.5 with SMTP id tc5csp291217vcb; Mon, 4 Aug 2014 02:45:04 -0700 (PDT) X-Received: by 10.66.122.175 with SMTP id lt15mr22597094pab.77.1407145503854; Mon, 04 Aug 2014 02:45:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dt16si8524655pdb.366.2014.08.04.02.45.03 for ; Mon, 04 Aug 2014 02:45:03 -0700 (PDT) Received-SPF: none (google.com: linux-usb-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 S1752190AbaHDJpA (ORCPT + 2 others); Mon, 4 Aug 2014 05:45:00 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:54533 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbaHDJo7 (ORCPT ); Mon, 4 Aug 2014 05:44:59 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s749iqx2031230; Mon, 4 Aug 2014 04:44:52 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s749iq1V016886; Mon, 4 Aug 2014 04:44:52 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Mon, 4 Aug 2014 04:44:52 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s749im3f029005; Mon, 4 Aug 2014 04:44:49 -0500 From: Roger Quadros To: , CC: , , , , , , Roger Quadros , "[3.8+]" Subject: [PATCH] usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1 Date: Mon, 4 Aug 2014 12:44:46 +0300 Message-ID: <1407145486-14013-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@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.220.178 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 Acked-by: Alan Stern Tested-by: Michael Welling --- 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 0e950ad..a287cd5 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1728,8 +1728,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