From: Stefan Wahren <wahrenst@gmx.net>
To: Russell King <linux@armlinux.org.uk>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Vinod Koul <vkoul@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Minas Harutyunyan <hminas@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Lukas Wunner <lukas@wunner.de>,
Peter Robinson <pbrobinson@gmail.com>,
linux-arm-kernel@lists.infradead.org,
kernel-list@raspberrypi.com,
bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-usb@vger.kernel.org,
Stefan Wahren <wahrenst@gmx.net>
Subject: [PATCH V4 0/9] ARM: bcm2835: Implement initial S2Idle for Raspberry Pi
Date: Thu, 24 Oct 2024 22:18:28 +0200 [thread overview]
Message-ID: <20241024201837.79927-1-wahrenst@gmx.net> (raw)
This series implement the initial S2Idle support for
the Raspberry Pi, which was a long time on my TODO list [1]. The
changes allow to suspend and resume the Raspberry Pi via debug UART.
The focus is on the BCM2835 SoC, because it's less complex than its
successors and have enough documentation.
Now the VC4 part has been split from the series [4], because of some issues
in that part.
Cherry-picking of patches should be fine.
Test steps:
- configure debug console (pl011 or mini UART) as wakeup source
- send system to idle state
echo freeze > /sys/power/state
- wakeup system by console traffic
The clock gating must be restored, because otherwise we have a
regression on Raspberry Pi 3 B+ . Luckily the disabling of clock gating
isn't necessary anymore. Thanks to the rest of the DWC2 patches which
based on an idea of Doug Anderson. The USB domain is now powered down
and the USB devices are still usable after resume. There might be room
for improvements, but at least the system won't freeze forever as before.
Here are some figures for the Raspberry Pi 1 (without any
devices connected except of a debug UART):
running but CPU idle = 1.67 W
S2Idle = 1.33 W
In comparison with HDMI & USB keyboard connected (but neither active
nor wakeup source):
running but CPU idle = 1.82 W
S2Idle = 1.33 W
The series has been successfully tested on the following platforms:
Raspberry Pi 1 B
Raspberry Pi 3 B+
Changes in V4:
- added Reviewed-by from Doug
- dropped applied VC4 improvement patches
- fix DWC2 register backup
- add revert because of Raspberry Pi 3B+ regression
- add suspend/resume support for DMA & eMMC to be on the safe side
Changes in V3:
- added Reviewed-by & Acked-by from Florian & Maíra
- dropped applied pmdomain & bcm2835aux patches
- address comments by Maíra (patch 3 & 5)
- replace old USB recovery patch with canary approach [3], which should
work with other platforms
Changes in V2:
- rebased against todays mainline
- added Reviewed-by from Florian
- added Acked-by from Minas
- dropped "irqchip/bcm2835: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND"
because it has been applied by Thomas Gleixner
- dropped "pmdomain: raspberrypi-power: Avoid powering down USB"
because this workaround has been replaced by patch 14
- use drm_err_once instead of DRM_ERROR and return connector_status_unknown
in patch 6
- add new patch in order to clean-up all DRM_ERROR
- add new patch to improve raspberrypi-power logging
- add new patch to simplify V3D clock retrieval
- add new patch 5 to avoid power down of wakeup devices
- add new patch 12 to avoid confusion about ACPI ID of BCM283x USB
- add new patch 8 & 10 which address the problem that HDMI
is not functional after s2idle
- add more links and fix typo in patch 13
- add new WIP patch 14 which recover DWC2 register after power down
- take care of UART clock in patch 15 as commented by Florian
- use SYSTEM_SLEEP_PM_OPS in patch 15
[1] - https://github.com/lategoodbye/rpi-zero/issues/9
[2] - https://bugzilla.redhat.com/show_bug.cgi?id=2283978
[3] - https://lore.kernel.org/linux-usb/CAD=FV=W7sdi1+SHfhY6RrjK32r8iAGe4w+O_u5Sp982vgBU6EQ@mail.gmail.com/
[4] - https://lore.kernel.org/dri-devel/20241003124107.39153-1-wahrenst@gmx.net/
Stefan Wahren (9):
Revert "usb: dwc2: Skip clock gating on Broadcom SoCs"
dmaengine: bcm2835-dma: add suspend/resume pm support
mmc: bcm2835: Fix type of current clock speed
mmc: bcm2835: Introduce proper clock handling
mmc: bcm2835: add suspend/resume pm support
usb: dwc2: gadget: Introduce register restore flags
usb: dwc2: Refactor backup/restore of registers
usb: dwc2: Implement recovery after PM domain off
ARM: bcm2835_defconfig: Enable SUSPEND
arch/arm/configs/bcm2835_defconfig | 2 -
drivers/dma/bcm2835-dma.c | 30 ++++++++
drivers/mmc/host/bcm2835.c | 56 +++++++++++---
drivers/usb/dwc2/core.c | 1 +
drivers/usb/dwc2/core.h | 23 +++++-
drivers/usb/dwc2/gadget.c | 116 +++++++++++++++--------------
drivers/usb/dwc2/hcd.c | 99 ++++++++++++------------
drivers/usb/dwc2/params.c | 1 -
drivers/usb/dwc2/platform.c | 38 ++++++++++
9 files changed, 245 insertions(+), 121 deletions(-)
--
2.34.1
next reply other threads:[~2024-10-24 20:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 20:18 Stefan Wahren [this message]
2024-10-24 20:18 ` [PATCH 1/9] Revert "usb: dwc2: Skip clock gating on Broadcom SoCs" Stefan Wahren
2024-10-24 20:18 ` [PATCH 2/9] dmaengine: bcm2835-dma: add suspend/resume pm support Stefan Wahren
2024-10-24 20:18 ` [PATCH 3/9] mmc: bcm2835: Fix type of current clock speed Stefan Wahren
2024-10-24 20:18 ` [PATCH 4/9] mmc: bcm2835: Introduce proper clock handling Stefan Wahren
2024-10-24 20:18 ` [PATCH 5/9] mmc: bcm2835: add suspend/resume pm support Stefan Wahren
2024-10-24 20:18 ` [PATCH 6/9] usb: dwc2: gadget: Introduce register restore flags Stefan Wahren
2024-10-24 20:18 ` [PATCH 7/9] usb: dwc2: Refactor backup/restore of registers Stefan Wahren
2024-10-24 20:18 ` [PATCH 8/9] usb: dwc2: Implement recovery after PM domain off Stefan Wahren
2024-10-24 20:18 ` [PATCH 9/9] ARM: bcm2835_defconfig: Enable SUSPEND Stefan Wahren
2024-10-24 20:21 ` [PATCH V4 0/9] ARM: bcm2835: Implement initial S2Idle for Raspberry Pi Stefan Wahren
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=20241024201837.79927-1-wahrenst@gmx.net \
--to=wahrenst@gmx.net \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dmaengine@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=hminas@synopsys.com \
--cc=kernel-list@raspberrypi.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lukas@wunner.de \
--cc=pbrobinson@gmail.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=ulf.hansson@linaro.org \
--cc=vkoul@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