public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Wan Mohamad,
	Wan Ahmad Zainie"  <wan.ahmad.zainie.wan.mohamad@intel.com>
Cc: "kishon@ti.com" <kishon@ti.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"mgross@linux.intel.com" <mgross@linux.intel.com>,
	"Raja Subramanian,
	Lakshmi Bai"  <lakshmi.bai.raja.subramanian@intel.com>
Subject: Re: [PATCH v2 2/2] phy: intel: Add Keem Bay USB PHY support
Date: Wed, 11 Nov 2020 11:49:33 +0200	[thread overview]
Message-ID: <20201111094933.GG4077@smile.fi.intel.com> (raw)
In-Reply-To: <DM6PR11MB3721899F79D7A75BBEE85C5FDDE80@DM6PR11MB3721.namprd11.prod.outlook.com>

On Wed, Nov 11, 2020 at 09:28:34AM +0000, Wan Mohamad, Wan Ahmad Zainie wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Monday, November 9, 2020 7:41 PM
> > To: Wan Mohamad, Wan Ahmad Zainie
> > On Mon, Nov 09, 2020 at 11:16:54AM +0800, Wan Ahmad Zainie wrote:

...

> > > +	usleep_range(30, 50);
> > 
> > Why 30-50?
> 
> I take this value from boot firmware.
> There is a delay of 30us after clearing IDDQ_enable bit.
> I believe the purpose is to ensure all analog blocks are powered up.

Then put it into comment.

...

> > > +	usleep_range(20, 50);
> > 
> > Why these numbers?
> 
> In Keem Bay data book, under USB initialization section,
> there is step that there must be a minimum 20us wait
> after clock enable, before bringing PHYs out of reset.
> 
> 50 is the value that I picked randomly. Is usleep_range(20, 20)
> Better?

No, the better as I told you already few times is to comment "why?" these
numbers. Above can be like:
"According to datasheet this step requires 20us wait..."

...

> > > +	usleep_range(2, 10);
> > 
> > Ditto.
> 
> Under the same section above, there is a step for 2us wait.
> I believe it is for register write to go through.

Ditto.

> > 
> > ...
> > 
> > > +	usleep_range(20, 50);
> > 
> > Ditto.
> 
> Under the same section above, there is a step to wait 20us
> after setting SRAM load bit, before release the controller
> reset.
> 
> I will add comment for those 4 delay above.

Yes, please.

...

> Before I proceed with v3, I would like to know if I should
> use udelay(), instead of usleep_range()?
> I refer to https://www.kernel.org/doc/Documentation/timers/timers-howto.txt.

You should know your code better than me. That howto is clear about when of
which API calls can be used.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2020-11-11  9:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  3:16 [PATCH v2 0/2] phy: intel: Add Keem Bay USB PHY support Wan Ahmad Zainie
2020-11-09  3:16 ` [PATCH v2 1/2] dt-bindings: phy: Add Intel Keem Bay USB PHY bindings Wan Ahmad Zainie
2020-11-09  3:16 ` [PATCH v2 2/2] phy: intel: Add Keem Bay USB PHY support Wan Ahmad Zainie
2020-11-09 11:41   ` Andy Shevchenko
2020-11-11  9:28     ` Wan Mohamad, Wan Ahmad Zainie
2020-11-11  9:49       ` Andy Shevchenko [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=20201111094933.GG4077@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=lakshmi.bai.raja.subramanian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=wan.ahmad.zainie.wan.mohamad@intel.com \
    /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