From: Al Cooper <alcooperx@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Danesh Petigara <danesh.petigara@broadcom.com>,
Al Cooper <alcooperx@gmail.com>,
devicetree@vger.kernel.org, Felipe Balbi <balbi@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Sasi Kumar <sasi.kumar@broadcom.com>
Subject: [PATCH v2 6/7] usb: bdc: Halt controller on suspend
Date: Tue, 21 Jul 2020 10:43:25 -0400 [thread overview]
Message-ID: <20200721144326.7976-7-alcooperx@gmail.com> (raw)
In-Reply-To: <20200721144326.7976-1-alcooperx@gmail.com>
From: Danesh Petigara <danesh.petigara@broadcom.com>
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>
---
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 2c2f7aef7ba7..c1650247ea39 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -607,9 +607,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.17.1
next prev parent reply other threads:[~2020-07-21 14:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 14:43 [PATCH v2 0/7] usb: bdc: Updates and fixes to the USB BDC driver Al Cooper
2020-07-21 14:43 ` [PATCH v2 1/7] dt-bindings: usb: bdc: Update compatible strings Al Cooper
2020-07-21 17:33 ` Florian Fainelli
2020-07-21 14:43 ` [PATCH v2 2/7] usb: bdc: Add compatible string for new style USB DT nodes Al Cooper
2020-07-21 17:33 ` Florian Fainelli
2020-07-22 8:47 ` Sergei Shtylyov
2020-07-21 14:43 ` [PATCH v2 3/7] bdc: Fix bug causing crash after multiple disconnects Al Cooper
2020-07-21 17:33 ` Florian Fainelli
2020-07-21 14:43 ` [PATCH v2 4/7] usb: bdc: Adb shows offline after resuming from S2 Al Cooper
2020-07-21 17:33 ` Florian Fainelli
2020-07-21 14:43 ` [PATCH v2 5/7] usb: bdc: driver runs out of buffer descriptors on large ADB transfers Al Cooper
2020-07-21 17:34 ` Florian Fainelli
2020-07-21 14:43 ` Al Cooper [this message]
2020-07-21 17:34 ` [PATCH v2 6/7] usb: bdc: Halt controller on suspend Florian Fainelli
2020-07-21 14:43 ` [PATCH v2 7/7] usb: bdc: Use devm_clk_get_optional() Al Cooper
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=20200721144326.7976-7-alcooperx@gmail.com \
--to=alcooperx@gmail.com \
--cc=balbi@kernel.org \
--cc=danesh.petigara@broadcom.com \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sasi.kumar@broadcom.com \
/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).