From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F2B8C433F5 for ; Mon, 6 Dec 2021 11:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PbfVemBRrkvRAuLE29VidIUpJkwB4bKbEpjL5u74s7o=; b=rUyXO99KA7VWJa MhpGwOyzvc6WqkMd3tRUGH/ggJk0l4gaX+JGVJTkVK3xlTLAcRAjRO8aWi33GsBIeE4/+BSr+dC8W 37hvAkuH5aButjln8yrbk1EzeIPLcCFH8JYPwiq+87HnWW/lXqzJyJ+Q8xsYuybKWn9RUVF0CREIs n04Lw1cTnYS5JIJcg0YYspgkV0ToDXZvCrozaON3ikBJDQ5alckG6aQsOScyy/zJwbw7W7fkOSHDa /Q+Sx6hCFTn/3ip7orfr/xQ6U8LeqzixJuL6jOtXJG7hK5cLNYxELRin0in/mH+OOPDFCWAepQqMn PmjYSHXa15Q1jeN5RdIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muCMP-003bRP-GB; Mon, 06 Dec 2021 11:40:45 +0000 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.51]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muCML-003bQY-3n for linux-arm-kernel@lists.infradead.org; Mon, 06 Dec 2021 11:40:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1638790832; s=strato-dkim-0002; d=gerhold.net; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=VjRF/8qBPCLb+EzO9JtX3LOx1wqS7Q+1A9+Qj2blz/M=; b=BHVhZvnlXHC2aUa2woZKMgaQNJ+IvWS+nPIbyA52ffZ2JzArh5P9mnnBYZUvG7Tpdz 8m+g4h3XYjou85B88psxPJjT5AYUWMf/HfQPII0PHQZfZYnT7VXv2ziOud5lej0rpWND e+bl66k2FHJy5Vz8hrPPPnFMDrBQgIA+2i3CjYgjnWXWlJYmJnHlGUpu5gl5+40ahcbf aKIL88kVobT4IHCHyxVFn7EfG9Qz0+qcXXIYYOWIim3bYwec1CFeT5amsipA/btIQq5x yTHngVIkqpSjgzpJjGKJMrGedO5jTKgcGvVIBbTGeZXltCzJ0fCNnf/wLDHd8nJ3dy22 SFuQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXQ7UOGqRde+a0fyL2mYw2" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.34.10 AUTH) with ESMTPSA id j03bcbxB6BeV8H5 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 6 Dec 2021 12:40:31 +0100 (CET) From: Stephan Gerhold To: Shawn Guo Cc: Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Sebastian Reichel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stephan Gerhold , Peng Fan , Arnd Bergmann Subject: [PATCH] soc: imx: Register SoC device only on i.MX boards Date: Mon, 6 Dec 2021 12:38:28 +0100 Message-Id: <20211206113828.42523-1-stephan@gerhold.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_034041_395347_CDF74319 X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Fixes: d2199b34871b ("ARM: imx: use device_initcall for imx_soc_device_init") Reported-by: Arnd Bergmann Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@mail.gmail.com/ Signed-off-by: Stephan Gerhold --- drivers/soc/imx/soc-imx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/soc/imx/soc-imx.c b/drivers/soc/imx/soc-imx.c index ac6d856ba228..77bc12039c3d 100644 --- a/drivers/soc/imx/soc-imx.c +++ b/drivers/soc/imx/soc-imx.c @@ -36,6 +36,10 @@ static int __init imx_soc_device_init(void) int ret; int i; + /* 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; -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel