From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 3/4] ARM: psci: client: always register OF fixup
Date: Tue, 1 Nov 2022 07:26:41 +0100 [thread overview]
Message-ID: <20221101062642.3207113-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20221101062642.3207113-1-a.fatoum@pengutronix.de>
We currently only register the device tree fixup if PSCI version in
device tree disagrees with version read from firmware. The barebox
PSCI DT version may differ from the kernel version though, so we
should rather run the fixup always. If the kernel has already an
up-to-date compatible, it won't change. But for cases where firmware is
expected to fill out the correct PSCI version, barebox will do what's
expected.
While at it, move the of_version logic together to make it easier
to follow.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/cpu/psci-client.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/cpu/psci-client.c b/arch/arm/cpu/psci-client.c
index 8e151177c2d7..218170dfa4ba 100644
--- a/arch/arm/cpu/psci-client.c
+++ b/arch/arm/cpu/psci-client.c
@@ -119,10 +119,6 @@ static int __init psci_probe(struct device_d *dev)
ulong of_version, actual_version;
int ret;
- ret = dev_get_drvdata(dev, (const void **)&of_version);
- if (ret)
- return -ENODEV;
-
ret = of_property_read_string(dev->device_node, "method", &method);
if (ret) {
dev_warn(dev, "missing \"method\" property\n");
@@ -139,6 +135,7 @@ static int __init psci_probe(struct device_d *dev)
}
+ of_version = (ulong)device_get_match_data(dev);
if (of_version < ARM_PSCI_VER(0,2)) {
version = of_version;
@@ -155,8 +152,7 @@ static int __init psci_probe(struct device_d *dev)
dev_info(dev, "detected version %u.%u\n",
version >> 16, version & 0xffff);
- if (actual_version != of_version)
- of_register_fixup(of_psci_do_fixup, &version);
+ of_register_fixup(of_psci_do_fixup, &version);
ret = poweroff_handler_register_fn(psci_poweroff);
if (ret)
--
2.30.2
next prev parent reply other threads:[~2022-11-01 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 6:26 [PATCH master 0/4] ARM: psci: client: unbreak hypervisor boot Ahmad Fatoum
2022-11-01 6:26 ` [PATCH master 1/4] ARM: psci: of: fixup only version if node already exists Ahmad Fatoum
2022-11-01 6:26 ` [PATCH master 2/4] ARM: psci: client: match most specific compatible first Ahmad Fatoum
2022-11-01 6:26 ` Ahmad Fatoum [this message]
2022-11-01 6:26 ` [PATCH master 4/4] ARM: psci: keep older PSCI versions in compatible fixup Ahmad Fatoum
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=20221101062642.3207113-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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