linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
@ 2018-12-21 10:13 Marc Gonzalez
  2018-12-27  4:03 ` Bjorn Andersson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Marc Gonzalez @ 2018-12-21 10:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham, Andy Gross, David Brown, Yaniv Gardi
  Cc: Vivek Gautam, Matt Wagantall, Mitchel Humpherys, Will Deacon,
	Bjorn Andersson, Arnd Bergmann, MSM, Linux ARM, LKML

The private copy of readl_poll_timeout is no longer needed.
Use the implementation in iopoll.h instead.

Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
---
 drivers/phy/qualcomm/phy-qcom-ufs-i.h | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-i.h b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
index 681644e43248..f798fb64de94 100644
--- a/drivers/phy/qualcomm/phy-qcom-ufs-i.h
+++ b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
@@ -23,24 +23,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/delay.h>
-
-#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
-({ \
-	ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
-	might_sleep_if(timeout_us); \
-	for (;;) { \
-		(val) = readl(addr); \
-		if (cond) \
-			break; \
-		if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
-			(val) = readl(addr); \
-			break; \
-		} \
-		if (sleep_us) \
-			usleep_range(DIV_ROUND_UP(sleep_us, 4), sleep_us); \
-	} \
-	(cond) ? 0 : -ETIMEDOUT; \
-})
+#include <linux/iopoll.h>
 
 #define UFS_QCOM_PHY_CAL_ENTRY(reg, val)	\
 	{				\
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2018-12-21 10:13 [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro Marc Gonzalez
@ 2018-12-27  4:03 ` Bjorn Andersson
  2018-12-28 16:05 ` Andy Gross
  2019-01-02  6:53 ` Vivek Gautam
  2 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2018-12-27  4:03 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Kishon Vijay Abraham, Andy Gross, David Brown, Yaniv Gardi,
	Vivek Gautam, Matt Wagantall, Mitchel Humpherys, Will Deacon,
	Arnd Bergmann, MSM, Linux ARM, LKML

On Fri 21 Dec 02:13 PST 2018, Marc Gonzalez wrote:

> The private copy of readl_poll_timeout is no longer needed.
> Use the implementation in iopoll.h instead.
> 
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/phy/qualcomm/phy-qcom-ufs-i.h | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-i.h b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
> index 681644e43248..f798fb64de94 100644
> --- a/drivers/phy/qualcomm/phy-qcom-ufs-i.h
> +++ b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
> @@ -23,24 +23,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
>  #include <linux/delay.h>
> -
> -#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
> -({ \
> -	ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
> -	might_sleep_if(timeout_us); \
> -	for (;;) { \
> -		(val) = readl(addr); \
> -		if (cond) \
> -			break; \
> -		if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
> -			(val) = readl(addr); \
> -			break; \
> -		} \
> -		if (sleep_us) \
> -			usleep_range(DIV_ROUND_UP(sleep_us, 4), sleep_us); \
> -	} \
> -	(cond) ? 0 : -ETIMEDOUT; \
> -})
> +#include <linux/iopoll.h>
>  
>  #define UFS_QCOM_PHY_CAL_ENTRY(reg, val)	\
>  	{				\
> -- 
> 2.17.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2018-12-21 10:13 [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro Marc Gonzalez
  2018-12-27  4:03 ` Bjorn Andersson
@ 2018-12-28 16:05 ` Andy Gross
  2019-01-16  9:10   ` Marc Gonzalez
  2019-01-02  6:53 ` Vivek Gautam
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Gross @ 2018-12-28 16:05 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Kishon Vijay Abraham, David Brown, Yaniv Gardi, Vivek Gautam,
	Matt Wagantall, Mitchel Humpherys, Will Deacon, Bjorn Andersson,
	Arnd Bergmann, MSM, Linux ARM, LKML

On Fri, Dec 21, 2018 at 11:13:18AM +0100, Marc Gonzalez wrote:
> The private copy of readl_poll_timeout is no longer needed.
> Use the implementation in iopoll.h instead.
> 
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>

Reviewed-by: Andy Gross <andy.gross@linaro.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2018-12-21 10:13 [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro Marc Gonzalez
  2018-12-27  4:03 ` Bjorn Andersson
  2018-12-28 16:05 ` Andy Gross
@ 2019-01-02  6:53 ` Vivek Gautam
  2 siblings, 0 replies; 8+ messages in thread
From: Vivek Gautam @ 2019-01-02  6:53 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Kishon Vijay Abraham, Andy Gross, David Brown, Yaniv Gardi,
	Matt Wagantall, Mitchel Humpherys, Will Deacon, Bjorn Andersson,
	Arnd Bergmann, MSM, Linux ARM, LKML

On Fri, Dec 21, 2018 at 9:43 PM Marc Gonzalez <marc.w.gonzalez@free.fr> wrote:
>
> The private copy of readl_poll_timeout is no longer needed.
> Use the implementation in iopoll.h instead.
>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> ---
>  drivers/phy/qualcomm/phy-qcom-ufs-i.h | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-i.h b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
> index 681644e43248..f798fb64de94 100644
> --- a/drivers/phy/qualcomm/phy-qcom-ufs-i.h
> +++ b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
> @@ -23,24 +23,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
>  #include <linux/delay.h>
> -
> -#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
> -({ \
> -       ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
> -       might_sleep_if(timeout_us); \
> -       for (;;) { \
> -               (val) = readl(addr); \
> -               if (cond) \
> -                       break; \
> -               if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
> -                       (val) = readl(addr); \
> -                       break; \
> -               } \
> -               if (sleep_us) \
> -                       usleep_range(DIV_ROUND_UP(sleep_us, 4), sleep_us); \
> -       } \
> -       (cond) ? 0 : -ETIMEDOUT; \
> -})
> +#include <linux/iopoll.h>
>
>  #define UFS_QCOM_PHY_CAL_ENTRY(reg, val)       \
>         {                               \
> --
> 2.17.1

Thanks for the patch. LGTM.
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>

Best regards
Vivek

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2018-12-28 16:05 ` Andy Gross
@ 2019-01-16  9:10   ` Marc Gonzalez
  2019-01-16  9:24     ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Gonzalez @ 2019-01-16  9:10 UTC (permalink / raw)
  To: Andy Gross, Kishon Vijay Abraham
  Cc: David Brown, Yaniv Gardi, Vivek Gautam, Matt Wagantall,
	Mitchel Humpherys, Will Deacon, Bjorn Andersson, Arnd Bergmann,
	MSM, Linux ARM, LKML

On 28/12/2018 17:05, Andy Gross wrote:

> On Fri, Dec 21, 2018 at 11:13:18AM +0100, Marc Gonzalez wrote:
>
>> The private copy of readl_poll_timeout is no longer needed.
>> Use the implementation in iopoll.h instead.
>>
>> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> 
> Reviewed-by: Andy Gross <andy.gross@linaro.org>

Would this patch go through your tree or Kishon's tree?

Regards.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2019-01-16  9:10   ` Marc Gonzalez
@ 2019-01-16  9:24     ` Kishon Vijay Abraham I
  2019-01-16 10:30       ` Marc Gonzalez
  0 siblings, 1 reply; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2019-01-16  9:24 UTC (permalink / raw)
  To: Marc Gonzalez, Andy Gross
  Cc: David Brown, Yaniv Gardi, Vivek Gautam, Matt Wagantall,
	Mitchel Humpherys, Will Deacon, Bjorn Andersson, Arnd Bergmann,
	MSM, Linux ARM, LKML

Hi,

On 16/01/19 2:40 PM, Marc Gonzalez wrote:
> On 28/12/2018 17:05, Andy Gross wrote:
> 
>> On Fri, Dec 21, 2018 at 11:13:18AM +0100, Marc Gonzalez wrote:
>>
>>> The private copy of readl_poll_timeout is no longer needed.
>>> Use the implementation in iopoll.h instead.
>>>
>>> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
>>
>> Reviewed-by: Andy Gross <andy.gross@linaro.org>
> 
> Would this patch go through your tree or Kishon's tree?

I've merged this in phy -next.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2019-01-16  9:24     ` Kishon Vijay Abraham I
@ 2019-01-16 10:30       ` Marc Gonzalez
  2019-01-16 11:50         ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Gonzalez @ 2019-01-16 10:30 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Andy Gross, David Brown, Yaniv Gardi, Vivek Gautam,
	Matt Wagantall, Mitchel Humpherys, Will Deacon, Bjorn Andersson,
	Arnd Bergmann, MSM, Linux ARM, LKML

On 16/01/2019 10:24, Kishon Vijay Abraham I wrote:

> On 16/01/19 2:40 PM, Marc Gonzalez wrote:
>
>> Would this patch go through your tree or Kishon's tree?
> 
> I've merged this in phy -next.

Thanks Kishon.

Do you mean here?

https://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git/log/?h=next

Regards.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
  2019-01-16 10:30       ` Marc Gonzalez
@ 2019-01-16 11:50         ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 8+ messages in thread
From: Kishon Vijay Abraham I @ 2019-01-16 11:50 UTC (permalink / raw)
  To: Marc Gonzalez
  Cc: Andy Gross, David Brown, Yaniv Gardi, Vivek Gautam,
	Matt Wagantall, Mitchel Humpherys, Will Deacon, Bjorn Andersson,
	Arnd Bergmann, MSM, Linux ARM, LKML

Hi,

On 16/01/19 4:00 PM, Marc Gonzalez wrote:
> On 16/01/2019 10:24, Kishon Vijay Abraham I wrote:
> 
>> On 16/01/19 2:40 PM, Marc Gonzalez wrote:
>>
>>> Would this patch go through your tree or Kishon's tree?
>>
>> I've merged this in phy -next.
> 
> Thanks Kishon.
> 
> Do you mean here?
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git/log/?h=next

yes.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-16 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 10:13 [PATCH v1] phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro Marc Gonzalez
2018-12-27  4:03 ` Bjorn Andersson
2018-12-28 16:05 ` Andy Gross
2019-01-16  9:10   ` Marc Gonzalez
2019-01-16  9:24     ` Kishon Vijay Abraham I
2019-01-16 10:30       ` Marc Gonzalez
2019-01-16 11:50         ` Kishon Vijay Abraham I
2019-01-02  6:53 ` Vivek Gautam

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).