From: "Christian A. Ehrhardt" <lk@c--e.de>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Fedor Pchelkin <boddah8794@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Benson Leung <bleung@chromium.org>,
Jameson Thies <jthies@google.com>,
Saranya Gopal <saranya.gopal@intel.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Mark Pearson <mpearson@squebb.ca>,
stable@vger.kernel.org
Subject: Re: [PATCH RFC 1/2] acpi: typec: ucsi: Introduce a ->poll_cci method
Date: Fri, 7 Feb 2025 07:51:46 +0100 [thread overview]
Message-ID: <Z6WtgqH5CaKTfaDX@cae.in-ulm.de> (raw)
In-Reply-To: <CAA8EJpr=SBQ29m8_iCigUKMHzrdbTFRSpTHv4Aapo55hMVOcaw@mail.gmail.com>
Hi,
On Fri, Feb 07, 2025 at 02:38:03AM +0200, Dmitry Baryshkov wrote:
> On Thu, 6 Feb 2025 at 20:43, Fedor Pchelkin <boddah8794@gmail.com> wrote:
> >
> > From: "Christian A. Ehrhardt" <lk@c--e.de>
> >
> > For the ACPI backend of UCSI the UCSI "registers" are just a memory copy
> > of the register values in an opregion. The ACPI implementation in the
> > BIOS ensures that the opregion contents are synced to the embedded
> > controller and it ensures that the registers (in particular CCI) are
> > synced back to the opregion on notifications. While there is an ACPI call
> > that syncs the actual registers to the opregion there is rarely a need to
> > do this and on some ACPI implementations it actually breaks in various
> > interesting ways.
> >
> > The only reason to force a sync from the embedded controller is to poll
> > CCI while notifications are disabled. Only the ucsi core knows if this
> > is the case and guessing based on the current command is suboptimal, i.e.
> > leading to the following spurious assertion splat:
> >
> > WARNING: CPU: 3 PID: 76 at drivers/usb/typec/ucsi/ucsi.c:1388 ucsi_reset_ppm+0x1b4/0x1c0 [typec_ucsi]
> > CPU: 3 UID: 0 PID: 76 Comm: kworker/3:0 Not tainted 6.12.11-200.fc41.x86_64 #1
> > Hardware name: LENOVO 21D0/LNVNB161216, BIOS J6CN45WW 03/17/2023
> > Workqueue: events_long ucsi_init_work [typec_ucsi]
> > RIP: 0010:ucsi_reset_ppm+0x1b4/0x1c0 [typec_ucsi]
> > Call Trace:
> > <TASK>
> > ucsi_init_work+0x3c/0xac0 [typec_ucsi]
> > process_one_work+0x179/0x330
> > worker_thread+0x252/0x390
> > kthread+0xd2/0x100
> > ret_from_fork+0x34/0x50
> > ret_from_fork_asm+0x1a/0x30
> > </TASK>
> >
> > Thus introduce a ->poll_cci() method that works like ->read_cci() with an
> > additional forced sync and document that this should be used when polling
> > with notifications disabled. For all other backends that presumably don't
> > have this issue use the same implementation for both methods.
>
> Should the ucsi_init() also use ->poll_cci instead of ->read_cci?
> Although it's executed with notifications enabled, it looks as if it
> might need the additional resync.
I don't think it should be neccessary. The command completion event
for the ucsi_send_command just above should have synced already and
anything that happens after that ought to generate an event.
Best regards,
Christian
next prev parent reply other threads:[~2025-02-07 6:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 18:43 [PATCH RFC 0/2] usb: typec: ucsi: avoid problems during initial PPM reset Fedor Pchelkin
2025-02-06 18:43 ` [PATCH RFC 1/2] acpi: typec: ucsi: Introduce a ->poll_cci method Fedor Pchelkin
2025-02-07 0:38 ` Dmitry Baryshkov
2025-02-07 6:51 ` Christian A. Ehrhardt [this message]
2025-02-13 13:56 ` Heikki Krogerus
2025-02-06 18:43 ` [PATCH RFC 2/2] usb: typec: ucsi: increase timeout for PPM reset operations Fedor Pchelkin
2025-02-13 13:58 ` Heikki Krogerus
2025-02-17 10:18 ` Fedor Pchelkin
2025-02-17 10:32 ` Greg Kroah-Hartman
2025-02-18 16:57 ` Mark Pearson
2025-02-18 19:53 ` Fedor Pchelkin
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=Z6WtgqH5CaKTfaDX@cae.in-ulm.de \
--to=lk@c--e.de \
--cc=bleung@chromium.org \
--cc=boddah8794@gmail.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jthies@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mpearson@squebb.ca \
--cc=saranya.gopal@intel.com \
--cc=stable@vger.kernel.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.