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=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,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 22771C433DF for ; Sat, 27 Jun 2020 09:37:55 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 DF45D208B6 for ; Sat, 27 Jun 2020 09:37:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="SJmq8KRi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF45D208B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AD66688794; Sat, 27 Jun 2020 09:37:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L1qYVDX6Ycnb; Sat, 27 Jun 2020 09:37:54 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 0854188262; Sat, 27 Jun 2020 09:37:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DDE22C0863; Sat, 27 Jun 2020 09:37:53 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 38EC4C016F for ; Sat, 27 Jun 2020 09:37:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F2A5C204A7 for ; Sat, 27 Jun 2020 09:37:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5C2ff9ewsdmJ for ; Sat, 27 Jun 2020 09:37:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by silver.osuosl.org (Postfix) with ESMTPS id 097562049B for ; Sat, 27 Jun 2020 09:37:51 +0000 (UTC) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 917952080C; Sat, 27 Jun 2020 09:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593250670; bh=zZELxKTTCTxcMP1neFCDkhEmsrYvFsuFOQvTPs2LW+c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SJmq8KRi1jgvWRcPI4SHkPEc+R43hu090gDiOWiQYBd6f7KyhD9u36f7wdK4SAiOi TiykfH2Ivq0Q2vu8CYu6ont40rZejzwmuhcQiE7XXc6jEno7gLZaVviX4OZd+1a9Ap tCUsekZtHIj1Id7RZIS6xZu22vuc88/JBigULWZI= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jp7HQ-006rG2-LY; Sat, 27 Jun 2020 10:37:48 +0100 Date: Sat, 27 Jun 2020 10:37:47 +0100 Message-ID: <87wo3setn8.wl-maz@kernel.org> From: Marc Zyngier To: John Stultz Subject: Re: [PATCH v2 3/5] irqchip: Allow QCOM_PDC to be loadable as a permanent module In-Reply-To: References: <20200625001039.56174-1-john.stultz@linaro.org> <20200625001039.56174-4-john.stultz@linaro.org> <159315737502.62212.16093934831673347066@swboyd.mtv.corp.google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: john.stultz@linaro.org, swboyd@chromium.org, linux-kernel@vger.kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, joro@8bytes.org, tglx@linutronix.de, jason@lakedaemon.net, linus.walleij@linaro.org, mkshah@codeaurora.org, ilina@codeaurora.org, saravanak@google.com, tkjos@google.com, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-gpio@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: Maulik Shah , Jason Cooper , Saravana Kannan , Greg Kroah-Hartman , lkml , Lina Iyer , Bjorn Andersson , linux-gpio@vger.kernel.org, iommu@lists.linux-foundation.org, Andy Gross , linux-arm-msm , Thomas Gleixner , Stephen Boyd , Linus Walleij , Todd Kjos X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Sat, 27 Jun 2020 02:34:25 +0100, John Stultz wrote: > > On Fri, Jun 26, 2020 at 12:42 AM Stephen Boyd wrote: > > > > Quoting John Stultz (2020-06-24 17:10:37) > > > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c > > > index 6ae9e1f0819d..3fee8b655da1 100644 > > > --- a/drivers/irqchip/qcom-pdc.c > > > +++ b/drivers/irqchip/qcom-pdc.c > > > @@ -430,4 +432,33 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent) > > > return ret; > > > } > > > > > > +#ifdef MODULE > > > +static int qcom_pdc_probe(struct platform_device *pdev) > > > +{ > > > + struct device_node *np = pdev->dev.of_node; > > > + struct device_node *parent = of_irq_find_parent(np); > > > + > > > + return qcom_pdc_init(np, parent); > > > +} > > > + > > > +static const struct of_device_id qcom_pdc_match_table[] = { > > > + { .compatible = "qcom,pdc" }, > > > + {} > > > +}; > > > +MODULE_DEVICE_TABLE(of, qcom_pdc_match_table); > > > + > > > +static struct platform_driver qcom_pdc_driver = { > > > + .probe = qcom_pdc_probe, > > > + .driver = { > > > + .name = "qcom-pdc", > > > + .of_match_table = qcom_pdc_match_table, > > > + .suppress_bind_attrs = true, > > > + }, > > > +}; > > > +module_platform_driver(qcom_pdc_driver); > > > +#else > > > IRQCHIP_DECLARE(qcom_pdc, "qcom,pdc", qcom_pdc_init); > > > > Is there any reason to use IRQCHIP_DECLARE if this can work as a > > platform device driver? > > > > Hey! Thanks so much for the review! > > Mostly it was done this way to minimize the change in the non-module > case. But if you'd rather avoid the #ifdefery I'll respin it without. That would certainly be my own preference. In general, IRQCHIP_DECLARE and platform drivers should be mutually exclusive in the same driver: if you can delay the probing and have it as a proper platform device, then this should be the one true way. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu