2020-03-04 23:21:47

by Gwendal Grignou

[permalink] [raw]
Subject: [PATCH] platform: chrome: Fix cros-usbpd-notify notifier

cros-usbpd-notify notifier was returning NOTIFY_BAD when no host event
was available in the MKBP message.
But MKBP messages are used to transmit other information, so return
NOTIFY_DONE instead, to allow other notifier to be called.

Fixes: ec2daf6e33f9f ("platform: chrome: Add cros-usbpd-notify driver")

Signed-off-by: Gwendal Grignou <[email protected]>
---
drivers/platform/chrome/cros_usbpd_notify.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_usbpd_notify.c b/drivers/platform/chrome/cros_usbpd_notify.c
index 3851bbd6e9a39..ca2c0181a1dbf 100644
--- a/drivers/platform/chrome/cros_usbpd_notify.c
+++ b/drivers/platform/chrome/cros_usbpd_notify.c
@@ -84,7 +84,7 @@ static int cros_usbpd_notify_plat(struct notifier_block *nb,
u32 host_event = cros_ec_get_host_event(ec_dev);

if (!host_event)
- return NOTIFY_BAD;
+ return NOTIFY_DONE;

if (host_event & EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU)) {
blocking_notifier_call_chain(&cros_usbpd_notifier_list,
--
2.25.0.265.gbab2e86ba0-goog


2020-03-05 00:07:54

by Benson Leung

[permalink] [raw]
Subject: Re: [PATCH] platform: chrome: Fix cros-usbpd-notify notifier

Thanks Gwendal. Copying +Prashant Malani as well.

On Wed, Mar 4, 2020 at 3:21 PM Gwendal Grignou <[email protected]> wrote:
>
> cros-usbpd-notify notifier was returning NOTIFY_BAD when no host event
> was available in the MKBP message.
> But MKBP messages are used to transmit other information, so return
> NOTIFY_DONE instead, to allow other notifier to be called.
>
> Fixes: ec2daf6e33f9f ("platform: chrome: Add cros-usbpd-notify driver")
>
> Signed-off-by: Gwendal Grignou <[email protected]>
> ---
> drivers/platform/chrome/cros_usbpd_notify.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/chrome/cros_usbpd_notify.c b/drivers/platform/chrome/cros_usbpd_notify.c
> index 3851bbd6e9a39..ca2c0181a1dbf 100644
> --- a/drivers/platform/chrome/cros_usbpd_notify.c
> +++ b/drivers/platform/chrome/cros_usbpd_notify.c
> @@ -84,7 +84,7 @@ static int cros_usbpd_notify_plat(struct notifier_block *nb,
> u32 host_event = cros_ec_get_host_event(ec_dev);
>
> if (!host_event)
> - return NOTIFY_BAD;
> + return NOTIFY_DONE;
>
> if (host_event & EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU)) {
> blocking_notifier_call_chain(&cros_usbpd_notifier_list,
> --
> 2.25.0.265.gbab2e86ba0-goog
>


--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]

2020-03-06 18:47:18

by Benson Leung

[permalink] [raw]
Subject: Re: [PATCH] platform: chrome: Fix cros-usbpd-notify notifier

Hi Gwendal,

On Wed, Mar 04, 2020 at 03:21:08PM -0800, Gwendal Grignou wrote:
> cros-usbpd-notify notifier was returning NOTIFY_BAD when no host event
> was available in the MKBP message.
> But MKBP messages are used to transmit other information, so return
> NOTIFY_DONE instead, to allow other notifier to be called.
>
> Fixes: ec2daf6e33f9f ("platform: chrome: Add cros-usbpd-notify driver")
>
> Signed-off-by: Gwendal Grignou <[email protected]>

Queued for v5.7.

Thank you,
Benson

> ---
> drivers/platform/chrome/cros_usbpd_notify.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/chrome/cros_usbpd_notify.c b/drivers/platform/chrome/cros_usbpd_notify.c
> index 3851bbd6e9a39..ca2c0181a1dbf 100644
> --- a/drivers/platform/chrome/cros_usbpd_notify.c
> +++ b/drivers/platform/chrome/cros_usbpd_notify.c
> @@ -84,7 +84,7 @@ static int cros_usbpd_notify_plat(struct notifier_block *nb,
> u32 host_event = cros_ec_get_host_event(ec_dev);
>
> if (!host_event)
> - return NOTIFY_BAD;
> + return NOTIFY_DONE;
>
> if (host_event & EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU)) {
> blocking_notifier_call_chain(&cros_usbpd_notifier_list,
> --
> 2.25.0.265.gbab2e86ba0-goog
>

--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]


Attachments:
(No filename) (1.38 kB)
signature.asc (235.00 B)
Download all attachments