All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: "Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Peng Fan" <peng.fan@nxp.com>,
	"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: [PATCH] soc: imx: Register SoC device only on i.MX boards
Date: Wed, 8 Dec 2021 20:30:24 +0800	[thread overview]
Message-ID: <20211208123024.GI4216@dragon> (raw)
In-Reply-To: <20211206113828.42523-1-stephan@gerhold.net>

On Mon, Dec 06, 2021 at 12:38:28PM +0100, Stephan Gerhold 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@nxp.com>
> Fixes: d2199b34871b ("ARM: imx: use device_initcall for imx_soc_device_init")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@mail.gmail.com/
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>

Applied, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Shawn Guo <shawnguo@kernel.org>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: "Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Peng Fan" <peng.fan@nxp.com>,
	"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: [PATCH] soc: imx: Register SoC device only on i.MX boards
Date: Wed, 8 Dec 2021 20:30:24 +0800	[thread overview]
Message-ID: <20211208123024.GI4216@dragon> (raw)
In-Reply-To: <20211206113828.42523-1-stephan@gerhold.net>

On Mon, Dec 06, 2021 at 12:38:28PM +0100, Stephan Gerhold 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@nxp.com>
> Fixes: d2199b34871b ("ARM: imx: use device_initcall for imx_soc_device_init")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@mail.gmail.com/
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>

Applied, thanks!

  parent reply	other threads:[~2021-12-08 12:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 11:38 [PATCH] soc: imx: Register SoC device only on i.MX boards Stephan Gerhold
2021-12-06 11:38 ` Stephan Gerhold
2021-12-06 11:58 ` Fabio Estevam
2021-12-06 11:58   ` Fabio Estevam
2021-12-06 12:23 ` Peng Fan
2021-12-06 12:23   ` Peng Fan
2021-12-08 12:30 ` Shawn Guo [this message]
2021-12-08 12:30   ` Shawn Guo

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=20211208123024.GI4216@dragon \
    --to=shawnguo@kernel.org \
    --cc=arnd@arndb.de \
    --cc=festevam@gmail.com \
    --cc=j.neuschaefer@gmx.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sebastian.reichel@collabora.com \
    --cc=stephan@gerhold.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.