dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing
@ 2022-11-07 14:00 Cc Carnaghi
  0 siblings, 0 replies; 6+ messages in thread
From: Cc Carnaghi @ 2022-11-07 14:00 UTC (permalink / raw)
  To: dri-devel

[-- Attachment #1: Type: text/plain, Size: 3 bytes --]

Mr

[-- Attachment #2: Type: text/html, Size: 25 bytes --]

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

* Re: [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing
@ 2022-11-07  9:01 Cc Carnaghi
  0 siblings, 0 replies; 6+ messages in thread
From: Cc Carnaghi @ 2022-11-07  9:01 UTC (permalink / raw)
  To: dri-devel

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Type: text/html, Size: 23 bytes --]

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

* Re: [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing
  2015-02-25 14:53 ` [PATCH 4/8] pwm: atmel-hlcdc: fix " Shawn Guo
  2015-02-26  9:22   ` Nicolas Ferre
@ 2015-03-11 10:54   ` Thierry Reding
  1 sibling, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2015-03-11 10:54 UTC (permalink / raw)
  To: Shawn Guo
  Cc: linux-pwm, alsa-devel, Russell King, linux-serial,
	Greg Kroah-Hartman, Stephen Boyd, dri-devel, Mark Brown, kernel,
	Mike Turquette, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1268 bytes --]

On Wed, Feb 25, 2015 at 10:53:34PM +0800, Shawn Guo wrote:
> Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk
> instances"), clk API users can no longer check if two struct clk
> pointers are pointing to the same hardware clock, i.e. struct clk_hw, by
> simply comparing two pointers.  That's because with the per-user clk
> change, a brand new struct clk is created whenever clients try to look
> up the clock by calling clk_get() or sister functions like clk_get_sys()
> and of_clk_get().  This changes the original behavior where the struct
> clk is only created for once when clock driver registers the clock to
> CCF in the first place.  The net change here is before commit
> 035a61c314eb the struct clk pointer is unique for given hardware
> clock, while after the commit the pointers returned by clk lookup calls
> become different for the same hardware clock.
> 
> That said, the struct clk pointer comparing in the code doesn't work any
> more.  Call helper function clk_is_match() instead to fix the problem.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Thierry Reding <thierry.reding@gmail.com>

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing
  2015-02-26  9:22   ` Nicolas Ferre
@ 2015-02-26  9:31     ` Boris Brezillon
  0 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2015-02-26  9:31 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Shawn Guo, Mike Turquette, linux-pwm, alsa-devel, Russell King,
	linux-serial, Greg Kroah-Hartman, Mark Brown, Stephen Boyd,
	dri-devel, Thierry Reding, kernel, linux-arm-kernel

Nicolas, Shawn,

On Thu, 26 Feb 2015 10:22:50 +0100
Nicolas Ferre <nicolas.ferre@atmel.com> wrote:

> Le 25/02/2015 15:53, Shawn Guo a écrit :
> > Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk
> > instances"), clk API users can no longer check if two struct clk
> > pointers are pointing to the same hardware clock, i.e. struct clk_hw, by
> > simply comparing two pointers.  That's because with the per-user clk
> > change, a brand new struct clk is created whenever clients try to look
> > up the clock by calling clk_get() or sister functions like clk_get_sys()
> > and of_clk_get().  This changes the original behavior where the struct
> > clk is only created for once when clock driver registers the clock to
> > CCF in the first place.  The net change here is before commit
> > 035a61c314eb the struct clk pointer is unique for given hardware
> > clock, while after the commit the pointers returned by clk lookup calls
> > become different for the same hardware clock.
> > 
> > That said, the struct clk pointer comparing in the code doesn't work any
> > more.  Call helper function clk_is_match() instead to fix the problem.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> 
> I agree with the fix whichever name is chosen for the function in an
> future version of this series. So you can add my:
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> Maybe Boris can double check...

Looks good to me.
Thanks for fixing that.

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> 
> > ---
> >  drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
> > index 522f7075bb1a..36475949b829 100644
> > --- a/drivers/pwm/pwm-atmel-hlcdc.c
> > +++ b/drivers/pwm/pwm-atmel-hlcdc.c
> > @@ -97,7 +97,7 @@ static int atmel_hlcdc_pwm_config(struct pwm_chip *c,
> >  
> >  	pwmcfg = ATMEL_HLCDC_PWMPS(pres);
> >  
> > -	if (new_clk != chip->cur_clk) {
> > +	if (!clk_is_match(new_clk, chip->cur_clk)) {
> >  		u32 gencfg = 0;
> >  		int ret;
> >  
> > 
> 
> 



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* Re: [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing
  2015-02-25 14:53 ` [PATCH 4/8] pwm: atmel-hlcdc: fix " Shawn Guo
@ 2015-02-26  9:22   ` Nicolas Ferre
  2015-02-26  9:31     ` Boris Brezillon
  2015-03-11 10:54   ` Thierry Reding
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Ferre @ 2015-02-26  9:22 UTC (permalink / raw)
  To: Shawn Guo, Mike Turquette, Boris BREZILLON
  Cc: linux-pwm, alsa-devel, Russell King, linux-serial,
	Greg Kroah-Hartman, Mark Brown, Stephen Boyd, dri-devel,
	Thierry Reding, kernel, linux-arm-kernel

Le 25/02/2015 15:53, Shawn Guo a écrit :
> Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk
> instances"), clk API users can no longer check if two struct clk
> pointers are pointing to the same hardware clock, i.e. struct clk_hw, by
> simply comparing two pointers.  That's because with the per-user clk
> change, a brand new struct clk is created whenever clients try to look
> up the clock by calling clk_get() or sister functions like clk_get_sys()
> and of_clk_get().  This changes the original behavior where the struct
> clk is only created for once when clock driver registers the clock to
> CCF in the first place.  The net change here is before commit
> 035a61c314eb the struct clk pointer is unique for given hardware
> clock, while after the commit the pointers returned by clk lookup calls
> become different for the same hardware clock.
> 
> That said, the struct clk pointer comparing in the code doesn't work any
> more.  Call helper function clk_is_match() instead to fix the problem.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

I agree with the fix whichever name is chosen for the function in an
future version of this series. So you can add my:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Maybe Boris can double check...

> ---
>  drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
> index 522f7075bb1a..36475949b829 100644
> --- a/drivers/pwm/pwm-atmel-hlcdc.c
> +++ b/drivers/pwm/pwm-atmel-hlcdc.c
> @@ -97,7 +97,7 @@ static int atmel_hlcdc_pwm_config(struct pwm_chip *c,
>  
>  	pwmcfg = ATMEL_HLCDC_PWMPS(pres);
>  
> -	if (new_clk != chip->cur_clk) {
> +	if (!clk_is_match(new_clk, chip->cur_clk)) {
>  		u32 gencfg = 0;
>  		int ret;
>  
> 


-- 
Nicolas Ferre

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

* [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing
  2015-02-25 14:53 [PATCH 0/8] Fix " Shawn Guo
@ 2015-02-25 14:53 ` Shawn Guo
  2015-02-26  9:22   ` Nicolas Ferre
  2015-03-11 10:54   ` Thierry Reding
  0 siblings, 2 replies; 6+ messages in thread
From: Shawn Guo @ 2015-02-25 14:53 UTC (permalink / raw)
  To: Mike Turquette
  Cc: linux-arm-kernel, kernel, Russell King, Stephen Boyd,
	Thierry Reding, Greg Kroah-Hartman, Mark Brown, linux-pwm,
	alsa-devel, dri-devel, linux-serial, Shawn Guo

Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk
instances"), clk API users can no longer check if two struct clk
pointers are pointing to the same hardware clock, i.e. struct clk_hw, by
simply comparing two pointers.  That's because with the per-user clk
change, a brand new struct clk is created whenever clients try to look
up the clock by calling clk_get() or sister functions like clk_get_sys()
and of_clk_get().  This changes the original behavior where the struct
clk is only created for once when clock driver registers the clock to
CCF in the first place.  The net change here is before commit
035a61c314eb the struct clk pointer is unique for given hardware
clock, while after the commit the pointers returned by clk lookup calls
become different for the same hardware clock.

That said, the struct clk pointer comparing in the code doesn't work any
more.  Call helper function clk_is_match() instead to fix the problem.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c
index 522f7075bb1a..36475949b829 100644
--- a/drivers/pwm/pwm-atmel-hlcdc.c
+++ b/drivers/pwm/pwm-atmel-hlcdc.c
@@ -97,7 +97,7 @@ static int atmel_hlcdc_pwm_config(struct pwm_chip *c,
 
 	pwmcfg = ATMEL_HLCDC_PWMPS(pres);
 
-	if (new_clk != chip->cur_clk) {
+	if (!clk_is_match(new_clk, chip->cur_clk)) {
 		u32 gencfg = 0;
 		int ret;
 
-- 
1.9.1


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

end of thread, other threads:[~2022-11-08  0:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 14:00 [PATCH 4/8] pwm: atmel-hlcdc: fix struct clk pointer comparing Cc Carnaghi
  -- strict thread matches above, loose matches on Subject: below --
2022-11-07  9:01 Cc Carnaghi
2015-02-25 14:53 [PATCH 0/8] Fix " Shawn Guo
2015-02-25 14:53 ` [PATCH 4/8] pwm: atmel-hlcdc: fix " Shawn Guo
2015-02-26  9:22   ` Nicolas Ferre
2015-02-26  9:31     ` Boris Brezillon
2015-03-11 10:54   ` Thierry Reding

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