diff mbox

[U-Boot] x86: Set APs' req_seq to the reg number from device tree

Message ID 1439189919-12396-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Aug. 10, 2015, 6:58 a.m. UTC
Multiple APs are brought up simultaneously and they may get the same
seq num in the uclass_resolve_seq() during device_probe(). To avoid
this, set req_seq to the reg number in the device tree in advance.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/cpu/mp_init.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Simon Glass Aug. 10, 2015, 12:58 p.m. UTC | #1
On 10 August 2015 at 00:58, Bin Meng <bmeng.cn@gmail.com> wrote:
> Multiple APs are brought up simultaneously and they may get the same
> seq num in the uclass_resolve_seq() during device_probe(). To avoid
> this, set req_seq to the reg number in the device tree in advance.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/cpu/mp_init.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Aug. 14, 2015, 4:49 p.m. UTC | #2
On 10 August 2015 at 06:58, Simon Glass <sjg@chromium.org> wrote:
> On 10 August 2015 at 00:58, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Multiple APs are brought up simultaneously and they may get the same
>> seq num in the uclass_resolve_seq() during device_probe(). To avoid
>> this, set req_seq to the reg number in the device tree in advance.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  arch/x86/cpu/mp_init.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
index 3294a50..4334f5b 100644
--- a/arch/x86/cpu/mp_init.c
+++ b/arch/x86/cpu/mp_init.c
@@ -515,5 +515,12 @@  int mp_init(struct mp_params *p)
 
 int mp_init_cpu(struct udevice *cpu, void *unused)
 {
+	/*
+	 * Multiple APs are brought up simultaneously and they may get the same
+	 * seq num in the uclass_resolve_seq() during device_probe(). To avoid
+	 * this, set req_seq to the reg number in the device tree in advance.
+	 */
+	cpu->req_seq = fdtdec_get_int(gd->fdt_blob, cpu->of_offset, "reg", -1);
+
 	return device_probe(cpu);
 }