Centos-kernel-stream-9/drivers/usb/typec
Desnes Nunes ce0e5a8164 acpi: typec: ucsi: Introduce a ->poll_cci method
JIRA: https://issues.redhat.com/browse/RHEL-78828

commit 976e7e9bdc7719a023a4ecccd2e3daec9ab20a40
Author: "Christian A. Ehrhardt" <lk@c--e.de>
Date: Mon, 17 Feb 2025 13:54:39 +0300

  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.

  Fixes: fa48d7e81624 ("usb: typec: ucsi: Do not call ACPI _DSM method for UCSI read operations")
  Cc: stable <stable@kernel.org>
  Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
  Tested-by: Fedor Pchelkin <boddah8794@gmail.com>
  Signed-off-by: Fedor Pchelkin <boddah8794@gmail.com>
  Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  Link: https://lore.kernel.org/r/20250217105442.113486-2-boddah8794@gmail.com
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2025-03-19 21:24:08 -03:00
..
altmodes usb: typec: Fix typo in comment 2025-03-19 16:21:50 -03:00
mux usb: typec: mux: Add support for the TUSB1046 crosspoint switch 2025-03-19 16:21:55 -03:00
tcpm usb: typec: tcpci: fix NULL pointer issue on shared irq case 2025-03-19 21:24:07 -03:00
tipd power: supply: Change usb_types from an array into a bitmask 2024-12-13 11:26:37 -03:00
ucsi acpi: typec: ucsi: Introduce a ->poll_cci method 2025-03-19 21:24:08 -03:00
Kconfig
Makefile
anx7411.c power: supply: Change usb_types from an array into a bitmask 2024-12-13 11:26:37 -03:00
bus.c usb: typec: altmodes: add typec_cable_ops to typec_altmode 2024-06-13 13:56:58 -03:00
bus.h
class.c usb: typec: Add attribute file showing the USB Modes of the partner 2025-03-19 16:21:53 -03:00
class.h usb: typec: Add attribute file showing the USB Modes of the partner 2025-03-19 16:21:53 -03:00
hd3ss3220.c
mux.c usb: typec: constify struct class usage 2024-06-18 17:26:51 -03:00
mux.h
pd.c usb: typec: constify the struct device_type usage 2024-06-18 17:26:51 -03:00
pd.h
port-mapper.c
retimer.c usb: typec: constify struct class usage 2024-06-18 17:26:51 -03:00
retimer.h
rt1719.c power: supply: Change usb_types from an array into a bitmask 2024-12-13 11:26:37 -03:00
stusb160x.c usb: typec: stusb160x: Make use of i2c_get_match_data() 2025-03-19 16:21:50 -03:00
wusb3801.c