From: Stefan Wahren <wahrenst@gmx.net>
To: Lukas Wunner <lukas@wunner.de>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Minas Harutyunyan <hminas@synopsys.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Jassi Brar <jassisinghbrar@gmail.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Jiri Slaby <jirislaby@kernel.org>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Peter Robinson <pbrobinson@gmail.com>,
dri-devel@lists.freedesktop.org,
bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org,
linux-serial@vger.kernel.org, linux-usb@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
kernel-list@raspberrypi.com
Subject: Re: [PATCH 09/11] usb: dwc2: Skip clock gating on Broadcom SoCs
Date: Fri, 5 Jul 2024 12:22:33 +0200 [thread overview]
Message-ID: <4502d826-d80c-4a98-a889-da7badfa698e@gmx.net> (raw)
In-Reply-To: <ZoezRpXBgB1B5WjB@wunner.de>
Am 05.07.24 um 10:48 schrieb Lukas Wunner:
> On Thu, Jul 04, 2024 at 03:14:50PM +0100, Florian Fainelli wrote:
>> On 6/30/2024 4:36 PM, Stefan Wahren wrote:
>>> On resume of the Raspberry Pi the dwc2 driver fails to enable
>>> HCD_FLAG_HW_ACCESSIBLE before re-enabling the interrupts.
>>> This causes a situation where both handler ignore a incoming port
>>> interrupt and force the upper layers to disable the dwc2 interrupt line.
>>> This leaves the USB interface in a unusable state:
>>>
>>> irq 66: nobody cared (try booting with the "irqpoll" option)
>>> CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 6.10.0-rc3
>>> Hardware name: BCM2835
>>> Call trace:
>>> unwind_backtrace from show_stack+0x10/0x14
>>> show_stack from dump_stack_lvl+0x50/0x64
>>> dump_stack_lvl from __report_bad_irq+0x38/0xc0
>>> __report_bad_irq from note_interrupt+0x2ac/0x2f4
>>> note_interrupt from handle_irq_event+0x88/0x8c
>>> handle_irq_event from handle_level_irq+0xb4/0x1ac
>>> handle_level_irq from generic_handle_domain_irq+0x24/0x34
>>> generic_handle_domain_irq from bcm2836_chained_handle_irq+0x24/0x28
>>> bcm2836_chained_handle_irq from generic_handle_domain_irq+0x24/0x34
>>> generic_handle_domain_irq from generic_handle_arch_irq+0x34/0x44
>>> generic_handle_arch_irq from __irq_svc+0x88/0xb0
> A similar issue was reported for Agilex platforms back in 2021:
>
> https://lore.kernel.org/all/5e8cbce0-3260-2971-484f-fc73a3b2bd28@synopsys.com/
>
> It was fixed by commit 3d8d3504d233 ("usb: dwc2: Add platform specific
> data for Intel's Agilex"), which sets the no_clock_gating flag on that
> platform.
>
> Looking at drivers/usb/dwc2/params.c, numerous other platforms need
> the same flag.
>
> Please amend the commit message to mention the Agilex issue and
> resulting commit.
From my understanding Samsung noticed this issue at first and
introduced the no_clock_gating flag [1] and they referenced 0112b7ce68ea
("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.") as I did in
this patch. Later some platforms like Rockchip and Agilex followed.
Should i better refer to the Samsung bugfix instead of the Agilex bugfix?
>
>
>>> --- a/drivers/usb/dwc2/params.c
>>> +++ b/drivers/usb/dwc2/params.c
>>> @@ -23,6 +23,7 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg)
>>> p->max_transfer_size = 65535;
>>> p->max_packet_count = 511;
>>> p->ahbcfg = 0x10;
>>> + p->no_clock_gating = true;
>> Could we set this depending upon whether the dwc2 host controller is a
>> wake-up source for the system or not?
> The flag seems to mean whether the platform is actually capable of
> disabling the clock of the USB controller. BCM2835 seems to be
> incapable and as a result, even though dwc2_host_enter_clock_gating()
> is called, the chip signals interrupts.
That's why I was asking about this in the initial bug report. Since I
didn't get a reply, I submitted this workaround.
> There doesn't seem to be a relation to using the controller as a
> wakeup source, so your comment doesn't seem to make sense.
> If the clock can't be gated, the chip can always serve as a
> wakeup source.
I wouldn't conclude that the chip can always serve as a wakeup source
(e.g. power down the USB domain would also prevent this), but i agree
creating a relation between wakeup source and clock gating is a bad idea.
> The real question is whether BCM2848 platforms likewise cannot disable
> the clock of the dwc2 controller or whether this is specific to the
> BCM2835. Right now dwc2_set_bcm_params() is applied to both the
> BCM2848 and BCM2835. If the BCM2848 behaves differently in this
> regard, we'd have to duplicate dwc2_set_bcm_params() for the BCM2835.
From my understand BCM2848 refers to the same SoC, but the ACPI
implementation uses a different ID [2]. So I think this is safe.
>
> Thanks,
>
> Lukas
[1] -
https://lore.kernel.org/linux-usb/20210716050127.4406-1-m.szyprowski@samsung.com/
[2] -
https://patches.linaro.org/project/linux-usb/patch/20210413215834.3126447-2-jeremy.linton@arm.com/
next prev parent reply other threads:[~2024-07-05 10:23 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-30 15:36 [PATCH 00/11] ARM: bcm2835: Implement initial S2Idle for Raspberry Pi Stefan Wahren
2024-06-30 15:36 ` [PATCH 01/11] firmware: raspberrypi: Improve timeout warning Stefan Wahren
2024-07-04 14:10 ` Florian Fainelli
2024-06-30 15:36 ` [PATCH 02/11] mailbox: bcm2835: Fix timeout during suspend mode Stefan Wahren
2024-07-04 14:10 ` Florian Fainelli
2024-06-30 15:36 ` [PATCH 03/11] pmdomain: raspberrypi-power: Adjust packet definition Stefan Wahren
2024-07-04 14:11 ` Florian Fainelli
2024-06-30 15:36 ` [PATCH 04/11] pmdomain: raspberrypi-power: Avoid powering down USB Stefan Wahren
2024-06-30 15:36 ` [PATCH 05/11] irqchip/bcm2835: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND Stefan Wahren
2024-07-04 14:11 ` Florian Fainelli
2024-06-30 15:36 ` [PATCH 06/11] drm/vc4: hdmi: Handle error case of pm_runtime_resume_and_get Stefan Wahren
2024-07-02 13:48 ` Maxime Ripard
2024-07-02 19:46 ` Maíra Canal
2024-07-23 17:27 ` Stefan Wahren
2024-06-30 15:36 ` [PATCH 07/11] drm/vc4: hdmi: Disable connector status polling during suspend Stefan Wahren
2024-07-02 13:48 ` Maxime Ripard
2024-07-03 10:28 ` Stefan Wahren
2024-07-03 15:32 ` Stefan Wahren
2024-07-03 15:58 ` Dave Stevenson
2024-07-02 20:02 ` Peter Robinson
2024-07-04 16:25 ` Stefan Wahren
2024-06-30 15:36 ` [PATCH 08/11] usb: dwc2: debugfs: Print parameter no_clock_gating Stefan Wahren
2024-07-01 5:56 ` Minas Harutyunyan
2024-07-04 14:13 ` Florian Fainelli
2024-06-30 15:36 ` [PATCH 09/11] usb: dwc2: Skip clock gating on Broadcom SoCs Stefan Wahren
2024-07-01 5:56 ` Minas Harutyunyan
2024-07-04 14:14 ` Florian Fainelli
2024-07-04 15:33 ` Stefan Wahren
2024-07-05 8:48 ` Lukas Wunner
2024-07-05 10:22 ` Stefan Wahren [this message]
2024-07-05 15:03 ` Lukas Wunner
2024-07-05 15:21 ` Stefan Wahren
2024-07-05 17:16 ` Jeremy Linton
2024-07-05 21:14 ` Lukas Wunner
2024-07-10 13:33 ` Stefan Wahren
2024-07-10 15:50 ` Jeremy Linton
2024-06-30 16:53 ` [PATCH RFT 10/11] serial: 8250_bcm2835aux: add PM suspend/resume support Stefan Wahren
2024-07-04 14:12 ` Florian Fainelli
2024-07-04 15:40 ` Stefan Wahren
2024-06-30 17:19 ` [PATCH 11/11] ARM: bcm2835_defconfig: Enable SUSPEND Stefan Wahren
2024-07-04 14:13 ` Florian Fainelli
2024-07-02 20:08 ` [PATCH 00/11] ARM: bcm2835: Implement initial S2Idle for Raspberry Pi Peter Robinson
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=4502d826-d80c-4a98-a889-da7badfa698e@gmx.net \
--to=wahrenst@gmx.net \
--cc=airlied@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=daniel@ffwll.ch \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=hminas@synopsys.com \
--cc=jassisinghbrar@gmail.com \
--cc=jirislaby@kernel.org \
--cc=kernel-list@raspberrypi.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=pbrobinson@gmail.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=tglx@linutronix.de \
--cc=tzimmermann@suse.de \
--cc=ulf.hansson@linaro.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