Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Commit

Permalink
Add kexec display fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxThePenguin0 committed Oct 6, 2020
1 parent bd21766 commit 818c02b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
48 changes: 48 additions & 0 deletions 0001-pwm-rockchip-Keep-enabled-PWMs-running-while-probing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 7599750a79d17f2554abb71a95dd724f5e9efa57 Mon Sep 17 00:00:00 2001
From: Simon South <[email protected]>
Date: Fri, 18 Sep 2020 13:51:46 -0400
Subject: [PATCH] pwm: rockchip: Keep enabled PWMs running while probing

Following commit cfc4c18 ("pwm: Read initial hardware state at request
time") the Rockchip PWM driver can no longer assume a device's state
information has been populated after a call to pwmchip_add().
Consequently, the test in rockchip_pwm_probe() intended to prevent the
driver from stopping PWM devices already enabled by the bootloader no
longer functions reliably and can lead to the kernel hanging during
startup.

With this change the driver explicitly fetches the state of a device
before attempting to determine whether or not it is enabled, fixing
this issue.

Signed-off-by: Simon South <[email protected]>
---
drivers/pwm/pwm-rockchip.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index eb8c9cb64..098e94335 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -288,6 +288,7 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
const struct of_device_id *id;
struct rockchip_pwm_chip *pc;
struct resource *r;
+ u32 enable_conf, ctrl;
int ret, count;

id = of_match_device(rockchip_pwm_dt_ids, &pdev->dev);
@@ -362,7 +363,9 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
}

/* Keep the PWM clk enabled if the PWM appears to be up and running. */
- if (!pwm_is_enabled(pc->chip.pwms))
+ enable_conf = pc->data->enable_conf;
+ ctrl = readl_relaxed(pc->base + pc->data->regs.ctrl);
+ if ((ctrl & enable_conf) != enable_conf)
clk_disable(pc->clk);

return 0;
--
2.28.0

3 changes: 3 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ makedepends=('clang>=11.0.0' 'llvm>=11.0.0' 'lld>=11.0.0' 'xmlto' 'docbook-xsl'
options=('!strip')
source=("http://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar.xz"
"http://www.kernel.org/pub/linux/kernel/v5.x/patch-${pkgver}.xz"
'0001-pwm-rockchip-Keep-enabled-PWMs-running-while-probing.patch'
'0004-tty-serdev-support-shutdown-op.patch'
'0005-bluetooth-hci_serdev-Clear-registered-bit-on-unregis.patch'
'0006-bluetooth-hci_bcm-disable-power-on-shutdown.patch'
Expand All @@ -37,6 +38,7 @@ source=("http://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar.xz"
'90-linux.hook')
md5sums=('0e5c4c15266218ef26c50fac0016095b'
'1f276bf9d1bc12215179a4681c29a573'
'698946c973f5a4adbef281d760c478bd'
'11e653f50135c1e9fa703118fa7f2623'
'05c7919f7fc1019e99e6965559bde5d5'
'894a88a9579b22c22747b1748f181bb9'
Expand All @@ -61,6 +63,7 @@ prepare() {
# add upstream patch
patch -Np1 -i "${srcdir}/patch-${pkgver}"

patch -Np1 -i "${srcdir}/0001-pwm-rockchip-Keep-enabled-PWMs-running-while-probing.patch"
patch -Np1 -i "${srcdir}/0004-tty-serdev-support-shutdown-op.patch"
patch -Np1 -i "${srcdir}/0005-bluetooth-hci_serdev-Clear-registered-bit-on-unregis.patch"
patch -Np1 -i "${srcdir}/0006-bluetooth-hci_bcm-disable-power-on-shutdown.patch"
Expand Down

0 comments on commit 818c02b

Please sign in to comment.