Linux USB
 help / color / mirror / Atom feed
From: Kenneth Crudup <kenny@panix.com>
To: "Christian A. Ehrhardt" <lk@c--e.de>, linux-kernel@vger.kernel.org
Cc: "Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Prashant Malani" <pmalani@chromium.org>,
	"Jameson Thies" <jthies@google.com>,
	"Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Samuel Čavoj" <samuel@cavoj.net>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 0/5] Fix various races in UCSI
Date: Wed, 20 Mar 2024 03:53:16 -0700	[thread overview]
Message-ID: <fba7503a-7947-4487-95e6-9d41d636b075@panix.com> (raw)
In-Reply-To: <20240320073927.1641788-1-lk@c--e.de>


Applied (cleanly) onto 6.8.1; I'll be testing over the next few days, 
but a few connects/disconnects mixed in with suspend/resume cycles shows 
no obvious issues (and everything seems to work).

Dell XPS 9320, BIOS 2.10.0

-K

On 3/20/24 00:39, Christian A. Ehrhardt wrote:
> Fix various races in UCSI code:
> - The EVENT_PENDING bit should be cleared under the PPM lock to
>    avoid spurious re-checking of the connector status.
> - The initial connector change notification during init may be
>    lost which can cause a stuck UCSI controller. Observed by me
>    and others during resume or after module reload.
> - Unsupported commands must be ACKed. This was uncovered by the
>    recent change from Jameson Thies that did sent unsupported commands.
> - The DELL quirk still isn't quite complete and I've found a more
>    elegant way to handle this. A connector change ack _is_ accepted
>    on affected systems if it is bundled with a command ack.
> - If we do two consecutive resets or the controller is already
>    reset at boog the second reset might complete early because the
>    reset complete bit is already set. ucsi_ccg.c has a work around
>    for this but it looks like an more general issue to me.
> 
> NOTE:
> As a result of these individual fixes we could think about the
> question if there are additional cases where we send some type
> of command to the PPM while the bit that indicates its completion
> is already set in CCI. And in fact there is one more case where
> this can happen: The ack command that clears the connector change
> is sent directly after the ack command for the previous command.
> It might be possible to simply ack the connector change along with
> the first command ucsi_handle_connector_change() and not at the
> end. AFAICS the connector lock should protect us from races that
> might arise out of this.
> 
> Christian A. Ehrhardt (5):
>    usb: typec: ucsi: Clear EVENT_PENDING under PPM lock
>    usb: typec: ucsi: Check for notifications after init
>    usb: typec: ucsi: Ack unsupported commands
>    usb: typec: ucsi_acpi: Refactor and fix DELL quirk
>    usb: typec: ucsi: Clear UCSI_CCI_RESET_COMPLETE before reset
> 
>   drivers/usb/typec/ucsi/ucsi.c      | 56 ++++++++++++++++++++--
>   drivers/usb/typec/ucsi/ucsi_acpi.c | 75 +++++++++++++-----------------
>   2 files changed, 84 insertions(+), 47 deletions(-)
> 

-- 
Kenneth R. Crudup / Sr. SW Engineer, Scott County Consulting, Orange 
County CA

  parent reply	other threads:[~2024-03-20 11:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  7:39 [PATCH 0/5] Fix various races in UCSI Christian A. Ehrhardt
2024-03-20  7:39 ` [PATCH 1/5] usb: typec: ucsi: Clear EVENT_PENDING under PPM lock Christian A. Ehrhardt
2024-03-22  9:53   ` Heikki Krogerus
2024-03-20  7:39 ` [PATCH 2/5] usb: typec: ucsi: Check for notifications after init Christian A. Ehrhardt
2024-03-22  9:54   ` Heikki Krogerus
2024-03-29 16:21   ` Dmitry Baryshkov
2024-04-01 20:11     ` Christian A. Ehrhardt
2024-03-20  7:39 ` [PATCH 3/5] usb: typec: ucsi: Ack unsupported commands Christian A. Ehrhardt
2024-03-22 10:04   ` Heikki Krogerus
2024-03-20  7:39 ` [PATCH 4/5] usb: typec: ucsi_acpi: Refactor and fix DELL quirk Christian A. Ehrhardt
2024-03-22 10:00   ` Heikki Krogerus
2024-03-20  7:39 ` [PATCH 5/5] usb: typec: ucsi: Clear UCSI_CCI_RESET_COMPLETE before reset Christian A. Ehrhardt
2024-03-22 10:06   ` Heikki Krogerus
2024-12-15 18:34   ` Sasha Levin
2024-12-16 21:47     ` Christian A. Ehrhardt
2024-12-17  4:24       ` Gopal, Saranya
2024-12-18 13:58         ` Gopal, Saranya
2025-01-19 13:23       ` Fedor Pchelkin
2025-01-22 21:11         ` Christian A. Ehrhardt
2025-01-28 13:58           ` Fedor Pchelkin
2025-01-28 14:04             ` Fedor Pchelkin
2024-03-20 10:53 ` Kenneth Crudup [this message]
2024-03-22 10:57   ` [PATCH 0/5] Fix various races in UCSI Neil Armstrong
2024-03-22 10:02 ` Heikki Krogerus

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=fba7503a-7947-4487-95e6-9d41d636b075@panix.com \
    --to=kenny@panix.com \
    --cc=abhishekpandit@chromium.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=lk@c--e.de \
    --cc=neil.armstrong@linaro.org \
    --cc=pmalani@chromium.org \
    --cc=samuel@cavoj.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox