Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1114064ybt; Thu, 18 Jun 2020 00:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0RuRveQtoU0gn7kW8dKccrDmtWO2Aj07AmY/XW1RQjht6iKpfs6ESRXehPy9TA5MvBgsH X-Received: by 2002:a17:906:470b:: with SMTP id y11mr2813490ejq.182.1592465130687; Thu, 18 Jun 2020 00:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592465130; cv=none; d=google.com; s=arc-20160816; b=m9PV9PuZndgJPjjLvmerpFMijsPcWKb5XYqQ09p+8t2IPkws07+oruLI9aIX3eF1eW oRdjGn0hL0zoCxal8IhWQmSi0qu/KBdNeAJ8TWM3T4g0TAqOghGFBGly1Kmvk2IDg/W1 05RsXeBoz0gt7tvB5n+nvqFkNjRqyHkZZeX7Dvh/ydD14sTBVB8brCtza3H2Jti1Xpev tUgUGVFWE9ZQS0DRsr2TxAFtYwZEpGCu6bq2TG1gMg96jukoCDWN/tNkhNeVmrVEXeei zcSb3jEZtm42CcXUT+cAMFiNUiXTdzvv9nwiATD8Q2i2woc5xbLGjN0tdCLviT8O3EZ0 hPVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=g5sMtijziIXwnq9gV4HrV5CQZB2MV8UKZ/5dQnwbCkA=; b=duNieON//8y10bpBcCeMXBsvT375gw7NZPVsYGWu9byERk3MqtAtvLW6BKB9gV8JHn Tqof0N4ctWzE/79WefvhLKnqbNx+PJWWlgxO0BguCcE8FhU0p1eRTzfcwERiJ++KvHRo /bbdH6n90fkr0wnmJLEpWw7n2oL6lmhbBX+8AdAWF+uPqaEZ1PgYhk4TFuEaHfPbIG3A srInns/JSRNizyvT0NDlaBsrAeU6RUpABLdzRnNUUrc6JM6SSgtO74B+g9ajLGgFKsNJ YKxi213HVATrUQYXQOfIxnskyzTDZhGxnYm0fXcC4+fKy/IPjdtKtsBzUc9gf5luQPrZ TE0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si1463906edq.299.2020.06.18.00.25.07; Thu, 18 Jun 2020 00:25:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbgFRHVM (ORCPT + 99 others); Thu, 18 Jun 2020 03:21:12 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:36211 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbgFRHVL (ORCPT ); Thu, 18 Jun 2020 03:21:11 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1Mq2vU-1j7pP513qM-00nBZC for ; Thu, 18 Jun 2020 09:21:09 +0200 Received: by mail-qt1-f181.google.com with SMTP id v19so1219861qtq.10 for ; Thu, 18 Jun 2020 00:21:09 -0700 (PDT) X-Gm-Message-State: AOAM532e+QKVC3mrrWSKnlFNQ7oH+KWRV1DYSPkKcqQK8MSIUBSa6D7l ugjq8U9n5dEliVAfVJ1abp80i62CvjziJRf/C/U= X-Received: by 2002:ac8:7417:: with SMTP id p23mr3048812qtq.204.1592464868127; Thu, 18 Jun 2020 00:21:08 -0700 (PDT) MIME-Version: 1.0 References: <1592369623-10723-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 18 Jun 2020 09:20:52 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] soc: imx-scu: Support module build To: Anson Huang Cc: Aisheng Dong , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , Peng Fan , Leonard Crestez , "krzk@kernel.org" , Daniel Baluta , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:ZyQynNmYvlOC2TyBDj7V1T5SOx7MS8SCgIOcJqy3h4eX4fBoKM8 Gmxm4y5mEaO1Y3mMSM/AKkJpsq7N8OLwZ76qn6TQbvwgLRQsDDCmPgVxeSo0FUyvKB5ilbQ zsa06YWn8GLava34X17UXh0DIa6vwLTLOYOAtzxRA78ipzWDh2W12Vix3gZ/xCovsxddK31 czcGds9Ycpmcknxsdeqig== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:x/gm8/irSGM=:GuMZgqwOvNlvtBUnB/TYXf MrP9OOT5XZRu/0YmZkQqWzw9Dy962CiOzQCUh/3ZflrUAg52264hhAraKM6c4llDBJAmKc5fF qqItK6Dc1MGDUjT4IlVP+uP2+MCPAjwtH8MHyohzaDeLQiqhQUkueD4l4xuMkPjnDi4+MKJ3o t3Po2B23v/LTwbfMhCYNlkdvGUlvK+8SIRdxN7fRbK91Ajzqi/vcNBkq2gUnJnvpVOhTGdbZw Odzs7F1A+aRMEWqnYKoHxw05wflnvgdOannPLbODn67yu4ZiS2BJxnrfIpl/LV7zKCXPbTGQn kHA6BNOLIsvppeN0iiG6OfjQM4qTp12KsSdtyzeTfbzyw2Aca9GV8D9DlMz4FsJgMf7OqFbcf t9MR7suHRdYKQLbP3tfAg0k2wcEeCwlOTMvQx8OZ2TEkEd7JhAESERUJVpJuKA4W6dVeCj7Hw fx7yE90sAmZUtRtI3anT0hmGnanTQrT0xm2hU/dA5pOlIhM/f+AK8Hjt1ugHDual8DepkGL85 gnUvgu3w7t+5rMt0lvGWu8syOEPE19GwLg6gYEl1wytMRScAG6T4BT0Q1OB4NQ4n/PcOvbIvV Na6CNIkiF2WNwMlUQc50x+qO7GFHlAtm7EBts7YoE79lfVrwrtdnXvDnDmtUGc/yjAg03jNaF 3Mcfmdzlin8ZlJ+jRTPhoSEoX72n7U4oHatPthB7jj15GjBzGF4+UbX2jJlRGcQGTQHDMmwai PczGpd48oiGdnYvGsjJTbhBsInpO6csa5fTt1TiI+eQgUFfGYT33cQ/5XvjVfl381fKKjJ01D TGkTWLPv1la3McnVMfn6o3eIsBO84/szyPkXtnlK5t6TCEeMv0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 17, 2020 at 11:41 AM Anson Huang wrote: > > > > > > I'm ok with the change. But I'm curious how can this module be > > > autoloaded without MODULE_DEVICE_TABLE. > > > Have you tested if it can work? > > > > > > > I ONLY tested the manual insmod, if want to support auto load, may need > > some more change, will try it later and send out a V2 if needed. > > The further check shows that, if want to support auto load, the platform device > register needs to be done in somewhere else which is built-in (in my test, I move it > to clk-imx8qxp.c's probe), and also need to add below module alias in this driver, > because it has no device node in DT and no device table in driver. > > +MODULE_ALIAS("platform:imx-scu-soc"); > > Since this driver has no device node in DT, and the target is to build all SoC specific > drivers as module, so the best way is to add a virtual device node in DT in order to support > auto load? I see that there is indeed a driver for the device node in drivers/firmware/imx/imx-scu.c, the only reason for this module using device_initcall() with a manual platform_device_register_simple() seems to be that we cannot have two platform drivers bind to the same device node. I think a cleaner way to handle this would be to just move the entire soc driver into the firmware driver and then remove the duplication. Arnd