From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Danesh Petigara <danesh.petigara@broadcom.com>,
Al Cooper <alcooperx@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Felipe Balbi <balbi@kernel.org>, Sasha Levin <sashal@kernel.org>,
linux-usb@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 26/31] usb: bdc: Halt controller on suspend
Date: Mon, 10 Aug 2020 15:12:54 -0400 [thread overview]
Message-ID: <20200810191259.3794858-26-sashal@kernel.org> (raw)
In-Reply-To: <20200810191259.3794858-1-sashal@kernel.org>
From: Danesh Petigara <danesh.petigara@broadcom.com>
[ Upstream commit 5fc453d7de3d0c345812453823a3a56783c5f82c ]
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>
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 4c557f3154460..e174b1b889da5 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -608,9 +608,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)
--
2.25.1
prev parent reply other threads:[~2020-08-10 19:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200810191259.3794858-1-sashal@kernel.org>
2020-08-10 19:12 ` [PATCH AUTOSEL 4.19 14/31] usb: mtu3: clear dual mode of u3port when disable device Sasha Levin
2020-08-10 19:12 ` [PATCH AUTOSEL 4.19 24/31] usb: gadget: net2280: fix memory leak on probe error handling paths Sasha Levin
2020-08-10 19:12 ` [PATCH AUTOSEL 4.19 25/31] bdc: Fix bug causing crash after multiple disconnects Sasha Levin
2020-08-10 19:12 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200810191259.3794858-26-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alcooperx@gmail.com \
--cc=balbi@kernel.org \
--cc=danesh.petigara@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).