Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5796830ybv; Wed, 12 Feb 2020 00:06:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxVFemg6Pmrg8tQt+hz4GYz17/mBYBceApg6U8so6ktX+04zjuMKGksVmz7R7UitbwKqbCp X-Received: by 2002:a9d:7f81:: with SMTP id t1mr7772653otp.95.1581494791133; Wed, 12 Feb 2020 00:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581494791; cv=none; d=google.com; s=arc-20160816; b=tTI1y0WzLPbbWMsoDtqJmpnSvu/KpzGMkbYLCU99JT3iu4lBEEHKJQkcC43PliSmRs yoL1IEAgYCmsJcJwEsiOUajAOx/q19NbHbZcdARO4eaku3Q52DaqTl6KuoAlyFia2WXu KA9HjC0OYx8vLG/zdfHHvFw005BO4vXxnuV4RV5C3qsMb6a8ztuNJfIBSEbFjlNPGshx HY5gH7MgEjnq8Pj5vs2ze0Rm8t8AcV3TeugB4iR4lrVfm7syGmtmrZwXN/RKG4MT0C0n loUcqecjJJq+CsAj4MBO2aJ1rXLsahrM6vmukiOD71zuuEPpvZm7qItaa1GIxmTjAPmO EGNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kRwkd5KZdgVkHY9WaSqu+jWLqpoO/HfIGrJrLlk0Vtw=; b=CrkVXHLWLjCVpVsTQ++n3OCDCPj9piiaMbw8zEGgrFyC/6CmpkBpBckqoVWKRxC049 o9q8zP4nB20D/Xab4F63H4HQX8RZIyS1dCr11oc0gW03TM9IxHV2n+uJSzxY0HeAB0bI Gv5lImiLqC6IpX+zd8l5cn6unvgPii5cvLL20lWzYkU3h6py3DtBcAe8LaGdyMlJpbYq ennxC14Nig2O1wUjOi06ythZ2pgKJvacB6+JPYGL7gCs4iSKnMy/XNS0pnlyrTM4KZuA kk1wEXmXyLHojddxRfc56sX8dZYnWVaAGIbQ9FM4N12s4RwB0/lHRmnZTH9yHap7red3 pJcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cyU1lRlt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si3097386otk.318.2020.02.12.00.06.18; Wed, 12 Feb 2020 00:06:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cyU1lRlt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728554AbgBLIF5 (ORCPT + 99 others); Wed, 12 Feb 2020 03:05:57 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45066 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728353AbgBLIF4 (ORCPT ); Wed, 12 Feb 2020 03:05:56 -0500 Received: by mail-pg1-f194.google.com with SMTP id b9so650740pgk.12 for ; Wed, 12 Feb 2020 00:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kRwkd5KZdgVkHY9WaSqu+jWLqpoO/HfIGrJrLlk0Vtw=; b=cyU1lRltzHrAtC8eblQynmola//TBb3NrNAcFcM74ktC6yz5vxdA2boBqC9Jm8vIYO tK5ae6Os2q0V/B0z96vY6EN1N4j0URbyAX8VDzoLdzIFgBMA/NivKOmxvbgk6w/wGdjj qpby4HgGPQFBY58ZsekSf1JF3S+7VN9skVFcs1bPCT8QH5jp307U8NkIesP1/3lyY1zC NGMaYrw/PhcWyXMXUkYvSo0Rd8ns5hZE30QoiDiDg7mPN1zKIVF/IcflbgSp6QFcrKYO x3MIe7hBXNY9/MhyiNy5U1eYyivTC5yGunaRO95Vx2Lle0R3z9D53QJ/R7XhTJ+TRN8v BaqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kRwkd5KZdgVkHY9WaSqu+jWLqpoO/HfIGrJrLlk0Vtw=; b=Zd0y1SVe04lMj4bwtPfQ1QsZP3nhMoHrl8eNgggf9vzU5q7o0aPNxA8a6szIH5GOFQ TK4TfiWmqd09vFsm/RYY5DOnKwWZR2CvZ9hfk0SIZFWf6uKYf+cPgebB6sRBtfEYfu3Y ewGa7wizQRAJMjqFrrO9DAehkG8apwtLHeslLYAVRjnWawHotw6IelAdxzQ7d3Rrt3zE Co8pVS6KJ0vTKv6MeHLN6+EXVsKsEOjz+vRWlDR3ly/x64C3MQUX8eUkdDODAs+QbmXr eVhLxZfv6VtWHjVl9AX/eZU1uesYmGkR8M8rnPom9e26cYp1UW79UMBOx0fsa1zuql6j H87g== X-Gm-Message-State: APjAAAX9NIBcSw40OPVeJ9ZS2I3J+aWLRdOC9joAg9IOSLkhHURPycUY PMpnpNG/ofQAx9CaKhf/dpp4EU3S86Y= X-Received: by 2002:a63:d44e:: with SMTP id i14mr7449334pgj.417.1581494755638; Wed, 12 Feb 2020 00:05:55 -0800 (PST) Received: from localhost ([106.51.21.91]) by smtp.gmail.com with ESMTPSA id r145sm7298586pfr.5.2020.02.12.00.05.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:05:55 -0800 (PST) Date: Wed, 12 Feb 2020 13:35:53 +0530 From: afzal mohammed To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , Paul Cercueil Subject: [PATCH 17/18] irqchip: Replace setup_irq() by request_irq() Message-ID: <8e00874d072f32496c2d0da05423bda1cadd6975.1581478324.git.afzal.mohd.ma@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org request_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq(). [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed --- Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter, https://lkml.kernel.org/r/cover.1581478323.git.afzal.mohd.ma@gmail.com drivers/irqchip/irq-i8259.c | 9 +++------ drivers/irqchip/irq-ingenic.c | 11 +++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/irqchip/irq-i8259.c b/drivers/irqchip/irq-i8259.c index d000870d9b6b..e9798d02b256 100644 --- a/drivers/irqchip/irq-i8259.c +++ b/drivers/irqchip/irq-i8259.c @@ -271,11 +271,6 @@ static void init_8259A(int auto_eoi) /* * IRQ2 is cascade interrupt to second interrupt controller */ -static struct irqaction irq2 = { - .handler = no_action, - .name = "cascade", - .flags = IRQF_NO_THREAD, -}; static struct resource pic1_io_resource = { .name = "pic1", @@ -323,7 +318,9 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node) if (!domain) panic("Failed to add i8259 IRQ domain"); - setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2); + if (request_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, no_action, + IRQF_NO_THREAD, "cascade", NULL)) + pr_err("request_irq() on %s failed\n", "cascade"); register_syscore_ops(&i8259_syscore_ops); return domain; } diff --git a/drivers/irqchip/irq-ingenic.c b/drivers/irqchip/irq-ingenic.c index c5589ee0dfb3..5b20a0f0ece8 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -58,11 +58,6 @@ static irqreturn_t intc_cascade(int irq, void *data) return IRQ_HANDLED; } -static struct irqaction intc_cascade_action = { - .handler = intc_cascade, - .name = "SoC intc cascade interrupt", -}; - static int __init ingenic_intc_of_init(struct device_node *node, unsigned num_chips) { @@ -130,7 +125,11 @@ static int __init ingenic_intc_of_init(struct device_node *node, irq_reg_writel(gc, IRQ_MSK(32), JZ_REG_INTC_SET_MASK); } - setup_irq(parent_irq, &intc_cascade_action); + if (request_irq(parent_irq, intc_cascade, 0, + "SoC intc cascade interrupt", NULL)) { + pr_err("request_irq() on %s failed\n", + "SoC intc cascade interrupt"); + } return 0; out_domain_remove: -- 2.24.1