]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: cdnsp: Fix issue with resuming from L1
authorPawel Laszczak <pawell@cadence.com>
Fri, 18 Apr 2025 04:55:16 +0000 (04:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 May 2025 15:36:12 +0000 (17:36 +0200)
commit241e2ce88e5a494be7a5d44c0697592f1632fbee
treef44fb44cf56aaf4e1965880465bb37c3cbbe58bd
parent59820fde001500c167342257650541280c622b73
usb: cdnsp: Fix issue with resuming from L1

In very rare cases after resuming controller from L1 to L0 it reads
registers before the clock UTMI have been enabled and as the result
driver reads incorrect value.
Most of registers are in APB domain clock but some of them (e.g. PORTSC)
are in UTMI domain clock.
After entering to L1 state the UTMI clock can be disabled.
When controller transition from L1 to L0 the port status change event is
reported and in interrupt runtime function driver reads PORTSC.
During this read operation controller synchronize UTMI and APB domain
but UTMI clock is still disabled and in result it reads 0xFFFFFFFF value.
To fix this issue driver increases APB timeout value.

The issue is platform specific and if the default value of APB timeout
is not sufficient then this time should be set Individually for each
platform.

Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/PH7PR07MB953846C57973E4DB134CAA71DDBF2@PH7PR07MB9538.namprd07.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/cdns3/cdnsp-gadget.c
drivers/usb/cdns3/cdnsp-gadget.h
drivers/usb/cdns3/cdnsp-pci.c
drivers/usb/cdns3/core.h