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=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 278B5C433B4 for ; Tue, 27 Apr 2021 12:20:09 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 73C02613E7 for ; Tue, 27 Apr 2021 12:20:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73C02613E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LYvegp5KMz+8zr6cnwkTxzcHkRuOOUmjMdO5SmMbw0w=; b=MlSKVj32eo+qFL+kx+42Ko1lf fsMCwDaiyCMFZA42BAwWrYUNwoT89tASUrDI7Ua7WGa7n4g0/4Svw3FjBN/kN6n5AEYsrsMdV/u+2 tYCctTmVa/GNF7+b8zwfn8Uz5xqU67KpkHsoK8TR6GQbIKln/ySmXAJkiBheOpiZ/+3D7uTC1XgjV 7ILhI69N3UsBjAX5Yv1N7C6pPE1oTHl6Q8pc2tou1u6ZfzpfecBzU0PYIzAKlLOGEO4IzCkRVg4Mh UE0yldjVnN2cueMPI/9PsHLbjcObWgW5BBLfwepHo3XIYV5V7iLXtYgwJWsmfce7mFjpYxN3azmwJ cIyHBdEdQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbMf5-001btu-C9; Tue, 27 Apr 2021 12:17:56 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbMf1-001bth-UJ for linux-arm-kernel@desiato.infradead.org; Tue, 27 Apr 2021 12:17:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=v58ehw3aert7GXfmUvXYHeZqeRwhMjRgFWRUY5+Acpc=; b=GYX+i1B/JvapIYSsdsQkY97jNr xIeyicUgWAAx5jsjEnMGB0WQnlNhwykUbhWSi+xpgum7KgxRJYlMPypQEXTQ2s4fbl5RM+iuy9EOg Z4tX/dm0ZGyfzcORo3XX/IhkSgz9C/SU44XmO4e5VgaeNE0QDbraUAQGkVEURXfjuuORD3cp43wf4 zN6r2qPRkYfaCilSQhBY2X8wieaXwrEqLVhWZYep1AN7bCQ6mpzojhlj6GBtQ0XGWDdO2Mik1928s 3ZwXCROjIVKKwzs9xyG6GGJIZdfUPHYA2lFod770DN6BG+OkGCty5bi+vJogZgWPTcdOdf4iClGex XWVvsYxw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbMez-00Girh-BG for linux-arm-kernel@lists.infradead.org; Tue, 27 Apr 2021 12:17:50 +0000 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 66C3861131; Tue, 27 Apr 2021 12:17:48 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lbMew-009fzR-4n; Tue, 27 Apr 2021 13:17:46 +0100 Date: Tue, 27 Apr 2021 13:17:45 +0100 Message-ID: <87mttjor9y.wl-maz@kernel.org> From: Marc Zyngier To: Anirudha Sarangi Cc: Thomas Gleixner , Michal Simek , Valentin Schneider , Douglas Anderson , Hans de Goede , Maulik Shah , Zhen Lei , , , Rob Herring , Frank Rowand , , Subject: Re: [PATCH 1/3] irqchip: xilinx: Avoid __init macro usage for xilinx_intc_of_init In-Reply-To: <20210427113136.12469-2-anirudha.sarangi@xilinx.com> References: <20210427113136.12469-1-anirudha.sarangi@xilinx.com> <20210427113136.12469-2-anirudha.sarangi@xilinx.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (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: anirudha.sarangi@xilinx.com, tglx@linutronix.de, michal.simek@xilinx.com, valentin.schneider@arm.com, dianders@chromium.org, hdegoede@redhat.com, mkshah@codeaurora.org, thunder.leizhen@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, frowand.list@gmail.com, devicetree@vger.kernel.org, git@xilinx.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_051749_455660_7E3B7886 X-CRM114-Status: GOOD ( 29.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Tue, 27 Apr 2021 12:31:34 +0100, Anirudha Sarangi wrote: > > This patch ensures that xilinx_intc_of_init API is not allocated into > the .init.text section. Since this API calls the API set_handle_irq > which uses __init macro to be put into .init.text section, this patch > makes changes to ensure that set_handle_irq also does not stay in > .init.text section. > This patch is in preparation for the patch through which the xilinx > intc driver will be loaded and unloaded as a module. > > Signed-off-by: Anirudha Sarangi > --- > drivers/irqchip/irq-xilinx-intc.c | 4 ++-- > include/linux/irq.h | 2 +- > kernel/irq/handle.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c > index 1d3d273309bd..642733a6cbdf 100644 > --- a/drivers/irqchip/irq-xilinx-intc.c > +++ b/drivers/irqchip/irq-xilinx-intc.c > @@ -177,8 +177,8 @@ static void xil_intc_irq_handler(struct irq_desc *desc) > chained_irq_exit(chip, desc); > } > > -static int __init xilinx_intc_of_init(struct device_node *intc, > - struct device_node *parent) > +static int xilinx_intc_of_init(struct device_node *intc, > + struct device_node *parent) > { > struct xintc_irq_chip *irqc; > int ret, irq; > diff --git a/include/linux/irq.h b/include/linux/irq.h > index 2efde6a79b7e..252fab8074de 100644 > --- a/include/linux/irq.h > +++ b/include/linux/irq.h > @@ -1250,7 +1250,7 @@ int ipi_send_mask(unsigned int virq, const struct cpumask *dest); > * Returns 0 on success, or -EBUSY if an IRQ handler has already been > * registered. > */ > -int __init set_handle_irq(void (*handle_irq)(struct pt_regs *)); > +int set_handle_irq(void (*handle_irq)(struct pt_regs *)); > > /* > * Allows interrupt handlers to find the irqchip that's been registered as the > diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c > index 762a928e18f9..a0b18e8f5af0 100644 > --- a/kernel/irq/handle.c > +++ b/kernel/irq/handle.c > @@ -218,7 +218,7 @@ irqreturn_t handle_irq_event(struct irq_desc *desc) > } > > #ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER > -int __init set_handle_irq(void (*handle_irq)(struct pt_regs *)) > +int set_handle_irq(void (*handle_irq)(struct pt_regs *)) > { > if (handle_arch_irq) > return -EBUSY; No, never. This function is for a root interrupt controller. You will never be able to use this from a module. If you are calling this from something that isn't marked __init, this is a terrible bug. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel