public inbox for chrome-platform@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()
@ 2025-07-22 12:05 Tzung-Bi Shih
  2025-07-22 18:23 ` Benson Leung
  2025-07-23  3:22 ` Tzung-Bi Shih
  0 siblings, 2 replies; 3+ messages in thread
From: Tzung-Bi Shih @ 2025-07-22 12:05 UTC (permalink / raw)
  To: bleung; +Cc: tzungbi, gregkh, chrome-platform, stable

The blocking notifier is registered in cros_ec_register(); however, it
isn't unregistered in cros_ec_unregister().

Fix it.

Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW")
Cc: stable@vger.kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
This is separated from a series (https://lore.kernel.org/chrome-platform/20250721044456.2736300-3-tzungbi@kernel.org/).

While I'm still figuring out/testing the series, it'd be better to send the
fix earlier (to catch up the upcoming merge window for example).

 drivers/platform/chrome/cros_ec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index 110771a8645e..fd58781a2fb7 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -318,6 +318,9 @@ EXPORT_SYMBOL(cros_ec_register);
  */
 void cros_ec_unregister(struct cros_ec_device *ec_dev)
 {
+	if (ec_dev->mkbp_event_supported)
+		blocking_notifier_chain_unregister(&ec_dev->event_notifier,
+						   &ec_dev->notifier_ready);
 	platform_device_unregister(ec_dev->pd);
 	platform_device_unregister(ec_dev->ec);
 	mutex_destroy(&ec_dev->lock);
-- 
2.50.0.727.gbf7dc18ff4-goog


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

* Re: [PATCH] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()
  2025-07-22 12:05 [PATCH] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister() Tzung-Bi Shih
@ 2025-07-22 18:23 ` Benson Leung
  2025-07-23  3:22 ` Tzung-Bi Shih
  1 sibling, 0 replies; 3+ messages in thread
From: Benson Leung @ 2025-07-22 18:23 UTC (permalink / raw)
  To: Tzung-Bi Shih; +Cc: bleung, gregkh, chrome-platform, stable

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

On Tue, Jul 22, 2025 at 12:05:13PM +0000, Tzung-Bi Shih wrote:
> The blocking notifier is registered in cros_ec_register(); however, it
> isn't unregistered in cros_ec_unregister().
> 
> Fix it.
> 
> Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

Reviewed-by: Benson Leung <bleung@chromium.org>


> ---
> This is separated from a series (https://lore.kernel.org/chrome-platform/20250721044456.2736300-3-tzungbi@kernel.org/).
> 
> While I'm still figuring out/testing the series, it'd be better to send the
> fix earlier (to catch up the upcoming merge window for example).
> 
>  drivers/platform/chrome/cros_ec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
> index 110771a8645e..fd58781a2fb7 100644
> --- a/drivers/platform/chrome/cros_ec.c
> +++ b/drivers/platform/chrome/cros_ec.c
> @@ -318,6 +318,9 @@ EXPORT_SYMBOL(cros_ec_register);
>   */
>  void cros_ec_unregister(struct cros_ec_device *ec_dev)
>  {
> +	if (ec_dev->mkbp_event_supported)
> +		blocking_notifier_chain_unregister(&ec_dev->event_notifier,
> +						   &ec_dev->notifier_ready);
>  	platform_device_unregister(ec_dev->pd);
>  	platform_device_unregister(ec_dev->ec);
>  	mutex_destroy(&ec_dev->lock);
> -- 
> 2.50.0.727.gbf7dc18ff4-goog
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()
  2025-07-22 12:05 [PATCH] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister() Tzung-Bi Shih
  2025-07-22 18:23 ` Benson Leung
@ 2025-07-23  3:22 ` Tzung-Bi Shih
  1 sibling, 0 replies; 3+ messages in thread
From: Tzung-Bi Shih @ 2025-07-23  3:22 UTC (permalink / raw)
  To: bleung; +Cc: gregkh, chrome-platform, stable

On Tue, Jul 22, 2025 at 12:05:13PM +0000, Tzung-Bi Shih wrote:
> The blocking notifier is registered in cros_ec_register(); however, it
> isn't unregistered in cros_ec_unregister().
> 
> Fix it.

Applied to

    https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

[1/1] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()
      commit: e2374953461947eee49f69b3e3204ff080ef31b1

Thanks!

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

end of thread, other threads:[~2025-07-23  3:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 12:05 [PATCH] platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister() Tzung-Bi Shih
2025-07-22 18:23 ` Benson Leung
2025-07-23  3:22 ` Tzung-Bi Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox