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>
This commit is contained in:
David Vrabel
2009-01-07 10:54:22 +00:00
parent a23e66f3b8
commit a5e6ced58d
4 changed files with 30 additions and 4 deletions

View File

@@ -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);
}