mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH master v2 2/2] ARM: psci: client: don't hardcode method smc in fixup
Date: Sat,  5 Nov 2022 13:11:54 +0100	[thread overview]
Message-ID: <20221105121154.3716964-2-ahmad@a3f.at> (raw)
In-Reply-To: <20221105121154.3716964-1-ahmad@a3f.at>

When barebox is booted as QEMU -kernel, PSCI will have method = "hvc",
because QEMU will act as Hypervisor. barebox handles this correctly and
will use hvc instead of smc, but of_psci_fixup() always fixes up
method = "smc" thereby breaking kernel boot.

Fix this by forwarding the method read from barebox DT into the kernel
DT.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
v1 -> v2:
  - instead of avoiding fixup, just do it with the method read from DT
  - Drop the other patches. There are nice to have, but can follow
    later
---
 arch/arm/cpu/psci-client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/psci-client.c b/arch/arm/cpu/psci-client.c
index 613280ad3f23..f9b1c684bfe5 100644
--- a/arch/arm/cpu/psci-client.c
+++ b/arch/arm/cpu/psci-client.c
@@ -108,9 +108,9 @@ static u32 invoke_psci_fn_smc(ulong function, ulong arg0, ulong arg1, ulong arg2
 	return res.a0;
 }
 
-static int of_psci_do_fixup(struct device_node *root, void *context)
+static int of_psci_do_fixup(struct device_node *root, void *method)
 {
-	return of_psci_fixup(root, *(u32 *)context, "smc");
+	return of_psci_fixup(root, version, (const void *)method);
 }
 
 static int __init psci_probe(struct device_d *dev)
@@ -156,7 +156,7 @@ static int __init psci_probe(struct device_d *dev)
 		 version >> 16, version & 0xffff);
 
 	if (actual_version != of_version)
-		of_register_fixup(of_psci_do_fixup, &version);
+		of_register_fixup(of_psci_do_fixup, (void *)method);
 
 	ret = poweroff_handler_register_fn(psci_poweroff);
 	if (ret)
-- 
2.37.2




  reply	other threads:[~2022-11-05 12:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05 12:11 [PATCH master v2 1/2] ARM: psci: make PSCI method a of_psci_fixup parameter Ahmad Fatoum
2022-11-05 12:11 ` Ahmad Fatoum [this message]
2022-11-07  7:48 ` Sascha Hauer

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=20221105121154.3716964-2-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --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