summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorWayne Chang <waynec@nvidia.com>2026-09-16 14:18:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-10-11 16:39:59 +0200
commitbbf6b99a57b2479bf51c3c8ad0946f4b8c33ed69 (patch)
tree81f94ed006b75bd5181358b69ebc6cb2169d4ddc /include/linux
parent02ad63e19449b1637ffca8d26c383223cfc8e6c1 (diff)
downloadlinux-next-bbf6b99a57b2479bf51c3c8ad0946f4b8c33ed69.tar.gz
linux-next-bbf6b99a57b2479bf51c3c8ad0946f4b8c33ed69.zip
usb: typec: ucsi_ccg: Add retry mechanism in ccg_read
CCG4 firmware occasionally fails to respond to I2C read requests, especially when reading cci and intr_reg from the ISR path. In these cases, i2c_transfer() returns -EREMOTEIO. The CCG4 is EOL, and Infineon no longer supports firmware updates, so a software workaround is necessary. Attempt the read up to CCG_READ_MAX_RETRIES (4) times in total when -EREMOTEIO is returned, sleeping ~1 ms via fsleep() between attempts. This allows recovery from transient I2C failures without affecting other error paths. The sleep is safe because ccg_read() is called both from process context and from ccg_irq_handler(), which runs in threaded IRQ context (registered via request_threaded_irq() with a NULL hard-IRQ handler), so sleeping is allowed in both cases. Fixes: 247c554a14aa ("usb: typec: ucsi: add support for Cypress CCGx") Cc: stable <stable@kernel.org> Signed-off-by: Wayne Chang <waynec@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://patch.msgid.link/20260916061858.1471606-1-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions