Re: [PATCH v5] platform: cros_ec: Query EC protocol version if EC transitions between RO/RW

From: Marek Szyprowski
Date: Tue Feb 04 2020 - 02:32:06 EST


Hi

On 04.02.2020 00:00, Yicheng Li wrote:
> Hi Enric and Marek,
>
> Those Samsung Chromebooks (Snow, Peach-Pit and Peach-Pi) do not
> support mkbp events, thus we should not do this "ready event handling"
> for them.
> Below is my fix, I also sent the entire thing as a v6 in a separate
> email. Thanks!
>
> diff --git a/drivers/platform/chrome/cros_ec.c
> b/drivers/platform/chrome/cros_ec.c
> index 38ec1fb409a5..f16804db805b 100644
> --- a/drivers/platform/chrome/cros_ec.c
> +++ b/drivers/platform/chrome/cros_ec.c
> @@ -218,12 +218,17 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> Â Â Â Â Â Â Â Â dev_dbg(ec_dev->dev, "Error %d clearing sleep event to
> ec",
> Â Â Â Â Â Â Â Â Â Â Â Â err);
>
> - Â Â Â /* Register the notifier for EC_HOST_EVENT_INTERFACE_READY
> event. */
> - Â Â Â ec_dev->notifier_ready.notifier_call = cros_ec_ready_event;
> - Â Â Â err = blocking_notifier_chain_register(&ec_dev->event_notifier,
> - Â&ec_dev->notifier_ready);
> - Â Â Â if (err)
> - Â Â Â Â Â Â Â return err;
> + Â Â Â if (ec_dev->mkbp_event_supported) {
> + Â Â Â Â Â Â Â /*
> + Â Â Â Â Â Â Â Â* Register the notifier for EC_HOST_EVENT_INTERFACE_READY
> + Â Â Â Â Â Â Â Â* event.
> + Â Â Â Â Â Â Â Â*/
> + Â Â Â Â Â Â Â ec_dev->notifier_ready.notifier_call =
> cros_ec_ready_event;
> + Â Â Â Â Â Â Â err = blocking_notifier_chain_register(
> + Â Â Â Â Â Â Â Â Â Â Â &ec_dev->event_notifier, &ec_dev->notifier_ready);
> + Â Â Â Â Â Â Â if (err)
> + Â Â Â Â Â Â Â Â Â Â Â return err;
> + Â Â Â }
>
> Â Â Â Â dev_info(dev, "Chrome EC device registered\n");
>
I confirm that this patch fixes the issue on Samsung Exynos-based
Chromebooks (Snow, Peach-Pit and Peach-Pi).

> ...

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland