Skip to content

Commit

Permalink
usb: bdc: Halt controller on suspend
Browse files Browse the repository at this point in the history
[ Upstream commit 5fc453d ]

GISB bus error kernel panics have been observed during S2 transition
tests on the 7271t platform. The errors are a result of the BDC
interrupt handler trying to access BDC register space after the
system's suspend callbacks have completed.

Adding a suspend hook to the BDC driver that halts the controller before
S2 entry thus preventing unwanted access to the BDC register space during
this transition.

Signed-off-by: Danesh Petigara <danesh.petigara@broadcom.com>
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Danesh Petigara authored and gregkh committed Aug 19, 2020
1 parent 2961844 commit 8fb0579
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/usb/gadget/udc/bdc/bdc_core.c
Expand Up @@ -605,9 +605,14 @@ static int bdc_remove(struct platform_device *pdev)
static int bdc_suspend(struct device *dev)
{
struct bdc *bdc = dev_get_drvdata(dev);
int ret;

clk_disable_unprepare(bdc->clk);
return 0;
/* Halt the controller */
ret = bdc_stop(bdc);
if (!ret)
clk_disable_unprepare(bdc->clk);

return ret;
}

static int bdc_resume(struct device *dev)
Expand Down

0 comments on commit 8fb0579

Please sign in to comment.