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 0F22EC433DF for ; Thu, 16 Jul 2020 13:56:40 +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 CDB6420825 for ; Thu, 16 Jul 2020 13:56:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vUCH6i/2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yW0TqbV2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDB6420825 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AU+uWeQOxIhpLsiph0zBD53oYkFA6Fg7/9M/1K51Z14=; b=vUCH6i/2P4hmBbFkFKeijqlFY 2cyxuDdhZqRN88UO+v6rTqfftSeTQ4YI+rx+2klu9I7xVhXs39RTZ/uPLcFmRzBi/SYDsHlLnGCb6 ogFQj6A9vgR2YQc4VGqaCBbtVXy8Z+MtBwH4BGhhVqcyJvZqSyFitAYAyboE3MmPqqBeTbeBbTnJ+ P3BmOZo5PwnDYasmGUJqVlZ1uOiBx7xkmYE6CARpYFtYK5+NtToz4VuIi1+JvtZsfxPrk9HwVL7Un OtpwDOtFBccHrbRjV3ruolcJjnFl/EJwSYKMwM7tVHCe0ft2SARJpFlCOcWznFTIluM0Qt4YfhA90 q+GHE1Qyg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw4Lv-0003KT-SP; Thu, 16 Jul 2020 13:55:11 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw4Ls-0003Jo-BN for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 13:55:09 +0000 Received: by mail-lf1-x141.google.com with SMTP id y18so3310055lfh.11 for ; Thu, 16 Jul 2020 06:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fSYl+obZVE+fUKznzfN+YjGdJqq6f8RfiQS+28i+3lU=; b=yW0TqbV2Cmn34g+off5Xzod+BSQ8M1Xw4VxORpFRWUx+wIaEXJJhwqCsu+hmjEWM3V PPGCXyWxy+R+W2N+bI0gtgOCetsz7Z1owadn47BzqxHpW9p53Ifhqefkn9j5GEfIVKq5 fOxjHE3rHiAeMdcJKce8rB8zIiKvTuuGTx67ld8xXchrZVzXBSWAGnbYPold/YYUaAto i7EFg+cxceta14JfCDJZ5tHMznT+lsvoaLzdBaO1/+uPiyw92qJ0FxVswVSvg+ZJ9MyQ /836A7RemmSD/r7Dt/coNl6VqvR67ATuNOirwQOyk3OYgq/k94bVCxNguezzutd+sM52 ZEFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fSYl+obZVE+fUKznzfN+YjGdJqq6f8RfiQS+28i+3lU=; b=sK0qu0iqC7OKY4scyZ9AOx2Pk89GpOLxKUBkW3v47FqobVQwEE5sW2yPxIgjCg+X1g 3r34v4b8NGy6CHEBMIwfrbF+YmIH2k8+ewcmxglLydUtECulGyl426jnAVbuMjhHSE2P g4j/ScYbhWoxodTQInALOelFsCRE+bkDBKRQSpTA5G6nyCStY1CBJAatKBMiR5yIa+yf avk/YXy5gF1R37BLZWMHOku3XZsTFrCOvEGXw6vGTr62YnR7IEpPlCfqexaZrZGTpFP+ ydk6IOOWp5vMj5MyoghY7PyyCN+/ciYYE4GhJZaB5Ti3Qs5hFU9nk6qDrBJq9oQK1w7f CyWA== X-Gm-Message-State: AOAM530Wao41x7HNcKmIRx9CO/GFf6omNs4hVYrt/VtdNQbUU1K1/bis wBm82SoGOZb7Iz6+WIWZRanBIeh0bh14llDW3D3YOQ== X-Google-Smtp-Source: ABdhPJzPt8lneTMty4LKVohX0XpVyQrsxGQOfHKHWJDQ5g7QK57hNzDZxOt+c+QzpVfm9NT4EJMpAs/zLD29z0/+tig= X-Received: by 2002:a19:f20a:: with SMTP id q10mr2210486lfh.89.1594907706496; Thu, 16 Jul 2020 06:55:06 -0700 (PDT) MIME-Version: 1.0 References: <1594164323-14920-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Linus Walleij Date: Thu, 16 Jul 2020 15:54:55 +0200 Message-ID: Subject: Re: [PATCH 1/3] gpio: mxc: Support module build To: Anson Huang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_095508_402114_5A7511C8 X-CRM114-Status: GOOD ( 25.93 ) 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 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. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel