From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [PATCH 1/8] clk: add helper function clk_is_match()
Date: Thu, 26 Feb 2015 09:02:56 +0000 [thread overview]
Message-ID: <20150226090256.GQ30445@trinity.fluff.org> (raw)
In-Reply-To: <20150225172757.421.43718@quantum>
On Wed, Feb 25, 2015 at 09:27:57AM -0800, Mike Turquette wrote:
> Quoting Shawn Guo (2015-02-25 06:53:31)
> > 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.
> >
> > A number of client drivers detecting if two struct clk pointers point to
> > the same one hardware clock by comparing the pointers are broken now.
> > As a stop-gap solution, this patch adds a helper function clk_is_match()
> > to test if two struct clk pointers point to the same hardware clock, so
> > that these client drivers can use to fix the regression.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>
> Hi Shawn,
>
> Thanks for the patch. I wrote a similar one last night but did not
> finish fixing up the drivers (and thus did not post it). I prefer my
> implementation below, and I'm happy to merge your driver fixes with it.
>
> Regards,
> Mike
>
>
>
> From: Michael Turquette <mturquette@linaro.org>
> Date: Wed, 25 Feb 2015 09:11:01 -0800
> Subject: [PATCH] clk: introduce clk_is_match
>
> Some drivers compare struct clk pointers as a means of knowing
> if the two pointers reference the same clock hardware. This behavior is
> dubious (drivers must not dereference struct clk), but did not cause any
> regressions until the per-user struct clk patch was merged. Now the test
> for matching clk's will always fail with per-user struct clk's.
>
> clk_is_match is introduced to fix the regression and prevent drivers
> from comparing the pointers manually.
small observaton, clk_is_same() is linguistically nicer.
--
Ben Dooks, ben at fluff.org, http://www.fluff.org/ben/
Large Hadron Colada: A large Pina Colada that makes the universe disappear.
next prev parent reply other threads:[~2015-02-26 9:02 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-25 14:53 [PATCH 0/8] Fix struct clk pointer comparing Shawn Guo
2015-02-25 14:53 ` [PATCH 1/8] clk: add helper function clk_is_match() Shawn Guo
2015-02-25 17:27 ` Mike Turquette
2015-02-26 0:37 ` Shawn Guo
2015-02-26 9:02 ` Ben Dooks [this message]
2015-02-26 9:56 ` [alsa-devel] " Philipp Zabel
2015-02-26 11:25 ` Ben Dooks
2015-02-26 11:59 ` Ricard Wanderlof
2015-03-04 8:55 ` Geert Uytterhoeven
2015-03-04 9:51 ` Russell King - ARM Linux
2015-03-08 21:05 ` [PATCH] clk: provide clk_is_match() dummy for non-common clk Arnd Bergmann
2015-03-10 21:42 ` Geert Uytterhoeven
2015-03-11 7:09 ` Uwe Kleine-König
2015-03-11 10:22 ` Russell King - ARM Linux
2015-03-11 11:17 ` Uwe Kleine-König
2015-03-11 12:29 ` Russell King - ARM Linux
2015-03-12 0:35 ` Stephen Boyd
2015-02-25 14:53 ` [PATCH 2/8] ARM: imx: fix struct clk pointer comparing Shawn Guo
2015-02-25 14:53 ` [PATCH 3/8] drm: armada: " Shawn Guo
2015-02-25 14:53 ` [PATCH 4/8] pwm: atmel-hlcdc: " Shawn Guo
2015-02-26 9:22 ` Nicolas Ferre
2015-02-26 9:31 ` Boris Brezillon
2015-03-11 10:54 ` Thierry Reding
2015-02-25 14:53 ` [PATCH 5/8] serial: samsung: " Shawn Guo
2015-02-25 14:53 ` [PATCH 6/8] ASoC: fsl_esai: " Shawn Guo
2015-02-26 2:36 ` Mark Brown
2015-02-25 14:53 ` [PATCH 7/8] ASoC: fsl_spdif: " Shawn Guo
2015-02-25 21:04 ` Stephen Boyd
2015-02-26 1:17 ` Shawn Guo
2015-02-26 2:12 ` Mark Brown
2015-02-26 2:20 ` Shawn Guo
2015-02-26 2:29 ` Mark Brown
2015-02-26 2:36 ` Mark Brown
2015-02-25 14:53 ` [PATCH 8/8] ASoC: kirkwood: " Shawn Guo
2015-02-26 2:12 ` Mark Brown
2015-02-26 2:36 ` Mark Brown
2015-02-25 15:03 ` [PATCH 0/8] Fix " Russell King - ARM Linux
2015-02-25 17:55 ` Mike Turquette
2015-02-25 20:42 ` Stephen Boyd
2015-02-26 1:21 ` Shawn Guo
2015-02-26 1:24 ` Mike Turquette
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=20150226090256.GQ30445@trinity.fluff.org \
--to=ben-linux@fluff.org \
--cc=linux-arm-kernel@lists.infradead.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).