Re: [PATCH] usb: echi-hcd: Add ehci_setup check before echi_shutdown
From: Andy Gross
Date: Thu May 19 2016 - 16:49:43 EST
On 19 May 2016 at 05:12, Srinivas Kandagatla
<srinivas.kandagatla@xxxxxxxxxx> wrote:
> This patch protects system from crashing at shutdown in
> cases where usb host is not added yet from OTG controller driver.
> As ehci_setup() not done yet, so stop accessing registers or
> variables initialized as part of ehci_setup().
>
> The use case is simple, for boards like DB410c where the usb host
> or device functionality is decided based on the micro-usb cable
> presence. If the board boots up with micro-usb connected, the
> OTG driver like echi-msm would not add the usb host by default.
> However a system shutdown would go and access registers and
> uninitialized variables, resulting in below crash.
Works great.
Tested-by: Andy Gross <andy.gross@xxxxxxxxxx>