From: Benson Leung <bleung@google.com>
To: Jameson Thies <jthies@google.com>
Cc: ukaszb@chromium.org, tzungbi@kernel.org,
linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev,
bleung@chromium.org, heikki.krogerus@linux.intel.com,
gregkh@linuxfoundation.org, dmitry.baryshkov@linaro.org,
abhishekpandit@chromium.org, akuchynski@chromium.org
Subject: Re: [PATCH v1 2/2] usb: typec: ucsi: resume work after EC init
Date: Tue, 4 Feb 2025 14:34:18 +0000 [thread overview]
Message-ID: <Z6Ilasq-FdKlfsYx@google.com> (raw)
In-Reply-To: <20250204024600.4138776-3-jthies@google.com>
[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]
Hi Jameson,
On Tue, Feb 04, 2025 at 02:45:59AM +0000, Jameson Thies wrote:
> A manual EC sysjump will restart the PPM and break communication with
> the UCSI driver by disabling notifications in the initial PPM state.
> Update cros_ec_ucsi to listen for PPM init events and treat them as a
> system resume to re-establish communication with the PPM (ChromeOS EC).
>
> Signed-off-by: Jameson Thies <jthies@google.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
> ---
> drivers/usb/typec/ucsi/cros_ec_ucsi.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/cros_ec_ucsi.c b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
> index c605c8616726..5f17fcbda059 100644
> --- a/drivers/usb/typec/ucsi/cros_ec_ucsi.c
> +++ b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
> @@ -205,12 +205,19 @@ static int cros_ucsi_event(struct notifier_block *nb,
> {
> struct cros_ucsi_data *udata = container_of(nb, struct cros_ucsi_data, nb);
>
> - if (!(host_event & PD_EVENT_PPM))
> - return NOTIFY_OK;
> + if (host_event & PD_EVENT_INIT) {
> + /* Late init event received from ChromeOS EC. Treat this as a
> + * system resume to re-enable communication with the PPM.
> + */
> + dev_dbg(udata->dev, "Late PD init received\n");
> + ucsi_resume(udata->ucsi);
> + }
>
> - dev_dbg(udata->dev, "UCSI notification received\n");
> - flush_work(&udata->work);
> - schedule_work(&udata->work);
> + if (host_event & PD_EVENT_PPM) {
> + dev_dbg(udata->dev, "UCSI notification received\n");
> + flush_work(&udata->work);
> + schedule_work(&udata->work);
> + }
>
> return NOTIFY_OK;
> }
> --
> 2.48.1.362.g079036d154-goog
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-02-04 14:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 2:45 [PATCH v1 0/2] usb: typec: ucsi: Recover from CrOS EC sysjump Jameson Thies
2025-02-04 2:45 ` [PATCH v1 1/2] platform/chrome: add PD_EVENT_INIT bit definition Jameson Thies
2025-02-04 14:35 ` Benson Leung
2025-02-04 15:01 ` Łukasz Bartosik
2025-02-05 4:27 ` Tzung-Bi Shih
2025-02-04 2:45 ` [PATCH v1 2/2] usb: typec: ucsi: resume work after EC init Jameson Thies
2025-02-04 14:34 ` Benson Leung [this message]
2025-02-04 15:12 ` Łukasz Bartosik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6Ilasq-FdKlfsYx@google.com \
--to=bleung@google.com \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jthies@google.com \
--cc=linux-usb@vger.kernel.org \
--cc=tzungbi@kernel.org \
--cc=ukaszb@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.