Received: by 10.223.185.111 with SMTP id b44csp178501wrg; Fri, 9 Mar 2018 03:14:50 -0800 (PST) X-Google-Smtp-Source: AG47ELtReIaw+xKfSQrJquSnmVxYjR6g3xlua48ElW8r5Ks9TTIUIw4CyROS0zy+9wzh7w1iRxuJ X-Received: by 10.101.93.134 with SMTP id f6mr24221660pgt.293.1520594090355; Fri, 09 Mar 2018 03:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520594090; cv=none; d=google.com; s=arc-20160816; b=zAWYgqeMIJ87cB/772n5JOQm8b+VM8kgHgCPtGTkWk5F1ZVO4cl1y+tqqfv5Oy/jSV 7c1lTqSCx6huX2veHyvF4Ox+cqE3m9PPttStHI3atfH+fRink9RnoDb+6FIc5EOPWDyB PnMWBF4j5YyeN0buFxmuwjatAkwi5h8NT82Epde3l4KrHMVWac+PckWZrai7XnSYiMNZ vvjOybJQdZ+EQNJJSE+RYoFxLO/dv0AJZ2+zuDtGilin/gnmlE6rRe1fLh1fmC564REE qbOMtZeCuf1LmWLjdTgCIg5kH8WMQN2/YcED4HroGtF//luEJU2TY4PH/+Bv94M8vBo6 l+YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=tqlqDoBYGUELvDKpk6vMpqaiG6Xr292oTBYS+XRLD3c=; b=xCO9x+t6CK4f5swMOSH3TOY8BVFyafGPA9wfFb1MEjkRmjFOz4Ay+XkmUBa17w/538 rnZ8C6ZU7bib786LzBR8RSFCx86Fq2ePsQSv6o5fc4U473q0eMlw2Lls4b9fC1c2R+/S dr5ix7t/FnSy/GqFZ80Bzez/khG1aofM4ZAWV5ZpfBTR3cK8Cg4Ks+XC9BuSIKa1p8No aTBtxT5w1DAzGrEsz0+wp1A9W/u0St/TXukSVmsG4vQpKD2hWXR83iEqk8s/u/YHqnuo QAblBBvag3059f7RL96ZF531WDD0WKFO9oWUTFy9Zv0xbiyUqzdLVEhiNaw8inoZz5XA okJA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w71si591035pgd.435.2018.03.09.03.14.35; Fri, 09 Mar 2018 03:14:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751070AbeCILNW convert rfc822-to-8bit (ORCPT + 99 others); Fri, 9 Mar 2018 06:13:22 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:4440 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbeCILNU (ORCPT ); Fri, 9 Mar 2018 06:13:20 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Fri, 09 Mar 2018 03:13:05 -0800 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 09 Mar 2018 03:13:19 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 09 Mar 2018 03:13:19 -0800 Received: from UKMAIL101.nvidia.com (10.26.138.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 9 Mar 2018 11:13:19 +0000 Received: from [10.21.132.129] (10.21.132.129) by UKMAIL101.nvidia.com (10.26.138.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 9 Mar 2018 11:13:15 +0000 Subject: Re: [PATCH 2/3] usb: xhci: tegra: Add runtime PM support To: Thierry Reding CC: Mathias Nyman , Mathias Nyman , Greg Kroah-Hartman , , , References: <1518626085-29102-1-git-send-email-jonathanh@nvidia.com> <1518626085-29102-2-git-send-email-jonathanh@nvidia.com> <54bd00b7-2835-a253-0399-370e8c8203b8@linux.intel.com> <20180309083629.GA13877@ulmo> From: Jon Hunter Message-ID: <939222b8-62c3-aea5-625c-a3490958a306@nvidia.com> Date: Fri, 9 Mar 2018 11:13:13 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180309083629.GA13877@ulmo> X-Originating-IP: [10.21.132.129] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/03/18 08:36, Thierry Reding wrote: > On Thu, Mar 08, 2018 at 09:31:07PM +0000, Jon Hunter wrote: >> >> On 01/03/18 14:18, Mathias Nyman wrote: >>> On 14.02.2018 18:34, Jon Hunter wrote: >>>> Add runtime PM support to the Tegra XHCI driver and move the function >>>> calls to enable/disable the clocks, regulators and PHY into the runtime >>>> PM callbacks. >>>> >>>> Signed-off-by: Jon Hunter >>>> --- >>>>   drivers/usb/host/xhci-tegra.c | 80 >>>> ++++++++++++++++++++++++++++++------------- >>>>   1 file changed, 56 insertions(+), 24 deletions(-) >>>> >>>> diff --git a/drivers/usb/host/xhci-tegra.c >>>> b/drivers/usb/host/xhci-tegra.c >>>> index 02b0b24faa58..42aa67858b53 100644 >>>> --- a/drivers/usb/host/xhci-tegra.c >>>> +++ b/drivers/usb/host/xhci-tegra.c >>>> @@ -18,6 +18,7 @@ >>>>   #include >>>>   #include >>>>   #include >>>> +#include >>>>   #include >>>>   #include >>>>   #include >>>> @@ -1067,22 +1068,12 @@ static int tegra_xusb_probe(struct >>>> platform_device *pdev) >>>>        */ >>>>       platform_set_drvdata(pdev, tegra); >>>>   -    err = tegra_xusb_clk_enable(tegra); >>>> -    if (err) { >>>> -        dev_err(&pdev->dev, "failed to enable clocks: %d\n", err); >>>> -        goto put_usb2; >>>> -    } >>>> - >>>> -    err = regulator_bulk_enable(tegra->soc->num_supplies, >>>> tegra->supplies); >>>> -    if (err) { >>>> -        dev_err(&pdev->dev, "failed to enable regulators: %d\n", err); >>>> -        goto disable_clk; >>>> -    } >>>> +    pm_runtime_enable(&pdev->dev); >>>>   -    err = tegra_xusb_phy_enable(tegra); >>>> +    err = pm_runtime_get_sync(&pdev->dev); >>>>       if (err < 0) { >>> >>> Does this mean that if runtime PM is disabled then clocks and regulator >>> will never be enabled >>> for Tegra xhci? >>> >>> How about keeping the clock and regualtor enabling in probe, and instead >>> add something like: >>> >>> pm_runtime_set_active(&pdev->dev); >>> pm_runtime_enable(&pdev->dev); >>> pm_runtime_get_noresume(&pdev->dev); >> >> For 64-bit Tegra there is a dependency on CONFIG_PM, but for 32-bit >> AFAIK there is not and so yes we should handle the case when PM_RUNTIME >> is disabled. >> >> Typically we do something like ... >> >> pm_runtime_enable(&pdev->dev); >> if (!pm_runtime_enabled(&pdev->dev)) >> ret = tegra_xusb_runtime_resume(&pdev->dev); >> else >> ret = pm_runtime_get_sync(&pdev->dev); >> >> That way we can keep the regulator and clock stuff in the handler. I >> will update this series. > > Is there any good reason why we don't depend on PM for 32-bit as well? Not that I am aware of. > I'm not aware of any differences in drivers that are 32-bit specific for > Tegra, and I'm not even sure the !PM case gets any testing at all. And > even if, do we really still want to support that? > > I don't see any advantage these days for having it disabled. It would be fine IMO. Cheers Jon -- nvpublic