All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Berg <benjamin@sipsolutions.net>
To: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org, Benjamin Berg <bberg@redhat.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: [PATCH 0/2] UCSI race condition resulting in wrong port state
Date: Fri,  9 Oct 2020 16:40:45 +0200	[thread overview]
Message-ID: <20201009144047.505957-1-benjamin@sipsolutions.net> (raw)

From: Benjamin Berg <bberg@redhat.com>

Hi all,

so, I kept running in an issue where the UCSI port information was saying
that power was being delivered (online: 1), while no cable was attached.

The core of the problem is that there are scenarios where UCSI change
notifications are lost. This happens because querying the changes that
happened is done using the GET_CONNECTOR_STATUS command while clearing the
bitfield happens from the separate ACK command. Any change in between will
be lost.

Note that the problem may be almost invisible in the UI as e.g. GNOME will
still show the battery as discharging. But some policies like automatic
suspend may be applied incorrectly.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>

Benjamin Berg (2):
  usb: typec: ucsi: acpi: Always decode connector change information
  usb: typec: ucsi: Work around PPM losing change information

 drivers/usb/typec/ucsi/ucsi.c      | 125 ++++++++++++++++++++++++-----
 drivers/usb/typec/ucsi/ucsi.h      |   2 +
 drivers/usb/typec/ucsi/ucsi_acpi.c |   5 +-
 3 files changed, 110 insertions(+), 22 deletions(-)

-- 
2.26.2


             reply	other threads:[~2020-10-09 14:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 14:40 Benjamin Berg [this message]
2020-10-09 14:40 ` [PATCH 1/2] usb: typec: ucsi: acpi: Always decode connector change information Benjamin Berg
2020-10-09 14:40 ` [PATCH 2/2] usb: typec: ucsi: Work around PPM losing " Benjamin Berg
2020-10-23 14:20 ` [PATCH 0/2] UCSI race condition resulting in wrong port state Heikki Krogerus
2020-10-28  9:10 ` Greg Kroah-Hartman
2020-11-06 10:47   ` Greg Kroah-Hartman
2020-11-06 10:50     ` Benjamin Berg
2021-08-20 13:01     ` Salvatore Bonaccorso
2021-08-20 13:29       ` Benjamin Berg
2021-08-20 23:08         ` Ian Turner
2021-08-21  6:31           ` Salvatore Bonaccorso
2021-08-27  2:12             ` Ian Turner
2021-08-21 12:09       ` Greg Kroah-Hartman
2021-08-21 13:01         ` Salvatore Bonaccorso
2021-09-01  9:26           ` Greg Kroah-Hartman

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=20201009144047.505957-1-benjamin@sipsolutions.net \
    --to=benjamin@sipsolutions.net \
    --cc=bberg@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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.