summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/whci/pzl.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2009-01-07 10:54:22 +0000
committerDavid Vrabel <david.vrabel@csr.com>2009-01-07 10:54:22 +0000
commita5e6ced58d423cb09c4fc0087dcfdb0b5deb5e1c (patch)
tree56ab507e1df59cae1f57c2f5883bc676f1147441 /drivers/usb/host/whci/pzl.c
parenta23e66f3b8cfdedec14541e71ef29a754870a20c (diff)
downloadlinux-a5e6ced58d423cb09c4fc0087dcfdb0b5deb5e1c.tar.bz2
wusb: timeout when waiting for ASL/PZL updates in whci-hcd
Timeout if an ASL or PZL update doesn't not complete and reset the hardware. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb/host/whci/pzl.c')
-rw-r--r--drivers/usb/host/whci/pzl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/host/whci/pzl.c b/drivers/usb/host/whci/pzl.c
index 2ae5abf69a6a..7dc85a0bee7c 100644
--- a/drivers/usb/host/whci/pzl.c
+++ b/drivers/usb/host/whci/pzl.c
@@ -183,12 +183,17 @@ void pzl_stop(struct whc *whc)
void pzl_update(struct whc *whc, uint32_t wusbcmd)
{
struct wusbhc *wusbhc = &whc->wusbhc;
+ long t;
mutex_lock(&wusbhc->mutex);
if (wusbhc->active) {
whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
- wait_event(whc->periodic_list_wq,
- (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0);
+ t = wait_event_timeout(
+ whc->periodic_list_wq,
+ (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0,
+ msecs_to_jiffies(1000));
+ if (t == 0)
+ whc_hw_error(whc, "PZL update timeout");
}
mutex_unlock(&wusbhc->mutex);
}