diff mbox series

platform/chrome: cros_ec: Fix panic notifier registration

Message ID 20230110221033.7441-1-m.szyprowski@samsung.com (mailing list archive)
State Accepted
Commit 9e69b1b27b13eb4eb85405900e290c0d539454bf
Headers show
Series platform/chrome: cros_ec: Fix panic notifier registration | expand

Commit Message

Marek Szyprowski Jan. 10, 2023, 10:10 p.m. UTC
Initialize panic notifier to avoid the following lockdep warning:

--->8---
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
turning off the locking correctness validator.
CPU: 0 PID: 62 Comm: kworker/u16:1 Not tainted 6.2.0-rc3-next-20230110-00037-g7c2b0426386a #6112
Hardware name: Samsung Exynos (Flattened Device Tree)
Workqueue: events_unbound async_run_entry_fn
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x58/0x70
 dump_stack_lvl from register_lock_class+0x998/0x9a8
 register_lock_class from __lock_acquire+0x6c/0x2a80
 __lock_acquire from lock_acquire+0x124/0x3f0
 lock_acquire from down_write+0x40/0xd8
 down_write from blocking_notifier_chain_register+0x28/0x58
 blocking_notifier_chain_register from cros_ec_debugfs_probe+0x324/0x3b4
 cros_ec_debugfs_probe from platform_probe+0x5c/0xb8
 platform_probe from really_probe+0xe0/0x414
 really_probe from __driver_probe_device+0x9c/0x200
 __driver_probe_device from driver_probe_device+0x30/0xc0
 driver_probe_device from __device_attach_driver+0xa8/0x120
 __device_attach_driver from bus_for_each_drv+0x7c/0xc0
 bus_for_each_drv from __device_attach_async_helper+0xa0/0xf4
 __device_attach_async_helper from async_run_entry_fn+0x40/0x154
 async_run_entry_fn from process_one_work+0x288/0x790
 process_one_work from worker_thread+0x44/0x504
 worker_thread from kthread+0xf0/0x124
 kthread from ret_from_fork+0x14/0x2c
Exception stack(0xf0a6dfb0 to 0xf0a6dff8)
...
------------[ cut here ]------------

Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/platform/chrome/cros_ec.c | 1 +
 1 file changed, 1 insertion(+)

Comments

patchwork-bot+chrome-platform@kernel.org Jan. 11, 2023, 3:30 a.m. UTC | #1
Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Tue, 10 Jan 2023 23:10:33 +0100 you wrote:
> Initialize panic notifier to avoid the following lockdep warning:
> 
> --->8---
> INFO: trying to register non-static key.
> The code is fine but needs lockdep annotation, or maybe
> you didn't initialize this object before use?
> turning off the locking correctness validator.
> CPU: 0 PID: 62 Comm: kworker/u16:1 Not tainted 6.2.0-rc3-next-20230110-00037-g7c2b0426386a #6112
> Hardware name: Samsung Exynos (Flattened Device Tree)
> Workqueue: events_unbound async_run_entry_fn
>  unwind_backtrace from show_stack+0x10/0x14
>  show_stack from dump_stack_lvl+0x58/0x70
>  dump_stack_lvl from register_lock_class+0x998/0x9a8
>  register_lock_class from __lock_acquire+0x6c/0x2a80
>  __lock_acquire from lock_acquire+0x124/0x3f0
>  lock_acquire from down_write+0x40/0xd8
>  down_write from blocking_notifier_chain_register+0x28/0x58
>  blocking_notifier_chain_register from cros_ec_debugfs_probe+0x324/0x3b4
>  cros_ec_debugfs_probe from platform_probe+0x5c/0xb8
>  platform_probe from really_probe+0xe0/0x414
>  really_probe from __driver_probe_device+0x9c/0x200
>  __driver_probe_device from driver_probe_device+0x30/0xc0
>  driver_probe_device from __device_attach_driver+0xa8/0x120
>  __device_attach_driver from bus_for_each_drv+0x7c/0xc0
>  bus_for_each_drv from __device_attach_async_helper+0xa0/0xf4
>  __device_attach_async_helper from async_run_entry_fn+0x40/0x154
>  async_run_entry_fn from process_one_work+0x288/0x790
>  process_one_work from worker_thread+0x44/0x504
>  worker_thread from kthread+0xf0/0x124
>  kthread from ret_from_fork+0x14/0x2c
> Exception stack(0xf0a6dfb0 to 0xf0a6dff8)
> ...
> 
> [...]

Here is the summary with links:
  - platform/chrome: cros_ec: Fix panic notifier registration
    https://git.kernel.org/chrome-platform/c/9e69b1b27b13

You are awesome, thank you!
patchwork-bot+chrome-platform@kernel.org Jan. 13, 2023, 9:20 p.m. UTC | #2
Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Tue, 10 Jan 2023 23:10:33 +0100 you wrote:
> Initialize panic notifier to avoid the following lockdep warning:
> 
> --->8---
> INFO: trying to register non-static key.
> The code is fine but needs lockdep annotation, or maybe
> you didn't initialize this object before use?
> turning off the locking correctness validator.
> CPU: 0 PID: 62 Comm: kworker/u16:1 Not tainted 6.2.0-rc3-next-20230110-00037-g7c2b0426386a #6112
> Hardware name: Samsung Exynos (Flattened Device Tree)
> Workqueue: events_unbound async_run_entry_fn
>  unwind_backtrace from show_stack+0x10/0x14
>  show_stack from dump_stack_lvl+0x58/0x70
>  dump_stack_lvl from register_lock_class+0x998/0x9a8
>  register_lock_class from __lock_acquire+0x6c/0x2a80
>  __lock_acquire from lock_acquire+0x124/0x3f0
>  lock_acquire from down_write+0x40/0xd8
>  down_write from blocking_notifier_chain_register+0x28/0x58
>  blocking_notifier_chain_register from cros_ec_debugfs_probe+0x324/0x3b4
>  cros_ec_debugfs_probe from platform_probe+0x5c/0xb8
>  platform_probe from really_probe+0xe0/0x414
>  really_probe from __driver_probe_device+0x9c/0x200
>  __driver_probe_device from driver_probe_device+0x30/0xc0
>  driver_probe_device from __device_attach_driver+0xa8/0x120
>  __device_attach_driver from bus_for_each_drv+0x7c/0xc0
>  bus_for_each_drv from __device_attach_async_helper+0xa0/0xf4
>  __device_attach_async_helper from async_run_entry_fn+0x40/0x154
>  async_run_entry_fn from process_one_work+0x288/0x790
>  process_one_work from worker_thread+0x44/0x504
>  worker_thread from kthread+0xf0/0x124
>  kthread from ret_from_fork+0x14/0x2c
> Exception stack(0xf0a6dfb0 to 0xf0a6dff8)
> ...
> 
> [...]

Here is the summary with links:
  - platform/chrome: cros_ec: Fix panic notifier registration
    https://git.kernel.org/chrome-platform/c/9e69b1b27b13

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index ec733f683f34..c4345dafec57 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -182,6 +182,7 @@  int cros_ec_register(struct cros_ec_device *ec_dev)
 	int err = 0;
 
 	BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier);
+	BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->panic_notifier);
 
 	ec_dev->max_request = sizeof(struct ec_params_hello);
 	ec_dev->max_response = sizeof(struct ec_response_get_protocol_info);