lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54bd00b7-2835-a253-0399-370e8c8203b8@linux.intel.com>
Date:   Thu, 1 Mar 2018 16:18:09 +0200
From:   Mathias Nyman <mathias.nyman@...ux.intel.com>
To:     Jon Hunter <jonathanh@...dia.com>,
        Mathias Nyman <mathias.nyman@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Thierry Reding <thierry.reding@...il.com>
Cc:     linux-usb@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] usb: xhci: tegra: Add runtime PM support

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 <jonathanh@...dia.com>
> ---
>   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 <linux/phy/tegra/xusb.h>
>   #include <linux/platform_device.h>
>   #include <linux/pm.h>
> +#include <linux/pm_runtime.h>
>   #include <linux/regulator/consumer.h>
>   #include <linux/reset.h>
>   #include <linux/slab.h>
> @@ -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);

-Mathias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