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

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

 



On Tue, 2009-02-17 at 11:17 +0100, Sebastian Andrzej Siewior wrote:
> Catalin Marinas wrote:
> >>> Any quick thoughts on what may be wrong (with the software or hardware)?
> >> I'm not real sure what is going on there, a few other people reported this 
> >> also. They worked around this by adding an udelay(1) before the read of 
> >> the skip register. That is probably a timming issue but I dunno which one.
> > 
> > It looks like a timing issue. I added a do...while() loop for reading
> > the skip_map register and it seems to be reliable. Without it it crashes
> > in 50% of the cases when I unplug the device.
> > 
> > If you are OK with this approach, I'll send a patch later today.
> I would prefer if someone could find the timing issue. 

In the ISP1761 manual, there are some timing diagrams for register
access. If I understand them correctly (as a software person), there is
something like minimum 86ns between the end of the write pulse to the
beginning of the read one.

The fix below, as you suggested, works fine as well:


diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index ee56e01..054543c 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -820,6 +820,8 @@ static void enqueue_an_ATL_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
 	u32 atl_regs, payload;
 	u32 buffstatus;
 
+	/* wait for the SKIPMAP register to be updated */
+	udelay(1);
 	skip_map = isp1760_readl(hcd->regs + HC_ATL_PTD_SKIPMAP_REG);
 
 	BUG_ON(!skip_map);
@@ -854,6 +856,8 @@ static void enqueue_an_INT_packet(struct usb_hcd *hcd, struct isp1760_qh *qh,
 	u32 int_regs, payload;
 	u32 buffstatus;
 
+	/* wait for the SKIPMAP register to be updated */
+	udelay(1);
 	skip_map = isp1760_readl(hcd->regs + HC_INT_PTD_SKIPMAP_REG);
 
 	BUG_ON(!skip_map);


-- 
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