Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3694088imu; Mon, 28 Jan 2019 09:10:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN4sev9V9tWTFd5C0IlGJjM5Fn3cohodoR1UJthXkJGGN2+eUBug/5o2pAh7/D9V57M71qqQ X-Received: by 2002:a63:86c1:: with SMTP id x184mr20350708pgd.305.1548695417107; Mon, 28 Jan 2019 09:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695417; cv=none; d=google.com; s=arc-20160816; b=ir45x9rxZJ7RNQbEO5U9WNoanEz616ULpYIYqMVqfIC+MoPDgx80gQq41h1tonnV4m dfhzL2+AHgG2W1g5LLpM7J/l+vophxseO2Bagdk8zhL6vkQJcvoHOgxCFaHetIJxXPLC CSGzQTGpEunkeaCfvPPdX4K6pIZIWsRSyKXjEDkwV2AP2GB8KDjNC9Yy1n+8b/c1Ck1g cxAgcXN3M83KzX69itAbDCLKfd50EfZWy5T0fSyNocEIaPLp/Rv51fEvMKdZLbPKuvqU bA2X77ohny7YtC7xQgVYX2CDVF5pJZOUbNpt8ztdhgEoQLz/lmrF2sAoSfcqWM4KICyt 1rPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=L3bC1rdNxvepYohSSJmwMH/r5k0psWXAjIEmn5XzzNY=; b=VoEARPvHDwjz4fZn77ZzWp0DXq/IVwFD8y7MfFD1Mq9FkPjBaCDSBt6Lv0DffHZzfm NvTRt3FJDkyANasxesQfm4WRuY3vFF5h3W0l+prsmA79KOx1PNVvI7016tl53NmGecBD CUvC10Ng+Zh5yiJ3Xuq0u93hd1Nj2dZawg3lFD+B0+8SehLx3r25PKglFUitjh1rrmBo NiOnes7YNIH89lrzWRTNX8CQOItYJgnnkKA8CK4RPQYUBprHnZLMwH+Wm8PMyE3BYS8Y iIt9UnNHs/lONlrk2SNj6TRV0YEzBzgB/G5xPAAqjMxDMEGtYC2f8F1SgJxsxprGi8Av t/9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JIW5HELR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x66si32941596pfk.73.2019.01.28.09.10.01; Mon, 28 Jan 2019 09:10:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JIW5HELR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733194AbfA1RJy (ORCPT + 99 others); Mon, 28 Jan 2019 12:09:54 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:49332 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730854AbfA1RJx (ORCPT ); Mon, 28 Jan 2019 12:09:53 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0SH9o8Q105009; Mon, 28 Jan 2019 11:09:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1548695390; bh=L3bC1rdNxvepYohSSJmwMH/r5k0psWXAjIEmn5XzzNY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=JIW5HELR9w6Cj/3FzuX7x1fjo09yctO1/WXnVtMiLONoETG7XRrRJDwMhkPCKm5lC OUr2F+lmn9RbVGEHWuHDW9j2xkogpaLaMrURJMPbiz/lucHzsJfVrGRR/hUXAwF+KE eZ4gdbEOkEI/Pgos10zm0u3mV1FtU4/j9A6M7dEI= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0SH9ovo124497 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Jan 2019 11:09:50 -0600 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 28 Jan 2019 11:09:50 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 28 Jan 2019 11:09:50 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0SH9otG031329; Mon, 28 Jan 2019 11:09:50 -0600 Date: Mon, 28 Jan 2019 11:09:50 -0600 From: Bin Liu To: Sasha Levin CC: , , Greg Kroah-Hartman , Subject: Re: [PATCH AUTOSEL 4.19 177/258] usb: musb: dsps: fix runtime pm for peripheral mode Message-ID: <20190128170950.GA29630@uda0271908> Mail-Followup-To: Bin Liu , Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org References: <20190128155924.51521-1-sashal@kernel.org> <20190128155924.51521-177-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190128155924.51521-177-sashal@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sasha, On Mon, Jan 28, 2019 at 10:58:03AM -0500, Sasha Levin wrote: > From: Bin Liu > > [ Upstream commit 54578ee883e34d2d1c518d48f1c1e2dd3f387188 ] > > Since the runtime PM support was added in musb, dsps relies on the timer > calling otg_timer() to activate the usb subsystem. However the driver > doesn't enable the timer for peripheral port, then the peripheral port is > unable to be enumerated by a host if the other usb port is disabled or in > peripheral mode too. > > So let's start the timer for peripheral port too. > > Fixes: ea2f35c01d5e ("usb: musb: Fix sleeping function called from invalid context for hdrc glue") > Acked-by: Tony Lindgren > Signed-off-by: Bin Liu > Signed-off-by: Greg Kroah-Hartman > Signed-off-by: Sasha Levin > --- > drivers/usb/musb/musb_dsps.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c > index 1e6d78b1334e..403eb97915f8 100644 > --- a/drivers/usb/musb/musb_dsps.c > +++ b/drivers/usb/musb/musb_dsps.c > @@ -181,9 +181,11 @@ static void dsps_musb_enable(struct musb *musb) > > musb_writel(reg_base, wrp->epintr_set, epmask); > musb_writel(reg_base, wrp->coreintr_set, coremask); > - /* start polling for ID change in dual-role idle mode */ > - if (musb->xceiv->otg->state == OTG_STATE_B_IDLE && > - musb->port_mode == MUSB_OTG) > + /* > + * start polling for runtime PM active and idle, > + * and for ID change in dual-role idle mode. > + */ > + if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) > dsps_mod_timer(glue, -1); > } > > @@ -254,6 +256,10 @@ static int dsps_check_status(struct musb *musb, void *unused) > musb->xceiv->otg->state = OTG_STATE_A_IDLE; > MUSB_HST_MODE(musb); > } > + > + if (musb->port_mode == MUSB_PERIPHERAL) > + skip_session = 1; > + > if (!(devctl & MUSB_DEVCTL_SESSION) && !skip_session) > musb_writeb(mregs, MUSB_DEVCTL, > MUSB_DEVCTL_SESSION); This backport won't apply to stables cleanly. I have sent the manual backport [1] for v4.9+ a few weeks ago. [1] https://marc.info/?l=linux-usb&m=154696698103763&w=2 Regards, -Bin.