Skip to content

Commit e6bdfe3

Browse files
ctmarinasgregkh
authored andcommitted
USB: isp1760: Add a delay before reading the SKIPMAP registers in isp1760-hcd.c
The data read from the SKIPMAP registers is not immediately available after writing and the driver panics when a packet is enqueued from the interrupt handler. This patch adds an ndelay(195) before these registers are read (delay value mentioned in section 15.1.1.3 of the ISP1760 data sheet). Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent b7af0bb commit e6bdfe3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/usb/host/isp1760-hcd.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,13 @@ static void enqueue_an_ATL_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
819819
u32 atl_regs, payload;
820820
u32 buffstatus;
821821

822+
/*
823+
* When this function is called from the interrupt handler to enqueue
824+
* a follow-up packet, the SKIP register gets written and read back
825+
* almost immediately. With ISP1761, this register requires a delay of
826+
* 195ns between a write and subsequent read (see section 15.1.1.3).
827+
*/
828+
ndelay(195);
822829
skip_map = isp1760_readl(hcd->regs + HC_ATL_PTD_SKIPMAP_REG);
823830

824831
BUG_ON(!skip_map);
@@ -853,6 +860,13 @@ static void enqueue_an_INT_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
853860
u32 int_regs, payload;
854861
u32 buffstatus;
855862

863+
/*
864+
* When this function is called from the interrupt handler to enqueue
865+
* a follow-up packet, the SKIP register gets written and read back
866+
* almost immediately. With ISP1761, this register requires a delay of
867+
* 195ns between a write and subsequent read (see section 15.1.1.3).
868+
*/
869+
ndelay(195);
856870
skip_map = isp1760_readl(hcd->regs + HC_INT_PTD_SKIPMAP_REG);
857871

858872
BUG_ON(!skip_map);

0 commit comments

Comments
 (0)