[PATCH] platform/chrome: cros_ec: Initialize panic notifier block

Chen-Yu Tsai posted 1 patch 2 years, 8 months ago
drivers/platform/chrome/cros_ec.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] platform/chrome: cros_ec: Initialize panic notifier block
Posted by Chen-Yu Tsai 2 years, 8 months ago
Commit d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
added a new notifier block, but failed to initialize it properly,
resulting in a warning and stack trace (omitted):

	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.

Initialize the notifier block properly.

Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
 drivers/platform/chrome/cros_ec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index 4ae57820afd5..b895c8130bba 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);
-- 
2.39.0.314.g84b9a713c41-goog
Re: [PATCH] platform/chrome: cros_ec: Initialize panic notifier block
Posted by Guenter Roeck 2 years, 8 months ago
On Wed, Jan 11, 2023 at 8:39 PM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> Commit d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
> added a new notifier block, but failed to initialize it properly,
> resulting in a warning and stack trace (omitted):
>
>         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.
>
> Initialize the notifier block properly.
>
> Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Reviewed-by: Guenter Roekc <groeck@chromium.org>

Didn't I already see this ?

Guenter

> ---
>  drivers/platform/chrome/cros_ec.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
> index 4ae57820afd5..b895c8130bba 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);
> --
> 2.39.0.314.g84b9a713c41-goog
>
Re: [PATCH] platform/chrome: cros_ec: Initialize panic notifier block
Posted by Chen-Yu Tsai 2 years, 8 months ago
On Thu, Jan 12, 2023 at 12:39 PM Chen-Yu Tsai <wenst@chromium.org> wrote:
>
> Commit d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
> added a new notifier block, but failed to initialize it properly,
> resulting in a warning and stack trace (omitted):
>
>         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.
>
> Initialize the notifier block properly.
>
> Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Looks like someone beat me to it. Please ignore this one.