sandbox: fix cpu property in test.dts for pytest
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 27 Aug 2019 08:17:03 +0000 (17:17 +0900)
committerSimon Glass <sjg@chromium.org>
Tue, 15 Oct 2019 14:40:02 +0000 (08:40 -0600)
When I tried to run some new efi tests with pytest, efi_smbios_register()
triggered a segmentation fault. Here is the location where it happened:
efi_init_obj_list()
  efi_smbios_register()
    write_smbios_table()
      smbios_write_type4()
        smbios_write_type4_dm()

where dev_get_parent_platdata() should return a pointer to struct
cpu_platdata, but it is actually NULL because any cpu device on
sandbox is attached to "root_driver."

With this patch, this issue will be fixed by moving all the definitions
of cpus under "cpus" node so that they have a "cpu_bus" parent.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/dts/test.dts

index 5d9ab3724ff8e966547dcdb8be06a71720c61089..42b41fbf62619e4e823b83a9de92b27fb25e95a1 100644 (file)
                mbox-names = "other", "test";
        };
 
-       cpu-test1 {
-               compatible = "sandbox,cpu_sandbox";
-               u-boot,dm-pre-reloc;
-       };
+       cpus {
+               cpu-test1 {
+                       compatible = "sandbox,cpu_sandbox";
+                       u-boot,dm-pre-reloc;
+               };
 
-       cpu-test2 {
-               compatible = "sandbox,cpu_sandbox";
-               u-boot,dm-pre-reloc;
-       };
+               cpu-test2 {
+                       compatible = "sandbox,cpu_sandbox";
+                       u-boot,dm-pre-reloc;
+               };
 
-       cpu-test3 {
-               compatible = "sandbox,cpu_sandbox";
-               u-boot,dm-pre-reloc;
+               cpu-test3 {
+                       compatible = "sandbox,cpu_sandbox";
+                       u-boot,dm-pre-reloc;
+               };
        };
 
        i2s: i2s {