From: Dan Robertson <dan@dlrobertson.com>
To: Anand Moon <linux.amoon@gmail.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Kevin Hilman <khilman@baylibre.com>,
Linux USB Mailing List <linux-usb@vger.kernel.org>,
linux-amlogic@lists.infradead.org,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 0/1] usb: dwc3: meson-g12a: fix shared reset control use
Date: Tue, 14 Jul 2020 09:30:24 -0400 [thread overview]
Message-ID: <20200714133024.GA27406@gothmog.test> (raw)
In-Reply-To: <CANAwSgR3ry19bxi8ZG026tHi-Bj+mP_O=PHuzUR_ujhjsdeLzA@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3277 bytes --]
Hi Anand!
On Tue, Jul 14, 2020 at 12:26:57PM +0530, Anand Moon wrote:
> hi Dan,
>
> On Mon, 13 Jul 2020 at 21:37, Dan Robertson <dan@dlrobertson.com> wrote:
> >
> > When testing suspend for another driver I noticed the following warning:
> >
> > WARNING: CPU: 1 PID: 5530 at drivers/reset/core.c:355 reset_control_assert+0x184/0x19c
> > Hardware name: Hardkernel ODROID-N2 (DT)
> > [..]
> > pc : reset_control_assert+0x184/0x19c
> > lr : dwc3_meson_g12a_suspend+0x68/0x7c
> > [..]
> > Call trace:
> > reset_control_assert+0x184/0x19c
> > dwc3_meson_g12a_suspend+0x68/0x7c
> > platform_pm_suspend+0x28/0x54
> > __device_suspend+0x590/0xabc
> > dpm_suspend+0x104/0x404
> > dpm_suspend_start+0x84/0x1bc
> > suspend_devices_and_enter+0xc4/0x4fc
> >
> > In my limited experience and knowlege it appears that we hit this
> > because the reset control was switched to shared and the the use
> > of the reset control was not changed.
> >
> > > * Calling reset_control_assert without first calling reset_control_deassert
> > > * is not allowed on a shared reset control. Calling reset_control_reset is
> > > * also not allowed on a shared reset control.
> >
> > The above snippet from reset_control_get_shared() seems to indicate that
> > this is due to the use of reset_control_reset() in dwc3_meson_g12a_probe()
> > and reset_control_deassert is not guaranteed to have been called
> > before dwc3_meson_g12a_suspend() and reset_control_assert().
> >
> > After some basic tests with the following patch I no longer hit the
> > warning. Comments and critiques on the patch are welcome. If there is a
> > reason for the current use of the reset control, I'd love to learn why!
> > Like I said before, I have not really looked at this driver before and
> > have verify limited experience with reset controls... Was working on
> > another driver, hit the warning, and thought I'd take a shot at the
> > fix :-)
> >
> Thanks, I was also looking into this issue
Awesome!
> So best Fix to this issue is to drop the call of reset_control_assert
> from dwc3_meson_g12a_suspend
> and drop the call of reset_control_deassert from dwc3_meson_g12a_resume
> With these changes we do not see the warning on suspend and resume
We definitely would avoid hitting the warning without the
reset_control_(de)assert calls in suspend and resume. That is a valid use of
the reset control, but why would that be best?
From reset_control_reset():
> * Consumers must not use reset_control_(de)assert on shared reset lines when
> * reset_control_reset has been used.
If we use reset_control_reset() then we can not (de)assert the reset line
on suspend/resume or any other time. Wouldn't we want to be able to
(de)assert the reset line? And why do we no longer want to (de)assert the
reset line on suspend/resume?
> > Can you try this attached patch?
>
> Best Regards
> -Anand
I think I had already tested something similar. Removing the (de)assert calls
but keeping reset will definitely remove the warning, but it means we can not
(de)assert the line. My guess is that this is not what we want, but I could be
wrong. Thoughts, input, or references to documentation on this would be
appreciated.
Cheers,
- Dan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2020-07-14 13:30 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 16:05 Dan Robertson
2020-07-13 16:05 ` [PATCH 1/1] " Dan Robertson
2020-07-18 8:47 ` Neil Armstrong
2020-07-18 22:57 ` Dan Robertson
2020-08-19 15:03 ` Jerome Brunet
2020-08-20 18:02 ` Kevin Hilman
2020-08-20 18:27 ` Jerome Brunet
2020-08-20 18:49 ` Kevin Hilman
2020-08-20 18:44 ` Dan Robertson
2020-08-24 8:14 ` Jerome Brunet
2020-08-24 10:24 ` Philipp Zabel
2020-08-24 14:26 ` Jerome Brunet
2020-08-25 10:20 ` Philipp Zabel
2020-08-25 14:20 ` Jerome Brunet
2020-08-26 8:14 ` Philipp Zabel
2020-08-26 8:34 ` Jerome Brunet
2020-08-29 15:25 ` Martin Blumenstingl
2020-09-02 14:13 ` Amjad Ouled-Ameur
2020-09-07 8:31 ` Jerome Brunet
2020-09-07 8:33 ` Amjad Ouled-Ameur
2020-07-14 6:56 ` [PATCH 0/1] " Anand Moon
2020-07-14 13:30 ` Dan Robertson [this message]
2020-07-14 15:27 ` Anand Moon
2020-07-15 2:58 ` Dan Robertson
2020-07-15 16:23 ` Anand Moon
2020-07-17 9:01 ` Anand Moon
2020-07-17 16:38 ` Anand Moon
2020-07-18 6:31 ` Anand Moon
2020-07-18 8:46 ` Neil Armstrong
2020-07-18 9:54 ` Anand Moon
2020-08-17 17:48 ` patchwork-bot+linux-amlogic
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=20200714133024.GA27406@gothmog.test \
--to=dan@dlrobertson.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux.amoon@gmail.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=narmstrong@baylibre.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
all inboxes | Powered by JetHome®