linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-samsung-soc@vger.kernel.org,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>, Kukjin Kim <kgene@kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH] phy: samsung: Use readl_poll_timeout function
Date: Sat, 4 Jul 2020 09:54:58 +0530	[thread overview]
Message-ID: <CANAwSgQrTobDjPF7AF96FNoiihBjhwf9CQMBgCKBVuqza4v3Bg@mail.gmail.com> (raw)
In-Reply-To: <20200703164349.GA2914@kozik-lap>

hi Krzysztof,

On Fri, 3 Jul 2020 at 22:13, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Fri, Jul 03, 2020 at 01:20:12PM +0000, Anand Moon wrote:
> > User readl_poll_timeout function instead of open
> > coded handling in crport_handshake function.
> >
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> >  drivers/phy/samsung/phy-exynos5-usbdrd.c | 37 +++++++++---------------
> >  1 file changed, 13 insertions(+), 24 deletions(-)
> >
> > diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
> > index e510732afb8b..83274c5e3820 100644
> > --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
> > +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
> > @@ -16,6 +16,7 @@
> >  #include <linux/of.h>
> >  #include <linux/of_address.h>
> >  #include <linux/of_device.h>
> > +#include <linux/iopoll.h>
> >  #include <linux/phy/phy.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/mutex.h>
> > @@ -556,40 +557,28 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
> >  static int crport_handshake(struct exynos5_usbdrd_phy *phy_drd,
> >                           u32 val, u32 cmd)
> >  {
> > -     u32 usec = 100;
> > +     u32 timeout_us = 1000, sleep_us = 10;
> >       unsigned int result;
>
> You silently (without mentioning in commit msg and explaining why)
> changed both the sleep time and total timeout.
>

Ok I will stick with the original default value.
  timeout_us = 100, sleep_us = 1;

> Nope, please explain why you chosen such values and change them in
> separate patch..

I choose these values following Alim Akhtar's UFS PHY patches.

>
> > +     int err;
> >
> >       writel(val | cmd, phy_drd->reg_phy + EXYNOS5_DRD_PHYREG0);
> >
> > -     do {
> > -             result = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYREG1);
> > -             if (result & PHYREG1_CR_ACK)
> > -                     break;
> > -
> > -             udelay(1);
> > -     } while (usec-- > 0);
> > -
> > -     if (!usec) {
> > -             dev_err(phy_drd->dev,
> > -                     "CRPORT handshake timeout1 (0x%08x)\n", val);
> > +     err = readl_poll_timeout(phy_drd->reg_phy + EXYNOS5_DRD_PHYREG1,
> > +                     result, (result & PHYREG1_CR_ACK), sleep_us, timeout_us);
> > +     if (err) {
> > +             dev_err(phy_drd->dev, "CRPORT handshake timeout1 (0x%08x)\n", val);
> >               return -ETIME;
> >       }
> >
> > -     usec = 100;
> > +     timeout_us = 1000;
> > +     sleep_us = 10;
>
> The same.
>
> Best regards,
> Krzysztof
>

Best regards,
-Anand

      reply	other threads:[~2020-07-04  4:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 13:20 [PATCH] phy: samsung: Use readl_poll_timeout function Anand Moon
2020-07-03 16:43 ` Krzysztof Kozlowski
2020-07-04  4:24   ` Anand Moon [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=CANAwSgQrTobDjPF7AF96FNoiihBjhwf9CQMBgCKBVuqza4v3Bg@mail.gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=kgene@kernel.org \
    --cc=kishon@ti.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --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).