Re: [PATCH v7 0/3] clk: clkdev add managed lookup registrations

2019-02-01 Thread Matti Vaittinen
On Thu, Jan 31, 2019 at 11:38:37AM -0800, Stephen Boyd wrote: > Quoting Russell King - ARM Linux admin (2019-01-31 07:21:47) > > On Thu, Jan 31, 2019 at 03:24:52PM +0200, Matti Vaittinen wrote: > > > Hello All, > > > > > > On Fri, Dec 07, 2018 at 01:

Re: [PATCH v7 0/3] clk: clkdev add managed lookup registrations

2019-01-31 Thread Matti Vaittinen
Hello All, On Fri, Dec 07, 2018 at 01:09:00PM +0200, Matti Vaittinen wrote: > Series adds managed clkdev lookup interfaces and cleans few drivers > > Few clk drivers appear to be leaking clkdev lookup registrations at > driver remove. The patch series adds devm versions of lookup >

[PATCH v7 2/3] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-12-07 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_hw_provider. Signed-off-by: Matti Vaittinen Reviewed-by: Krzysztof

[PATCH v7 3/3] clk: clk-st: avoid clkdev lookup leak at remove

2018-12-07 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index 3a0996f2d556..25d4b97aff9b

[PATCH v7 0/3] clk: clkdev add managed lookup registrations

2018-12-07 Thread Matti Vaittinen
k as this device can never be removed - Fix indentiation for clk-max77686 - Rest of the patches are unchanged. Changelog v2 Issue spotted by 0-Day test suite - Add a stub function 'devm_of_clk_add_parent_hw_provider' for no OF config. - patches 2-8 are unchanged. This patch series is bas

[PATCH v7 1/3] clkdev: add managed clkdev lookup registration

2018-12-07 Thread Matti Vaittinen
Clkdev registration lacks of managed registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 1

Re: [PATCH v6 03/10] clk: of-provider: look at parent if registered device has no provider info

2018-12-05 Thread Matti Vaittinen
On Wed, Dec 05, 2018 at 08:20:58PM +0200, Matti Vaittinen wrote: > On Wed, Dec 05, 2018 at 09:19:33AM -0800, Stephen Boyd wrote: > > Quoting Matti Vaittinen (2018-12-04 23:00:46) > > > But that won't solve the issue if we don't do "dirty hacks" in driver. &g

Re: [PATCH v6 10/10] clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock

2018-12-05 Thread Matti Vaittinen
Thanks again Stephen. On Wed, Dec 05, 2018 at 09:28:21AM -0800, Stephen Boyd wrote: > Quoting Matti Vaittinen (2018-12-04 03:39:38) > > diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c > > new file mode 100644 > > index ..d486859526ed > &

Re: [PATCH v6 03/10] clk: of-provider: look at parent if registered device has no provider info

2018-12-05 Thread Matti Vaittinen
On Wed, Dec 05, 2018 at 09:19:33AM -0800, Stephen Boyd wrote: > Quoting Matti Vaittinen (2018-12-04 23:00:46) > > But that won't solve the issue if we don't do "dirty hacks" in driver. > > The devm interface still only gets the device-pointer, not the DT node

Re: [PATCH v6 03/10] clk: of-provider: look at parent if registered device has no provider info

