devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo@linaro.org>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Sriharsha Allenki <sallenki@codeaurora.org>,
	Anu Ramanathan <anur@codeaurora.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] phy: qualcomm: Add Synopsys High-Speed USB PHY driver
Date: Mon, 26 Nov 2018 10:30:23 +0800	[thread overview]
Message-ID: <20181126023021.GC20417@dragon> (raw)
In-Reply-To: <52433bdc-bc05-2ca0-0822-c9fb702b3231@ti.com>

On Fri, Nov 23, 2018 at 03:25:33PM +0530, Kishon Vijay Abraham I wrote:
> > +static int qcom_snps_hsphy_por_reset(struct hsphy_priv *priv)
> > +{
> > +	int ret;
> > +
> > +	ret = reset_control_assert(priv->por_reset);
> > +	if (ret)
> > +		return ret;
> > +
> > +	/*
> > +	 * The Femto PHY is POR reset in the following scenarios.
> > +	 *
> > +	 * 1. After overriding the parameter registers.
> > +	 * 2. Low power mode exit from PHY retention.
> > +	 *
> > +	 * Ensure that SIDDQ is cleared before bringing the PHY
> > +	 * out of reset.
> > +	 */
> > +	qcom_snps_hsphy_exit_retention(priv);
> > +
> > +	/*
> > +	 * As per databook, 10 usec delay is required between
> > +	 * PHY POR assert and de-assert.
> > +	 */
> > +	usleep_range(10, 20);
> > +	ret = reset_control_deassert(priv->por_reset);
> > +	if (ret)
> > +		return ret;
> > +
> > +	/*
> > +	 * As per databook, it takes 75 usec for PHY to stabilize
> > +	 * after the reset.
> > +	 */
> > +	usleep_range(80, 100);
> > +
> > +	/* Ensure that RESET operation is completed. */
> > +	mb();
> 
> How will you ensure the reset operation is complete with a memory barrier? mb
> usage here looks incorrect to me.

I agree with you, Kishon.  I think memory barrier only ensures the
register write happens rather than that RESET operation completes.
Since the IO accessors already handle memory barrier, I will just drop
the mb() from here and function qcom_snps_hsphy_init_sequence() as well.

@Sriharsha, let us know if you have a story or reason for these memory
barriers.

Shawn

      reply	other threads:[~2018-11-26  2:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 11:08 [PATCH v4 0/2] Add Synopsys High-Speed USB PHY driver for Qualcomm SoCs Shawn Guo
2018-11-19 11:08 ` [PATCH v4 1/2] dt-bindings: phy: Add Qualcomm Synopsys High-Speed USB PHY binding Shawn Guo
2018-11-26 14:46   ` Rob Herring
2018-11-19 11:08 ` [PATCH v4 2/2] phy: qualcomm: Add Synopsys High-Speed USB PHY driver Shawn Guo
2018-11-23  9:55   ` Kishon Vijay Abraham I
2018-11-26  2:30     ` Shawn Guo [this message]

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=20181126023021.GC20417@dragon \
    --to=shawn.guo@linaro.org \
    --cc=anur@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sallenki@codeaurora.org \
    --cc=vkoul@kernel.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;
as well as URLs for NNTP newsgroup(s).