All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] clk: let clk_disable() return immediately if clk is NULL for last 3 clks
@ 2017-03-28  9:17 ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Stephen Boyd, Ralf Baechle, Michael Turquette, Masahiro Yamada,
	Haojian Zhuang, Eric Miao, linux-kernel, adi-buildroot-devel,
	Wan ZongShun, Steven Miao, Russell King, linux-arm-kernel


Hi Andrew,

Please consider to apply this series to your tree.
This trivial series has been left over so long.

Stephen Boyd suggested to split the series per-arch,
and I did so.
But sub-architecture maintainers did not respond
in spite of my several times pings.


Please see this:
w90x900:   https://patchwork.kernel.org/patch/9338047/
mmp:       https://patchwork.kernel.org/patch/9338049/
blackfin   https://patchwork.kernel.org/patch/9338053/


Stephen mentioned Andrew could pick up this in case maintainers are silent.
http://lkml.iu.edu/hypermail/linux/kernel/1609.2/00801.html


Masahiro Yamada (3):
  ARM: mmp: let clk_disable() return immediately if clk is NULL
  ARM: w90x900: let clk_disable() return immediately if clk is NULL
  blackfin: bf609: let clk_disable() return immediately if clk is NULL

 arch/arm/mach-mmp/clock.c        | 3 +++
 arch/arm/mach-w90x900/clock.c    | 3 +++
 arch/blackfin/mach-bf609/clock.c | 3 +++
 3 files changed, 9 insertions(+)

-- 
2.7.4

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

* [PATCH v5 0/3] clk: let clk_disable() return immediately if clk is NULL for last 3 clks
@ 2017-03-28  9:17 ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Andrew,

Please consider to apply this series to your tree.
This trivial series has been left over so long.

Stephen Boyd suggested to split the series per-arch,
and I did so.
But sub-architecture maintainers did not respond
in spite of my several times pings.


Please see this:
w90x900:   https://patchwork.kernel.org/patch/9338047/
mmp:       https://patchwork.kernel.org/patch/9338049/
blackfin   https://patchwork.kernel.org/patch/9338053/


Stephen mentioned Andrew could pick up this in case maintainers are silent.
http://lkml.iu.edu/hypermail/linux/kernel/1609.2/00801.html


Masahiro Yamada (3):
  ARM: mmp: let clk_disable() return immediately if clk is NULL
  ARM: w90x900: let clk_disable() return immediately if clk is NULL
  blackfin: bf609: let clk_disable() return immediately if clk is NULL

 arch/arm/mach-mmp/clock.c        | 3 +++
 arch/arm/mach-w90x900/clock.c    | 3 +++
 arch/blackfin/mach-bf609/clock.c | 3 +++
 3 files changed, 9 insertions(+)

-- 
2.7.4

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

* [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL
  2017-03-28  9:17 ` Masahiro Yamada
@ 2017-03-28  9:17   ` Masahiro Yamada
  -1 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Stephen Boyd, Ralf Baechle, Michael Turquette, Masahiro Yamada,
	Haojian Zhuang, Eric Miao, Russell King, linux-arm-kernel,
	linux-kernel

In many of clk_disable() implementations, it is a no-op for a NULL
pointer input, but this is one of the exceptions.

Making it treewide consistent will allow clock consumers to call
clk_disable() without NULL pointer check.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v5:
  - None

Changes in v4:
  - Split into per-arch patches

Changes in v3:
  - Return only when clk is NULL.  Do not take care of error pointer.

Changes in v2:
  - Rebase on Linux 4.6-rc1

 arch/arm/mach-mmp/clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c
index ac6633d..28fe64c 100644
--- a/arch/arm/mach-mmp/clock.c
+++ b/arch/arm/mach-mmp/clock.c
@@ -67,6 +67,9 @@ void clk_disable(struct clk *clk)
 {
 	unsigned long flags;
 
+	if (!clk)
+		return;
+
 	WARN_ON(clk->enabled == 0);
 
 	spin_lock_irqsave(&clocks_lock, flags);
-- 
2.7.4

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

* [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL
@ 2017-03-28  9:17   ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: linux-arm-kernel

In many of clk_disable() implementations, it is a no-op for a NULL
pointer input, but this is one of the exceptions.

Making it treewide consistent will allow clock consumers to call
clk_disable() without NULL pointer check.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v5:
  - None

Changes in v4:
  - Split into per-arch patches

Changes in v3:
  - Return only when clk is NULL.  Do not take care of error pointer.

Changes in v2:
  - Rebase on Linux 4.6-rc1

 arch/arm/mach-mmp/clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c
index ac6633d..28fe64c 100644
--- a/arch/arm/mach-mmp/clock.c
+++ b/arch/arm/mach-mmp/clock.c
@@ -67,6 +67,9 @@ void clk_disable(struct clk *clk)
 {
 	unsigned long flags;
 
+	if (!clk)
+		return;
+
 	WARN_ON(clk->enabled == 0);
 
 	spin_lock_irqsave(&clocks_lock, flags);
-- 
2.7.4

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

* [PATCH v5 2/3] ARM: w90x900: let clk_disable() return immediately if clk is NULL
  2017-03-28  9:17 ` Masahiro Yamada
@ 2017-03-28  9:17   ` Masahiro Yamada
  -1 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Stephen Boyd, Ralf Baechle, Michael Turquette, Masahiro Yamada,
	Wan ZongShun, Russell King, linux-arm-kernel, linux-kernel

In many of clk_disable() implementations, it is a no-op for a NULL
pointer input, but this is one of the exceptions.

Making it treewide consistent will allow clock consumers to call
clk_disable() without NULL pointer check.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Wan Zongshun <mcuos.com@gmail.com>
---

Changes in v5: None
Changes in v4:
  - Split into per-arch patches

Changes in v3:
  - Return only when clk is NULL.  Do not take care of error pointer.

Changes in v2:
  - Rebase on Linux 4.6-rc1

 arch/arm/mach-w90x900/clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
index 2c371ff..ac6fd1a 100644
--- a/arch/arm/mach-w90x900/clock.c
+++ b/arch/arm/mach-w90x900/clock.c
@@ -46,6 +46,9 @@ void clk_disable(struct clk *clk)
 {
 	unsigned long flags;
 
+	if (!clk)
+		return;
+
 	WARN_ON(clk->enabled == 0);
 
 	spin_lock_irqsave(&clocks_lock, flags);
-- 
2.7.4

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

* [PATCH v5 2/3] ARM: w90x900: let clk_disable() return immediately if clk is NULL
@ 2017-03-28  9:17   ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: linux-arm-kernel

In many of clk_disable() implementations, it is a no-op for a NULL
pointer input, but this is one of the exceptions.

Making it treewide consistent will allow clock consumers to call
clk_disable() without NULL pointer check.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Wan Zongshun <mcuos.com@gmail.com>
---

Changes in v5: None
Changes in v4:
  - Split into per-arch patches

Changes in v3:
  - Return only when clk is NULL.  Do not take care of error pointer.

Changes in v2:
  - Rebase on Linux 4.6-rc1

 arch/arm/mach-w90x900/clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
index 2c371ff..ac6fd1a 100644
--- a/arch/arm/mach-w90x900/clock.c
+++ b/arch/arm/mach-w90x900/clock.c
@@ -46,6 +46,9 @@ void clk_disable(struct clk *clk)
 {
 	unsigned long flags;
 
+	if (!clk)
+		return;
+
 	WARN_ON(clk->enabled == 0);
 
 	spin_lock_irqsave(&clocks_lock, flags);
-- 
2.7.4

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

* [PATCH v5 3/3] blackfin: bf609: let clk_disable() return immediately if clk is NULL
  2017-03-28  9:17 ` Masahiro Yamada
                   ` (2 preceding siblings ...)
  (?)
@ 2017-03-28  9:17 ` Masahiro Yamada
  2017-04-13  3:33   ` Masahiro Yamada
  -1 siblings, 1 reply; 12+ messages in thread
From: Masahiro Yamada @ 2017-03-28  9:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Stephen Boyd, Ralf Baechle, Michael Turquette, Masahiro Yamada,
	Steven Miao, adi-buildroot-devel, linux-kernel

In many of clk_disable() implementations, it is a no-op for a NULL
pointer input, but this is one of the exceptions.

Making it treewide consistent will allow clock consumers to call
clk_disable() without NULL pointer check.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v5: None
Changes in v4:
  - Split into per-arch patches

Changes in v3:
  - Return only when clk is NULL.  Do not take care of error pointer.

Changes in v2:
  - Rebase on Linux 4.6-rc1

 arch/blackfin/mach-bf609/clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c
index 3783058..392a59b 100644
--- a/arch/blackfin/mach-bf609/clock.c
+++ b/arch/blackfin/mach-bf609/clock.c
@@ -97,6 +97,9 @@ EXPORT_SYMBOL(clk_enable);
 
 void clk_disable(struct clk *clk)
 {
+	if (!clk)
+		return;
+
 	if (clk->ops && clk->ops->disable)
 		clk->ops->disable(clk);
 }
-- 
2.7.4

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

* Re: [PATCH v5 2/3] ARM: w90x900: let clk_disable() return immediately if clk is NULL
  2017-03-28  9:17   ` Masahiro Yamada
@ 2017-03-30 15:38     ` Arnd Bergmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2017-03-30 15:38 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Andrew Morton, Stephen Boyd, Ralf Baechle, Michael Turquette,
	Wan ZongShun, Russell King, Linux ARM, Linux Kernel Mailing List,
	arm-soc

On Tue, Mar 28, 2017 at 11:17 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> In many of clk_disable() implementations, it is a no-op for a NULL
> pointer input, but this is one of the exceptions.
>
> Making it treewide consistent will allow clock consumers to call
> clk_disable() without NULL pointer check.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Acked-by: Wan Zongshun <mcuos.com@gmail.com>
> ---

Applied to next/fixes-non-critical in arm-soc, I don't think anybody else
was going to apply it. Thanks!

     Arnd

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

* [PATCH v5 2/3] ARM: w90x900: let clk_disable() return immediately if clk is NULL
@ 2017-03-30 15:38     ` Arnd Bergmann
  0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2017-03-30 15:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 28, 2017 at 11:17 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> In many of clk_disable() implementations, it is a no-op for a NULL
> pointer input, but this is one of the exceptions.
>
> Making it treewide consistent will allow clock consumers to call
> clk_disable() without NULL pointer check.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Acked-by: Wan Zongshun <mcuos.com@gmail.com>
> ---

Applied to next/fixes-non-critical in arm-soc, I don't think anybody else
was going to apply it. Thanks!

     Arnd

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

* Re: [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL
  2017-03-28  9:17   ` Masahiro Yamada
@ 2017-03-30 15:39     ` Arnd Bergmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2017-03-30 15:39 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Andrew Morton, Eric Miao, Michael Turquette, Stephen Boyd,
	Russell King, Haojian Zhuang, Linux Kernel Mailing List,
	Ralf Baechle, Linux ARM

On Tue, Mar 28, 2017 at 11:17 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> In many of clk_disable() implementations, it is a no-op for a NULL
> pointer input, but this is one of the exceptions.
>
> Making it treewide consistent will allow clock consumers to call
> clk_disable() without NULL pointer check.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
Applied to next/fixes-non-critical, thanks

     Arnd

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

* [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL
@ 2017-03-30 15:39     ` Arnd Bergmann
  0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2017-03-30 15:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 28, 2017 at 11:17 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> In many of clk_disable() implementations, it is a no-op for a NULL
> pointer input, but this is one of the exceptions.
>
> Making it treewide consistent will allow clock consumers to call
> clk_disable() without NULL pointer check.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
Applied to next/fixes-non-critical, thanks

     Arnd

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

* Re: [PATCH v5 3/3] blackfin: bf609: let clk_disable() return immediately if clk is NULL
  2017-03-28  9:17 ` [PATCH v5 3/3] blackfin: bf609: " Masahiro Yamada
@ 2017-04-13  3:33   ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2017-04-13  3:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Stephen Boyd, Ralf Baechle, Michael Turquette, Masahiro Yamada,
	Steven Miao, adi-buildroot-devel, Linux Kernel Mailing List

Hi Andrew

2017-03-28 18:17 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> In many of clk_disable() implementations, it is a no-op for a NULL
> pointer input, but this is one of the exceptions.
>
> Making it treewide consistent will allow clock consumers to call
> clk_disable() without NULL pointer check.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


This is the last clk_disable() that could cause NULL pointer access.
This is blocking clk consumer cleanup works.

I poked the Blackfin maintainer several times, but no response.
Actually, the maintainer has not been picking up any patches for a long time.

Please pick up this patch through your tree.



> ---
>
> Changes in v5: None
> Changes in v4:
>   - Split into per-arch patches
>
> Changes in v3:
>   - Return only when clk is NULL.  Do not take care of error pointer.
>
> Changes in v2:
>   - Rebase on Linux 4.6-rc1
>
>  arch/blackfin/mach-bf609/clock.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c
> index 3783058..392a59b 100644
> --- a/arch/blackfin/mach-bf609/clock.c
> +++ b/arch/blackfin/mach-bf609/clock.c
> @@ -97,6 +97,9 @@ EXPORT_SYMBOL(clk_enable);
>
>  void clk_disable(struct clk *clk)
>  {
> +       if (!clk)
> +               return;
> +
>         if (clk->ops && clk->ops->disable)
>                 clk->ops->disable(clk);
>  }
> --
> 2.7.4
>



-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2017-04-13  3:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  9:17 [PATCH v5 0/3] clk: let clk_disable() return immediately if clk is NULL for last 3 clks Masahiro Yamada
2017-03-28  9:17 ` Masahiro Yamada
2017-03-28  9:17 ` [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL Masahiro Yamada
2017-03-28  9:17   ` Masahiro Yamada
2017-03-30 15:39   ` Arnd Bergmann
2017-03-30 15:39     ` Arnd Bergmann
2017-03-28  9:17 ` [PATCH v5 2/3] ARM: w90x900: " Masahiro Yamada
2017-03-28  9:17   ` Masahiro Yamada
2017-03-30 15:38   ` Arnd Bergmann
2017-03-30 15:38     ` Arnd Bergmann
2017-03-28  9:17 ` [PATCH v5 3/3] blackfin: bf609: " Masahiro Yamada
2017-04-13  3:33   ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.