[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5A09BDOuEbmWJVD_5d=E6wSf3YcCf0=EkB-B2wWR0r52Q@mail.gmail.com>
Date: Mon, 6 Dec 2021 08:58:13 -0300
From: Fabio Estevam <festevam@...il.com>
To: Stephan Gerhold <stephan@...hold.net>
Cc: Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
NXP Linux Team <linux-imx@....com>,
Jonathan Neuschäfer <j.neuschaefer@....net>,
Sebastian Reichel <sebastian.reichel@...labora.com>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Peng Fan <peng.fan@....com>, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH] soc: imx: Register SoC device only on i.MX boards
On Mon, Dec 6, 2021 at 8:40 AM Stephan Gerhold <stephan@...hold.net> wrote:
>
> 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@....com>
> Fixes: d2199b34871b ("ARM: imx: use device_initcall for imx_soc_device_init")
> Reported-by: Arnd Bergmann <arnd@...db.de>
> Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@mail.gmail.com/
> Signed-off-by: Stephan Gerhold <stephan@...hold.net>
Reviewed-by: Fabio Estevam <festevam@...il.com>
Powered by blists - more mailing lists