All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] MIPS: Remove no longer needed work_on_cpu() call
@ 2016-05-02  9:00 Anna-Maria Gleixner
  2016-05-05 21:58   ` James Hogan
  0 siblings, 1 reply; 3+ messages in thread
From: Anna-Maria Gleixner @ 2016-05-02  9:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: rt, Anna-Maria Gleixner, Ralf Baechle, linux-mips

Since commit 3b9d6da67e11 ("cpu/hotplug: Fix rollback during error-out
in __cpu_disable()") it is ensured that callbacks of CPU_ONLINE and
CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
work_on_cpu() calls are no longer required.

Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
mips_cdmm_bus_down(). Description of those functions are adapted.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
Changes in v2:
	- Adapt referenced commit in commit message

 drivers/bus/mips_cdmm.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

--- a/drivers/bus/mips_cdmm.c
+++ b/drivers/bus/mips_cdmm.c
@@ -599,8 +599,8 @@ BUILD_PERDEV_HELPER(cpu_up)         /* i
  * mips_cdmm_bus_down() - Tear down the CDMM bus.
  * @data:	Pointer to unsigned int CPU number.
  *
- * This work_on_cpu callback function is executed on a given CPU to call the
- * CDMM driver cpu_down callback for all devices on that CPU.
+ * This function is executed on the hotplugged CPU and calls the CDMM
+ * driver cpu_down callback for all devices on that CPU.
  */
 static long mips_cdmm_bus_down(void *data)
 {
@@ -630,7 +630,9 @@ static long mips_cdmm_bus_down(void *dat
  * CDMM devices on that CPU, or to call the CDMM driver cpu_up callback for all
  * devices already discovered on that CPU.
  *
- * It is used during initialisation and when CPUs are brought online.
+ * It is used as work_on_cpu callback function during
+ * initialisation. When CPUs are brought online the function is
+ * invoked directly on the hotplugged CPU.
  */
 static long mips_cdmm_bus_up(void *data)
 {
@@ -677,10 +679,10 @@ static int mips_cdmm_cpu_notify(struct n
 	switch (action & ~CPU_TASKS_FROZEN) {
 	case CPU_ONLINE:
 	case CPU_DOWN_FAILED:
-		work_on_cpu(cpu, mips_cdmm_bus_up, &cpu);
+		mips_cdmm_bus_up(&cpu);
 		break;
 	case CPU_DOWN_PREPARE:
-		work_on_cpu(cpu, mips_cdmm_bus_down, &cpu);
+		mips_cdmm_bus_down(&cpu);
 		break;
 	default:
 		return NOTIFY_DONE;

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

* Re: [PATCH v2] MIPS: Remove no longer needed work_on_cpu() call
@ 2016-05-05 21:58   ` James Hogan
  0 siblings, 0 replies; 3+ messages in thread
From: James Hogan @ 2016-05-05 21:58 UTC (permalink / raw)
  To: Anna-Maria Gleixner; +Cc: linux-kernel, rt, Ralf Baechle, linux-mips

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

On Mon, May 02, 2016 at 11:00:49AM +0200, Anna-Maria Gleixner wrote:
> Since commit 3b9d6da67e11 ("cpu/hotplug: Fix rollback during error-out
> in __cpu_disable()") it is ensured that callbacks of CPU_ONLINE and
> CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
> work_on_cpu() calls are no longer required.
> 
> Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
> mips_cdmm_bus_down(). Description of those functions are adapted.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>

Thanks, looks reasonable to me,
Acked-by: James Hogan <james.hogan@imgtec.com>

Cheers,
James

> ---
> Changes in v2:
> 	- Adapt referenced commit in commit message
> 
>  drivers/bus/mips_cdmm.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> --- a/drivers/bus/mips_cdmm.c
> +++ b/drivers/bus/mips_cdmm.c
> @@ -599,8 +599,8 @@ BUILD_PERDEV_HELPER(cpu_up)         /* i
>   * mips_cdmm_bus_down() - Tear down the CDMM bus.
>   * @data:	Pointer to unsigned int CPU number.
>   *
> - * This work_on_cpu callback function is executed on a given CPU to call the
> - * CDMM driver cpu_down callback for all devices on that CPU.
> + * This function is executed on the hotplugged CPU and calls the CDMM
> + * driver cpu_down callback for all devices on that CPU.
>   */
>  static long mips_cdmm_bus_down(void *data)
>  {
> @@ -630,7 +630,9 @@ static long mips_cdmm_bus_down(void *dat
>   * CDMM devices on that CPU, or to call the CDMM driver cpu_up callback for all
>   * devices already discovered on that CPU.
>   *
> - * It is used during initialisation and when CPUs are brought online.
> + * It is used as work_on_cpu callback function during
> + * initialisation. When CPUs are brought online the function is
> + * invoked directly on the hotplugged CPU.
>   */
>  static long mips_cdmm_bus_up(void *data)
>  {
> @@ -677,10 +679,10 @@ static int mips_cdmm_cpu_notify(struct n
>  	switch (action & ~CPU_TASKS_FROZEN) {
>  	case CPU_ONLINE:
>  	case CPU_DOWN_FAILED:
> -		work_on_cpu(cpu, mips_cdmm_bus_up, &cpu);
> +		mips_cdmm_bus_up(&cpu);
>  		break;
>  	case CPU_DOWN_PREPARE:
> -		work_on_cpu(cpu, mips_cdmm_bus_down, &cpu);
> +		mips_cdmm_bus_down(&cpu);
>  		break;
>  	default:
>  		return NOTIFY_DONE;
> 

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

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

* Re: [PATCH v2] MIPS: Remove no longer needed work_on_cpu() call
@ 2016-05-05 21:58   ` James Hogan
  0 siblings, 0 replies; 3+ messages in thread
From: James Hogan @ 2016-05-05 21:58 UTC (permalink / raw)
  To: Anna-Maria Gleixner; +Cc: linux-kernel, rt, Ralf Baechle, linux-mips

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

On Mon, May 02, 2016 at 11:00:49AM +0200, Anna-Maria Gleixner wrote:
> Since commit 3b9d6da67e11 ("cpu/hotplug: Fix rollback during error-out
> in __cpu_disable()") it is ensured that callbacks of CPU_ONLINE and
> CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
> work_on_cpu() calls are no longer required.
> 
> Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
> mips_cdmm_bus_down(). Description of those functions are adapted.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>

Thanks, looks reasonable to me,
Acked-by: James Hogan <james.hogan@imgtec.com>

Cheers,
James

> ---
> Changes in v2:
> 	- Adapt referenced commit in commit message
> 
>  drivers/bus/mips_cdmm.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> --- a/drivers/bus/mips_cdmm.c
> +++ b/drivers/bus/mips_cdmm.c
> @@ -599,8 +599,8 @@ BUILD_PERDEV_HELPER(cpu_up)         /* i
>   * mips_cdmm_bus_down() - Tear down the CDMM bus.
>   * @data:	Pointer to unsigned int CPU number.
>   *
> - * This work_on_cpu callback function is executed on a given CPU to call the
> - * CDMM driver cpu_down callback for all devices on that CPU.
> + * This function is executed on the hotplugged CPU and calls the CDMM
> + * driver cpu_down callback for all devices on that CPU.
>   */
>  static long mips_cdmm_bus_down(void *data)
>  {
> @@ -630,7 +630,9 @@ static long mips_cdmm_bus_down(void *dat
>   * CDMM devices on that CPU, or to call the CDMM driver cpu_up callback for all
>   * devices already discovered on that CPU.
>   *
> - * It is used during initialisation and when CPUs are brought online.
> + * It is used as work_on_cpu callback function during
> + * initialisation. When CPUs are brought online the function is
> + * invoked directly on the hotplugged CPU.
>   */
>  static long mips_cdmm_bus_up(void *data)
>  {
> @@ -677,10 +679,10 @@ static int mips_cdmm_cpu_notify(struct n
>  	switch (action & ~CPU_TASKS_FROZEN) {
>  	case CPU_ONLINE:
>  	case CPU_DOWN_FAILED:
> -		work_on_cpu(cpu, mips_cdmm_bus_up, &cpu);
> +		mips_cdmm_bus_up(&cpu);
>  		break;
>  	case CPU_DOWN_PREPARE:
> -		work_on_cpu(cpu, mips_cdmm_bus_down, &cpu);
> +		mips_cdmm_bus_down(&cpu);
>  		break;
>  	default:
>  		return NOTIFY_DONE;
> 

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

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

end of thread, other threads:[~2016-05-05 21:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-02  9:00 [PATCH v2] MIPS: Remove no longer needed work_on_cpu() call Anna-Maria Gleixner
2016-05-05 21:58 ` James Hogan
2016-05-05 21:58   ` James Hogan

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.