2018-12-04 Thread Matti Vaittinen
counting. Hence I think we should keep the of_node NULL for sub-device if the sub-device does not have own node inside the main devie node. And I think Rob was not a fan of having own nodes for sub-devices inside the MFD node (AFAIR my first driver draft for this device had it but Rob and you thought

Re: [PATCH v6 00/10] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-12-04 Thread Matti Vaittinen
On Tue, Dec 04, 2018 at 01:31:43PM +0200, Matti Vaittinen wrote: > Series add bd71837/bd71837 PMIC clock support + managed interfaces > Changed drivers are: > clk-max77686, clk-st, clk-hi655x, rk808, clk-twl6040 > and apcs-msm8916. New driver is clk-bd718x7 > > Changelog (f

[PATCH v6 10/10] clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock

2018-12-04 Thread Matti Vaittinen
ROHM bd71837 and bd71847 contain 32768Hz clock gate. Support the clock using generic clock framework. Note, only bd71837 is tested but bd71847 should be identical what comes to clk parts. Signed-off-by: Matti Vaittinen --- drivers/clk/Kconfig | 7 +++ drivers/clk/Makefile | 1

[PATCH v6 09/10] clk: apcs-msm8916: simplify probe cleanup by using devm

2018-12-04 Thread Matti Vaittinen
use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..caa9b0d53d68 100644

[PATCH v6 08/10] clk: clk-twl6040: Free of_provider at remove

2018-12-04 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen Acked-by: Peter Ujfalusi --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index

[PATCH v6 07/10] clk: rk808: use managed version of of_provider registration

2018-12-04 Thread Matti Vaittinen
Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b

[PATCH v6 05/10] clk: clk-st: avoid clkdev lookup leak at remove

2018-12-04 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index 3a0996f2d556..25d4b97aff9b

[PATCH v6 06/10] clk: clk-hi655x: Free of_provider at remove

2018-12-04 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..a0de3315df2e

[PATCH v6 04/10] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-12-04 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_hw_provider. Signed-off-by: Matti Vaittinen Reviewed-by: Krzysztof

[PATCH v6 03/10] clk: of-provider: look at parent if registered device has no provider info

2018-12-04 Thread Matti Vaittinen
e if given device has no own node or if the node does not contain the #clock-cells property. In such case use the parent node if it contains the #clock-cells. Signed-off-by: Matti Vaittinen --- drivers/clk/clk.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) di

[PATCH v6 02/10] clk: Add kerneldoc to managed of-provider interfaces

2018-12-04 Thread Matti Vaittinen
Document the devm_of_clk_del_provider and the devm_of_clk_add_hw_provider functions. Signed-off-by: Matti Vaittinen --- drivers/clk/clk.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index af011974d4ec..78c90913f987 100644 --- a

[PATCH v6 01/10] clkdev: add managed clkdev lookup registration

2018-12-04 Thread Matti Vaittinen
Clkdev registration lacks of managed registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 1

[PATCH v6 00/10] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-12-04 Thread Matti Vaittinen
nchanged. Changelog (for this series) v2 Issue spotted by 0-Day test suite - Add a stub function 'devm_of_clk_add_parent_hw_provider' for no OF config. - patches 2-8 are unchanged. This patch series is based on clk-next --- Matti Vaittinen (10): clkdev: add managed clkdev lookup r

Re: [PATCH v5 1/9] clkdev: add managed clkdev lookup registration

2018-12-04 Thread Matti Vaittinen
eally don't see right away why the dr->data would be NULL. So I'll remove the check. Br, Matti Vaittinen > > -- > RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up &g

Re: [PATCH v4 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-12-03 Thread Matti Vaittinen
Hello Again Stephen, I did already send v5 prior to your reply but I will create v6 today based on this discussion. On Mon, Dec 03, 2018 at 03:35:10PM -0800, Stephen Boyd wrote: > Quoting Matti Vaittinen (2018-11-30 02:50:22) > > Hello Stephen, > > > > Thanks a bunch fo

Re: [PATCH v5 0/9] clk: clkdev: managed clk lookup and provider registrations

2018-12-03 Thread Matti Vaittinen
t output. I may have accidentally included some old patch to maintainer query. > > -- > Lee Jones [李琼斯] > Linaro Services Technical Lead > Linaro.org │ Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog -- Matti Vaittinen ROHM Semiconductors ~~~ &quo

[PATCH v5 9/9] clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock

2018-12-03 Thread Matti Vaittinen
ROHM bd71837 and bd71847 contain 32768Hz clock gate. Support the clock using generic clock framework. Note, only bd71837 is tested but bd71847 should be identical what comes to clk parts. Signed-off-by: Matti Vaittinen --- drivers/clk/Kconfig | 7 +++ drivers/clk/Makefile | 1

[PATCH v5 8/9] clk: apcs-msm8916: simplify probe cleanup by using devm

2018-12-03 Thread Matti Vaittinen
use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..f4e0c136ab1a 100644

[PATCH v5 7/9] clk: clk-twl6040: Free of_provider at remove

2018-12-03 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen Acked-by: Peter Ujfalusi --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index

[PATCH v5 6/9] clk: rk808: use managed version of of_provider registration

2018-12-03 Thread Matti Vaittinen
Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b

[PATCH v5 5/9] clk: clk-hi655x: Free of_provider at remove

2018-12-03 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..394d0109104d

[PATCH v5 4/9] clk: clk-st: avoid clkdev lookup leak at remove

2018-12-03 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index 3a0996f2d556..25d4b97aff9b

[PATCH v5 3/9] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-12-03 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_parent_hw_provider. Signed-off-by: Matti Vaittinen Reviewed-by

[PATCH v5 1/9] clkdev: add managed clkdev lookup registration

2018-12-03 Thread Matti Vaittinen
Clkdev registration lacks of managed registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 1

[PATCH v5 2/9] clk: of_clk - add managed provider registrations

2018-12-03 Thread Matti Vaittinen
With MFD devices the clk properties may be contained in MFD (parent) DT node. Current devm_of_clk_add_hw_provider assumes the clk is bound to MFD subdevice not to MFD device (parent). Add devm_of_clk_add_hw_provider_parent to tackle this issue. Signed-off-by: Matti Vaittinen --- Documentation

[PATCH v5 0/9] clk: clkdev: managed clk lookup and provider registrations

2018-12-03 Thread Matti Vaittinen
'devm_of_clk_add_parent_hw_provider' for no OF config. - patches 2-8 are unchanged. This patch series is based on clk-next --- Matti Vaittinen (9): clkdev: add managed clkdev lookup registration clk: of_clk - add managed provider registrations clk: clk-max77686: Clean clkdev lookup le

Re: [PATCH v4 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-12-03 Thread Matti Vaittinen
Hello Stephen & All, I created v5 where I fixed obvious issues. I'll send it in few minutes. Please note following topics: On Fri, Nov 30, 2018 at 12:50:22PM +0200, Matti Vaittinen wrote: > > On Fri, Nov 30, 2018 at 12:54:10AM -0800, Stephen Boyd wrote: > > Quoting Matti

Re: [PATCH v4 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-11-30 Thread Matti Vaittinen
On Fri, Nov 30, 2018 at 11:06:53AM +, Russell King - ARM Linux wrote: > On Fri, Nov 30, 2018 at 12:50:22PM +0200, Matti Vaittinen wrote: > > Hello Stephen, > > > > Thanks a bunch for taking the time and reviewing this! > > > > On Fri, Nov 30, 2018 at 12:

Re: [PATCH v4 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-11-30 Thread Matti Vaittinen
Hello Stephen, Thanks a bunch for taking the time and reviewing this! On Fri, Nov 30, 2018 at 12:54:10AM -0800, Stephen Boyd wrote: > Quoting Matti Vaittinen (2018-11-13 03:55:58) > > With MFD devices the clk properties may be contained in MFD (parent) DT > >

[PATCH v4 8/8] clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock

2018-11-13 Thread Matti Vaittinen
ROHM bd71837 and bd71847 contain 32768Hz clock gate. Support the clock using generic clock framework. Signed-off-by: Matti Vaittinen --- drivers/clk/Kconfig | 7 +++ drivers/clk/Makefile | 1 + drivers/clk/clk-bd718x7.c | 131 ++ 3

[PATCH v4 7/8] clk: apcs-msm8916: simplify probe cleanup by using devm

2018-11-13 Thread Matti Vaittinen
use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..f4e0c136ab1a 100644

[PATCH v4 6/8] clk: clk-twl6040: Free of_provider at remove

2018-11-13 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen Acked-by: Peter Ujfalusi --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index

[PATCH v4 5/8] clk: rk808: use managed version of of_provider registration

2018-11-13 Thread Matti Vaittinen
Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b

[PATCH v4 4/8] clk: clk-hi655x: Free of_provider at remove

2018-11-13 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..394d0109104d

[PATCH v4 3/8] clk: clk-st: avoid clkdev lookup leak at remove

2018-11-13 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index 3a0996f2d556..25d4b97aff9b

[PATCH v4 2/8] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-11-13 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_parent_hw_provider. Signed-off-by: Matti Vaittinen Reviewed-by

[PATCH v4 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-11-13 Thread Matti Vaittinen
registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 3 + drivers/clk/clk.c | 28

[PATCH v4 0/8] clk: clkdev: managed clk lookup and provider registrations

2018-11-13 Thread Matti Vaittinen
spotted by 0-Day test suite - Add a stub function 'devm_of_clk_add_parent_hw_provider' for no OF config. - patches 2-8 are unchanged. This patch series is based on clk-next --- Matti Vaittinen (8): clk: clkdev/of_clk - add managed lookup and provider registrations clk: clk-max77

Re: [PATCH 2/2] clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock

2018-11-11 Thread Matti Vaittinen
Hello Stephen & All, On Mon, Sep 03, 2018 at 09:38:43AM +0300, Matti Vaittinen wrote: > > On Sat, Sep 01, 2018 at 12:13:26PM -0700, Stephen Boyd wrote: > > Quoting Matti Vaittinen (2018-08-31 03:21:23) > > > Hello All, > > > > > > Just wanted to

[PATCH v3 7/7] clk: apcs-msm8916: simplify probe cleanup by using devm

2018-11-02 Thread Matti Vaittinen
use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..f4e0c136ab1a 100644

[PATCH v3 6/7] clk: clk-twl6040: Free of_provider at remove

2018-11-02 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index 25dfe050ae9f

[PATCH v3 5/7] clk: rk808: use managed version of of_provider registration

2018-11-02 Thread Matti Vaittinen
Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b

[PATCH v3 4/7] clk: clk-hi655x: Free of_provider at remove

2018-11-02 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..394d0109104d

[PATCH v3 3/7] clk: clk-st: avoid clkdev lookup leak at remove

2018-11-02 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index fb62f3938008..32d8df9bd853

[PATCH v3 2/7] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-11-02 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_parent_hw_provider. Signed-off-by: Matti Vaittinen Reviewed-by

[PATCH v3 1/7] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-11-02 Thread Matti Vaittinen
registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 3 + drivers/clk/clk.c | 28

[PATCH v3 0/7] clk: clkdev: managed clk lookup and provider registrations

2018-11-02 Thread Matti Vaittinen
n clk-next --- Matti Vaittinen (7): clk: clkdev/of_clk - add managed lookup and provider registrations clk: clk-max77686: Clean clkdev lookup leak and use devm clk: clk-st: avoid clkdev lookup leak at remove clk: clk-hi655x: Free of_provider at remove clk: rk808: use managed version of o

Re: [PATCH v2 2/8] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-11-02 Thread Matti Vaittinen
Thanks for taking the time and reviewing this! On Fri, Nov 02, 2018 at 09:15:17AM +0100, Krzysztof Kozlowski wrote: > On Thu, 1 Nov 2018 at 08:19, Matti Vaittinen > wrote: > > > > clk-max77686 never clean clkdev lookup at remove. This can cause > > oops if clk-max77686

Re: [PATCH v2 3/8] clk: clk-s3c2410-dclk: clean up clkdev lookup leak

2018-11-02 Thread Matti Vaittinen
Thanks Krzysztof! On Fri, Nov 02, 2018 at 09:19:10AM +0100, Krzysztof Kozlowski wrote: > On Thu, 1 Nov 2018 at 08:19, Matti Vaittinen > wrote: > > > > Use devm variant of clkdev lookup registration in order to avoid > > clkdev lookup leak at device remove. > > >

[PATCH v2 8/8] clk: apcs-msm8916: simplify probe cleanup by using devm

2018-11-01 Thread Matti Vaittinen
use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..f4e0c136ab1a 100644

[PATCH v2 7/8] clk: clk-twl6040: Free of_provider at remove

2018-11-01 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index 25dfe050ae9f

[PATCH v2 6/8] clk: rk808: use managed version of of_provider registration

2018-11-01 Thread Matti Vaittinen
Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b

[PATCH v2 5/8] clk: clk-hi655x: Free of_provider at remove

2018-11-01 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..394d0109104d

[PATCH v2 4/8] clk: clk-st: avoid clkdev lookup leak at remove

2018-11-01 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index fb62f3938008..32d8df9bd853

[PATCH v2 3/8] clk: clk-s3c2410-dclk: clean up clkdev lookup leak

2018-11-01 Thread Matti Vaittinen
Use devm variant of clkdev lookup registration in order to avoid clkdev lookup leak at device remove. Signed-off-by: Matti Vaittinen --- drivers/clk/samsung/clk-s3c2410-dclk.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2410

[PATCH v2 2/8] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-11-01 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_parent_hw_provider. Signed-off-by: Matti Vaittinen --- drivers/clk

[PATCH v2 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-11-01 Thread Matti Vaittinen
registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 3 + drivers/clk/clk.c | 28

[PATCH v2 0/8] clk: clkdev: managed clk lookup and provider registrations

2018-11-01 Thread Matti Vaittinen
'devm_of_clk_add_parent_hw_provider' for no OF config. - patches 2-8 are unchanged. This patch series is based on clk-next --- Matti Vaittinen (8): clk: clkdev/of_clk - add managed lookup and provider registrations clk: clk-max77686: Clean clkdev lookup leak and use devm clk: clk-s3c2410-dclk

Re: [PATCH 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-10-31 Thread Matti Vaittinen
On Wed, Oct 31, 2018 at 10:30:34AM +0200, Matti Vaittinen wrote: > With MFD devices the clk properties may be contained in MFD (parent) DT > node. Current devm_of_clk_add_hw_provider assumes the clk is bound to MFD > subdevice not to MFD device (parent). Add > devm_of_clk_add_hw_provid

[PATCH 8/8] clk: apcs-msm8916: simplify probe cleanup by using devm

2018-10-31 Thread Matti Vaittinen
use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..f4e0c136ab1a 100644

[PATCH 7/8] clk: clk-twl6040: Free of_provider at remove

2018-10-31 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index 25dfe050ae9f

[PATCH 6/8] clk: rk808: use managed version of of_provider registration

2018-10-31 Thread Matti Vaittinen
Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b

[PATCH 5/8] clk: clk-hi655x: Free of_provider at remove

2018-10-31 Thread Matti Vaittinen
use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..394d0109104d

[PATCH 4/8] clk: clk-st: avoid clkdev lookup leak at remove

2018-10-31 Thread Matti Vaittinen
Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index fb62f3938008..32d8df9bd853

[PATCH 3/8] clk: clk-s3c2410-dclk: clean up clkdev lookup leak

2018-10-31 Thread Matti Vaittinen
Use devm variant of clkdev lookup registration in order to avoid clkdev lookup leak at device remove. Signed-off-by: Matti Vaittinen --- drivers/clk/samsung/clk-s3c2410-dclk.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2410

[PATCH 2/8] clk: clk-max77686: Clean clkdev lookup leak and use devm

2018-10-31 Thread Matti Vaittinen
clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_parent_hw_provider. Signed-off-by: Matti Vaittinen --- drivers/clk

[PATCH 1/8] clk: clkdev/of_clk - add managed lookup and provider registrations

2018-10-31 Thread Matti Vaittinen
registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 3 + drivers/clk/clk.c | 28

[PATCH 0/8] clk: clkdev: managed clk lookup and provider registrations

2018-10-31 Thread Matti Vaittinen
/cover.1535630942.git.matti.vaitti...@fi.rohmeurope.com/ The BD71837/BD71847 work is currently pending for related MFD commits to get merged in clk-tree and the devm functions are now submitted in this series. This patch series is based on clk-next --- Matti Vaittinen (8): clk: clkdev/of_clk - add