Re: isp1760-hcd.c driver BUG_ON(!skip_map)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Catalin Marinas | 2009-03-23 12:38:16 [+0000]:

>My datasheet for ISP1760 doesn't have a table 95 in section 14.1.3 (but
>in the next section). However the ISP1761 data sheet has a section
>15.1.1.3 mentioning the 195ns delay for the EHCI registers.
>
>> So after long thinking I'm fine with this patch. Please update your
>> comment and add _why_ this delay is required. 
>
>That's an updated patch:
Thanks for the patch. If this solved your problem than I'm fine with it.
Acked-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

The "other" EHCI registers are touched in the hub code
(isp1760_hub_status_data(), isp1760_hub_control()). It looks like they
are not causing the problem right now. I try to add special read/write
routine which adds the delay prior reading them.....

>Add a delay before reading the SKIPMAP registers in isp1760-hcd.c
>
>From: Catalin Marinas <catalin.marinas@xxxxxxx>
>
>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@xxxxxxx>
>---
> drivers/usb/host/isp1760-hcd.c |   14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
>diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
>index 8ee2f41..8d57182 100644
>--- a/drivers/usb/host/isp1760-hcd.c
>+++ b/drivers/usb/host/isp1760-hcd.c
>@@ -819,6 +819,13 @@ static void enqueue_an_ATL_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
> 	u32 atl_regs, payload;
> 	u32 buffstatus;
> 
>+	/*
>+	 * When this function is called from the interrupt handler to enqueue
>+	 * a follow-up packet, the SKIP register gets written and read back
>+	 * almost immediately. With ISP1761, this register requires a delay of
>+	 * 195ns between a write and subsequent read (see section 15.1.1.3).
>+	 */
>+	ndelay(195);
> 	skip_map = isp1760_readl(hcd->regs + HC_ATL_PTD_SKIPMAP_REG);
> 
> 	BUG_ON(!skip_map);
>@@ -853,6 +860,13 @@ static void enqueue_an_INT_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
> 	u32 int_regs, payload;
> 	u32 buffstatus;
> 
>+	/*
>+	 * When this function is called from the interrupt handler to enqueue
>+	 * a follow-up packet, the SKIP register gets written and read back
>+	 * almost immediately. With ISP1761, this register requires a delay of
>+	 * 195ns between a write and subsequent read (see section 15.1.1.3).
>+	 */
>+	ndelay(195);
> 	skip_map = isp1760_readl(hcd->regs + HC_INT_PTD_SKIPMAP_REG);
> 
> 	BUG_ON(!skip_map);
>
>
>Thanks.
>
>-- 
>Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux