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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8D1AC433F4 for ; Thu, 16 Jul 2020 14:39:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78A0E206F4 for ; Thu, 16 Jul 2020 14:39:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d+rAeSCk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="cnXmhDmS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78A0E206F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CT6cM0L8cstabmvv8nDkIREOPhsjL/vp8R+aKxSo3Ns=; b=d+rAeSCkfRTfBy5IbTfvxOkae Z4m7iQW4aGSx4Ag5oOh6+btQDaeBPGbMPWaCTm1Q+xAQAxnmYPe/7jXdSV1OKS/2MEUyQRkCneYwr qD5WUiqKN9Zfz8H5hCQ0s4y5jOghDHkaxakMwCdLx6So6nQXNk58qRu1pJsnaiG5uww0JztRayxLS yy7ZOnadLjKYeMbsd0j3iOIFPW70kE+zq/pGQonleaz4ptueiH7iIEOfmcFpzATsC39qdpGEBQjsa Qgt6Sgzq9UWNiQrCuzkTKCFNT8smW7yVUDBIINImS19Jc76IaohOhfpq+fdDXVfL0Ldi0geLjmyYi fhKDW3srA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw51R-0000UA-8z; Thu, 16 Jul 2020 14:38:05 +0000 Received: from mail-db8eur05on2061.outbound.protection.outlook.com ([40.107.20.61] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw51O-0000T6-Fr for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 14:38:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A8BQAOfnv/OGU/4FC+R9X+Ed2eoS9p796qYQg5wdslCHwJKRqbt4paHa7yxdht5t5G8ETPMWBUe4/FzN6ciFe6tRtv4i2u6Oelm1DDG6aAYZWX0DM6xsPfiu/14b8QzFEVY9m5mpoCccYjeGm6OLZd2juAs7dTMdEZmO168k1//f7GcSTePLTfinaLzYZS6MbdZgUi9BSoFyXoUEqvyOpi9rEn/k5rxckKr08vOvp0MgNf2DKwmTLc0adom/maTWbaSU2/lGeXsESzOTxfBeLDxzw2BKZq7/VDGuS0c1pr8dZ60hyBDitbFqq6zk9Baq4AQU9ZrrL1PxaaywBF+fig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NGxpOVs6/426bwNLfUyrglEQ6BY4pY7tw9959vo3yKE=; b=aTLtiqS2OO3ZborPUPfKDSCyD4WQCxc7jDsjvYwTKtEDjTllnx+9iEa+xKZTYSApurEyXzrvugDXVIqN/kISdGZ6z1oyuQSuzN1o7MbzBAPPoZAdKQGSjcLK8WXMj05/Cistxb7xmPz9whLJQamgNmRROTTvkUBxJvSHtvgeGvPwvFzOjJvA9EmQC0y6hbg0Qmnx0U1wLC3g2K2DlQRpqY5M4Zc2cFJneHkbNvCkXXTJ4Ka9G4PoqkIoO0Nca9fgD1CPD8rDSoR9qjnQvQrB1xX4RBFNC7irc1RSL9RG1BBMJdXnq2Sowtx/t0iYZNQCbVIWet7MbQNrKYeus86SJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NGxpOVs6/426bwNLfUyrglEQ6BY4pY7tw9959vo3yKE=; b=cnXmhDmSfNf+WErcesKpiVRycDuWu/dHhrzZuKGP/p97T3PPOE7QBqzCvQf37HF6crAe5N+WDmmyx1OnOWj02WSHri9beE2wsbvU8LWnvwXR2s+mEVdQjo8Q/kmXBiih/wdoBnaRzW+8UkUANUCIYTaE1bqXH/c4XzexpI2G6l8= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) by DB8PR04MB5660.eurprd04.prod.outlook.com (2603:10a6:10:a5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Thu, 16 Jul 2020 14:37:57 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::1dab:b68c:e028:acb3]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::1dab:b68c:e028:acb3%6]) with mapi id 15.20.3174.026; Thu, 16 Jul 2020 14:37:57 +0000 From: Anson Huang To: Linus Walleij Subject: RE: [PATCH 1/3] gpio: mxc: Support module build Thread-Topic: [PATCH 1/3] gpio: mxc: Support module build Thread-Index: AQHWVLZdNtvAex5vSUmx57p8ya+LG6kC6AIAgABGglCABMrXcIACTpaAgAAKSKA= Date: Thu, 16 Jul 2020 14:37:57 +0000 Message-ID: References: <1594164323-14920-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [183.192.22.28] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ad5800b5-a655-494d-6809-08d82995d51b x-ms-traffictypediagnostic: DB8PR04MB5660: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VtC3eK7P+1RjX714oefvDu9SxqXPzBQ2+31ABS5IGAI5YHRgeJN6wtZkG/hAiZ+Fw+eLbeTWNFtuGF/WQ8vq2eFbs/m5lgp4JK1YKlLZdWliL7Epj89hoP4pOSuQEsS/UKDCcs+YOuvIgW474CaacVyFAQUsj93fAUrS/fCqxlLP1+ARrjmgG04GarQNJ1I9teTqS+ioAuW4rw6G6C47+jZYEAW4tmQeEuyqR0Wyi6gtNizN526IQjqKid5jOIbejfotSegxKJLn7FMw7x/lTHeu7YklJYRNhKs7PusnMzkap8Klc9hTvRsXdPuaonKL+n5eTaO/r2DO9me/J1e0Pg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB3PR0402MB3916.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(376002)(136003)(396003)(39860400002)(346002)(5660300002)(186003)(7416002)(52536014)(53546011)(66946007)(86362001)(6506007)(66556008)(2906002)(6916009)(8676002)(478600001)(64756008)(66446008)(7696005)(8936002)(316002)(4326008)(26005)(44832011)(9686003)(71200400001)(33656002)(76116006)(66476007)(54906003)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: dANe9wGxaB2ZOCletPCDF8m21x2zs6X1OlEjormgT8sahFkToFNZEo0+s0g++DpJt87gDoCUj+OEgToaW8VnuJXENE5cGw7Gns2xPXn76IYoVk/6EmHoPolxoB8pTUCvcI0NU9ZhXfZ8NjUR3NrGsWB/MLuKBYRVPkCanarMegmYbqVdtUgzTtzKrOKx2pf1glI0JpcTJy6k648Xo1IUuia/0x4+WOMzlsNcB9gGKAiMytMMDMIdi5s6SVWzwf/QtuZOziisM6Zt6JvDwZxKP/r0rJAgPCMB9mJCAlg5VvZ0TfA/qfwtB/nxiYKgkA5EQpwBZrQM2cdBET/TCJTklJQdG62al+98kX2qRf82bJvvME2vSPiAVlpJ1sf19QLB5kHggTH95CnK9hh57Fbvjn6nxSEn5BizP6i4U2qGfl4ieXL1cYlc/gPenD0yRClhJG15WOlqtlAsSIoVLIiPwq14x5ckGK5vXXnemDEF0fBfpdW6gWj5IfGmePXpB3Jp MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB3PR0402MB3916.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad5800b5-a655-494d-6809-08d82995d51b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2020 14:37:57.4384 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: P57xHv6wLzEXwATDCAV8gIno6FTG8zXIm/egoYeulnnFTKJCU89sAx8HEigm9Nr39wiTUhcgWnojaz2d/GJeuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5660 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_103802_654678_C6AECD8E X-CRM114-Status: GOOD ( 30.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-kernel@vger.kernel.org" , Geert Uytterhoeven , Will Deacon , "open list:GPIO SUBSYSTEM" , Shawn Guo , Sascha Hauer , Olof Johansson , Russell King , Bjorn Andersson , "oleksandr.suvorov@toradex.com" , Bartosz Golaszewski , Vinod Koul , Andreas Kemnade , dl-linux-imx , Sascha Hauer , Catalin Marinas , Adam Ford , Leo Li , Fabio Estevam , Linux ARM , "hverkuil-cisco@xs4all.nl" 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 Hi, Linus > Subject: Re: [PATCH 1/3] gpio: mxc: Support module build > > On Wed, Jul 15, 2020 at 4:44 AM Anson Huang > wrote: > > > > Subject: RE: [PATCH 1/3] gpio: mxc: Support module build > > > > > > Hi, Linus > > > > > > > Subject: Re: [PATCH 1/3] gpio: mxc: Support module build > > > > > > > > On Wed, Jul 8, 2020 at 1:28 AM Anson Huang > > > > wrote: > > > > > > > > > subsys_initcall(gpio_mxc_init); > > > > > + > > > > > +MODULE_AUTHOR("Shawn Guo "); > > > > > +MODULE_DESCRIPTION("i.MX GPIO Driver"); > MODULE_LICENSE("GPL"); > > > > > > > > You are making this modualrizable but keeping the > > > > subsys_initcall(), which doesn't make very much sense. It is > > > > obviously not necessary to do this probe at subsys_initcall() time, right? > > > > > > > > > > If building it as module, the subsys_initcall() will be equal to > > > module_init(), I keep it unchanged is because I try to make it > > > identical when built-in, since most of the config will still have it built-in, > except the Android GKI support. > > > Does it make sense? > > > > > > > Take this opportunity to convert the driver to use > > > > module_platform_driver() as well. > > > > > > If you think it has to be or it is better to use > > > module_platform_driver(), I will do it in V2. > > > > I tried to replace the subsys_initcall() with > > module_platform_driver(), but met issue about " > > register_syscore_ops(&mxc_gpio_syscore_ops);" which is called in > > gpio_mxc_init() function, this function should be called ONLY once, > > moving it to .probe function is NOT working, so we may need to keep the > gpio_mxc_init(), that is another reason that we may need to keep > subsys_initcall()? > > This looks a bit dangerous to keep like this while allowing this code to be used > from a module. > > What happens if you insmod and rmmod this a few times, really? > How is this tested? > > This is not really modularized if that isn't working, just that modprobing once > works isn't real modularization IMO, it seems more like a quick and dirty way > to get Androids GKI somewhat working with the module while not properly > making the module a module. > > You need input from the driver maintainers on how to handle this. As far as I know, some general/critical modules are NOT supporting rmmod, like clk, pinctrl, gpio etc., and I am NOT sure whether Android GKI need to support rmmod for these system-wide-used module, I will ask them for more detail about this. The requirement I received is to support loadable module, but so far no hard requirement to support module remove for gpio driver, so, is it OK to add it step by step, and this patch series ONLY to support module build and one time modprobe? Thanks, Anson _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel