Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Wesley Cheng <wcheng@codeaurora.org>
Cc: agross@kernel.org, bjorn.andersson@linaro.org, kishon@ti.com,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: qcom-snps: Add runtime suspend and resume handlers
Date: Mon, 27 Apr 2020 22:29:19 +0530	[thread overview]
Message-ID: <20200427165919.GR56386@vkoul-mobl.Dlink> (raw)
In-Reply-To: <1587662818-4461-1-git-send-email-wcheng@codeaurora.org>

On 23-04-20, 10:26, Wesley Cheng wrote:

> +static int qcom_snps_hsphy_suspend(struct qcom_snps_hsphy *hsphy)
> +{
> +	if (hsphy->suspended)
> +		return 0;
> +
> +	dev_dbg(&hsphy->phy->dev, "Suspend QCOM SNPS PHY, mode = %d \n", hsphy->mode);
> +
> +	if (hsphy->mode == PHY_MODE_USB_HOST) {
> +		/* Enable auto-resume to meet remote wakeup timing */
> +		qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_CTRL2,
> +										USB2_AUTO_RESUME, USB2_AUTO_RESUME);
> +		usleep_range(500, 1000);
> +		qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_CTRL2,
> +										0, USB2_AUTO_RESUME);

Kernel has a coding guideline where we try to "stick" to 80 char limit
and is sometimes okay like debug logs. Above is not okay. Please fix it
and run ./scripts/checkpatch.pl --strict on your patch and fix all
errors. Warning and checks at your discretion using common sense. When
in doubt do ask :)

> +	}
> +
> +	clk_disable_unprepare(hsphy->cfg_ahb_clk);
> +	hsphy->suspended = true;

why do you need to track this?

> +
> +	return 0;
> +}
> +
> +static int qcom_snps_hsphy_resume(struct qcom_snps_hsphy *hsphy)
> +{
> +	int ret = 0;

superfluous init..

>  static int qcom_snps_hsphy_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> @@ -251,6 +333,14 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> +	pm_runtime_set_active(dev);
> +	pm_runtime_enable(dev);

would it not make sense to enable this after pjy in initialized?

-- 
~Vinod

  reply	other threads:[~2020-04-27 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 17:26 [PATCH] phy: qcom-snps: Add runtime suspend and resume handlers Wesley Cheng
2020-04-27 16:59 ` Vinod Koul [this message]
2020-04-27 20:31   ` Wesley Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200427165919.GR56386@vkoul-mobl.Dlink \
    --to=vkoul@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wcheng@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox