Patch "soc: imx: Register SoC device only on i.MX boards" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    soc: imx: Register SoC device only on i.MX boards

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     soc-imx-register-soc-device-only-on-i.mx-boards.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3b40bf76152b050f80dfd556c355d9288dfdac29
Author: Stephan Gerhold <stephan@xxxxxxxxxxx>
Date:   Mon Dec 6 12:38:28 2021 +0100

    soc: imx: Register SoC device only on i.MX boards
    
    [ Upstream commit 4ebd29f91629e69da7d57390cdc953772eee03ab ]
    
    At the moment, using the ARM32 multi_v7_defconfig always results in two
    SoCs being exposed in sysfs. This is wrong, as far as I'm aware the
    Qualcomm DragonBoard 410c does not actually make use of a i.MX SoC. :)
    
      qcom-db410c:/sys/devices/soc0$ grep . *
      family:Freescale i.MX
      machine:Qualcomm Technologies, Inc. APQ 8016 SBC
      revision:0.0
      serial_number:0000000000000000
      soc_id:Unknown
    
      qcom-db410c:/sys/devices/soc1$ grep . *
      family:Snapdragon
      machine:APQ8016
      ...
    
    This happens because imx_soc_device_init() registers the soc device
    unconditionally, even when running on devices that do not make use of i.MX.
    Arnd already reported this more than a year ago and even suggested a fix
    similar to this commit, but for some reason it was never submitted.
    
    Fix it by checking if the "__mxc_cpu_type" variable was actually
    initialized by earlier platform code. On devices without i.MX it will
    simply stay 0.
    
    Cc: Peng Fan <peng.fan@xxxxxxx>
    Fixes: d2199b34871b ("ARM: imx: use device_initcall for imx_soc_device_init")
    Reported-by: Arnd Bergmann <arnd@xxxxxxxx>
    Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@xxxxxxxxxxxxxx/
    Signed-off-by: Stephan Gerhold <stephan@xxxxxxxxxxx>
    Reviewed-by: Fabio Estevam <festevam@xxxxxxxxx>
    Reviewed-by: Peng Fan <peng.fan@xxxxxxx>
    Signed-off-by: Shawn Guo <shawnguo@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/soc/imx/soc-imx.c b/drivers/soc/imx/soc-imx.c
index 01bfea1cb64a8..1e8780299d5c4 100644
--- a/drivers/soc/imx/soc-imx.c
+++ b/drivers/soc/imx/soc-imx.c
@@ -33,6 +33,10 @@ static int __init imx_soc_device_init(void)
 	u32 val;
 	int ret;
 
+	/* Return early if this is running on devices with different SoCs */
+	if (!__mxc_cpu_type)
+		return 0;
+
 	if (of_machine_is_compatible("fsl,ls1021a"))
 		return 0;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux