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=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 664A6C433E1 for ; Tue, 16 Jun 2020 11:30:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AD352071A for ; Tue, 16 Jun 2020 11:30:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="dJgM7oRJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728367AbgFPLaX (ORCPT ); Tue, 16 Jun 2020 07:30:23 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:16582 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbgFPLaW (ORCPT ); Tue, 16 Jun 2020 07:30:22 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1592307021; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=RTLcSYYKGCznp62vlVdfOr6g6s60R3IwkNGZ7WpqjjY=; b=dJgM7oRJQu/bA+aq7hrmk4WJFtwMslSGyMmWx7EXieOMs5QROhArHddDrWUG0zpd2jBJ249Q HVrKnDtUiSP+5iH2efP4DnOApw5/8X4Ho9vRAM2jJxHKGBJvck7ptFK1zyt0FVv7weoSc5zL /4Jj5fBYVBsgqwqs5ZWhf6vVeOk= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n14.prod.us-east-1.postgun.com with SMTP id 5ee8ad43567385e8e7c150fd (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 16 Jun 2020 11:30:11 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 65EC4C433A1; Tue, 16 Jun 2020 11:30:10 +0000 (UTC) Received: from [192.168.43.129] (unknown [106.222.0.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3A225C433C9; Tue, 16 Jun 2020 11:30:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3A225C433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=mkshah@codeaurora.org Subject: Re: [RFC][PATCH 3/5] irqchip: Allow QCOM_PDC to be loadable as a perment module To: John Stultz , lkml Cc: Andy Gross , Bjorn Andersson , Joerg Roedel , Thomas Gleixner , Jason Cooper , Marc Zyngier , Linus Walleij , Lina Iyer , Saravana Kannan , Todd Kjos , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-gpio@vger.kernel.org References: <20200616061338.109499-1-john.stultz@linaro.org> <20200616061338.109499-4-john.stultz@linaro.org> From: Maulik Shah Message-ID: <55e5982a-1e73-7013-e02d-5d1d30815fba@codeaurora.org> Date: Tue, 16 Jun 2020 16:59:58 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200616061338.109499-4-john.stultz@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi, On 6/16/2020 11:43 AM, John Stultz wrote: > Allows qcom-pdc driver to be loaded as a permenent module typo: permanent > Also, due to the fact that IRQCHIP_DECLARE becomes a no-op when > building as a module, we have to add the platform driver hooks > explicitly. > > Thanks to Saravana for his help on pointing out the > IRQCHIP_DECLARE issue and guidance on a solution. > > Cc: Andy Gross > Cc: Bjorn Andersson > Cc: Joerg Roedel > Cc: Thomas Gleixner > Cc: Jason Cooper > Cc: Marc Zyngier > Cc: Linus Walleij > Cc: Lina Iyer > Cc: Saravana Kannan > Cc: Todd Kjos > Cc: Greg Kroah-Hartman > Cc: linux-arm-msm@vger.kernel.org > Cc: iommu@lists.linux-foundation.org > Cc: linux-gpio@vger.kernel.org > Signed-off-by: John Stultz > --- > drivers/irqchip/Kconfig | 2 +- > drivers/irqchip/qcom-pdc.c | 30 ++++++++++++++++++++++++++++++ > 2 files changed, 31 insertions(+), 1 deletion(-) > > diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig > index 29fead208cad..12765bed08f9 100644 > --- a/drivers/irqchip/Kconfig > +++ b/drivers/irqchip/Kconfig > @@ -425,7 +425,7 @@ config GOLDFISH_PIC > for Goldfish based virtual platforms. > > config QCOM_PDC > - bool "QCOM PDC" > + tristate "QCOM PDC" > depends on ARCH_QCOM > select IRQ_DOMAIN_HIERARCHY > help > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c > index 6ae9e1f0819d..98d74160afcd 100644 > --- a/drivers/irqchip/qcom-pdc.c > +++ b/drivers/irqchip/qcom-pdc.c > @@ -11,7 +11,9 @@ > #include > #include > #include > +#include > #include > +#include please move this include in order after of_device.h > #include > #include > #include > @@ -430,4 +432,32 @@ 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, can you please set .suppress_bind_attrs = true, This is to prevent bind/unbind using sysfs. Once irqchip driver module is loaded, it shouldn't get unbind at runtime. Thanks, Maulik > + }, > +}; > +module_platform_driver(qcom_pdc_driver); > +#else > IRQCHIP_DECLARE(qcom_pdc, "qcom,pdc", qcom_pdc_init); > +#endif > + > +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller"); > +MODULE_LICENSE("GPL v2"); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation