2017-07-14 21:50:49

by Channa

[permalink] [raw]
Subject: [PATCH] kernel: cpu: send CPU_UP_CANCELLED notification

If any of the callbacks during cpu up fail undo_cpu_up calls the
teardown call backs to rollback states but does not send
CPU_UP_CANCELLED. As on 4.9 kernel some drivers still use the
notification mechanism for cpu hotplug we need to send
CPU_UP_CANCELLED notification so drivers can rollback whatever
they did during cpu up.

Signed-off-by: Channagoud Kadabi <[email protected]>
---
kernel/cpu.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 8f52977..ade5bb2 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -494,6 +494,7 @@ static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
if (ret) {
st->target = prev_state;
undo_cpu_up(cpu, st);
+ cpu_notify(CPU_UP_CANCELED, cpu);
break;
}
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2017-07-15 06:38:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] kernel: cpu: send CPU_UP_CANCELLED notification

On Fri, Jul 14, 2017 at 02:50:28PM -0700, Channagoud Kadabi wrote:
> If any of the callbacks during cpu up fail undo_cpu_up calls the
> teardown call backs to rollback states but does not send
> CPU_UP_CANCELLED. As on 4.9 kernel some drivers still use the
> notification mechanism for cpu hotplug we need to send
> CPU_UP_CANCELLED notification so drivers can rollback whatever
> they did during cpu up.
>
> Signed-off-by: Channagoud Kadabi <[email protected]>
> ---
> kernel/cpu.c | 1 +
> 1 file changed, 1 insertion(+)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

2017-07-15 08:03:46

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] kernel: cpu: send CPU_UP_CANCELLED notification

Hi Channagoud,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.12 next-20170714]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Channagoud-Kadabi/kernel-cpu-send-CPU_UP_CANCELLED-notification/20170715-152954
config: x86_64-randconfig-x019-201728 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

kernel/cpu.c: In function 'cpuhp_up_callbacks':
>> kernel/cpu.c:368:4: error: implicit declaration of function 'cpu_notify' [-Werror=implicit-function-declaration]
cpu_notify(CPU_UP_CANCELED, cpu);
^~~~~~~~~~
>> kernel/cpu.c:368:15: error: 'CPU_UP_CANCELED' undeclared (first use in this function)
cpu_notify(CPU_UP_CANCELED, cpu);
^~~~~~~~~~~~~~~
kernel/cpu.c:368:15: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors

vim +/cpu_notify +368 kernel/cpu.c

355
356 static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
357 enum cpuhp_state target)
358 {
359 enum cpuhp_state prev_state = st->state;
360 int ret = 0;
361
362 while (st->state < target) {
363 st->state++;
364 ret = cpuhp_invoke_callback(cpu, st->state, true, NULL);
365 if (ret) {
366 st->target = prev_state;
367 undo_cpu_up(cpu, st);
> 368 cpu_notify(CPU_UP_CANCELED, cpu);
369 break;
370 }
371 }
372 return ret;
373 }
374

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.82 kB)
.config.gz (29.93 kB)
Download all attachments