Re: [PATCH v4] xhci - correct comp_mode_recovery_timer on return from hibernate

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

 



On Thu, 21 Feb 2013, Tony Camuso wrote:

> Commit 71c731a2 (usb: host: xhci: Fix Compliance Mode on SN65LVPE502CP
> Hardware) was a workaround for systems using the SN65LVPE502CP,
> controller, but it introduced a bug in resume from hibernate.
> 
> The fix created a timer, comp_mode_recovery_timer, which is deleted from
> a timer list when xhci_suspend() is called. However, the hibernate image,
> including the timer list containing the comp_mode_recovery_timer, had
> already been saved before the timer was deleted.
> 
> Upon resume from hibernate, the list containing the comp_mode_recovery_timer
> is restored from the image saved to disk, and xhci_resume(), assuming that
> the timer had been deleted by xhci_suspend(), makes a call to
> compliance_mode_recoery_timer_init(), which creates a new instance of the
> comp_mode_recovery_timer and attempts to place it into the same list in which
> it is already active, thus corrupting the list during the list_add() call.
> 
> At this point, a call trace is emitted indicating the list corruption.
> Soon afterward, the system locks up, the watchdog times out, and the
> ensuing NMI crashes the system.
> 
> The problem did not occur when resuming from suspend. In suspend, the
> image in RAM remains exactly as it was when xhci_suspend() deleted the
> comp_mode_recovery_timer, so there is no problem when xhci_resume()
> creates a new instance of this timer and places it in the still empty
> list.
> 
> This patch avoids the problem by deleting the timer in xhci_resume()
> when resuming from hibernate. Now xhci_resume() can safely make the
> call to create a new instance of this timer, whether returning from
> suspend or hibernate.

Would it be simpler to delete the timer in xhci_bus_suspend() and
restart it in xhci_bus_resume()?  Then you wouldn't need to care about 
the difference between suspend and hibernation.

Or do you need the timer to remain running even while the root hub and 
USB bus are suspended?

Alan Stern

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