Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1850355ybv; Sun, 23 Feb 2020 16:54:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyTHl9Mw7sZGn//LIsQXHfLc/NjUdXAGkrsv84rJ2CcfOHfUfNnU1vqPT4XIb5VFafBBhjf X-Received: by 2002:aca:b183:: with SMTP id a125mr10733643oif.83.1582505646024; Sun, 23 Feb 2020 16:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582505646; cv=none; d=google.com; s=arc-20160816; b=EIeTgIsVPj48e6UNP8UOIUzFRcukT/+l1gkbi2n/I2v4dVPtcpzo+6eroI8C/LncGQ sZNgxx+9aYF9QIAeTVSSHu6ZzMmuW86jfioG5q2wpjhUrlfjt5LQuiET3jYzZVkrYgbk pgUTktMaCoTzIhzU9QGMr8Qap7puOWlMlCBqe1+pS+wCNHoApm/bYCt+QGvSaH+v0Syr +I2Wb6824UWgwMWO7s5NQuovyIHpzHyt/zTvyWgCJYieqpLWRuCnvAyjDb6UR8CSNEvi pMlCSqV3RmJOI5WPXTHwwUIWH4ytu/mCVYAfYxgaBi1nQ71B1qEWfKspOiNXK77HgCxs 0+Yw== 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=EkJrYV9NW5v7JI25cfmTE4c1LpjI4vJZT80unhRKBzs=; b=UWNgtvzpeE3i/fFWZl3BwokwpfDY8Y9QcLsQFuNhJ6giRQkZ2nsLfldKTF2u5/FT/g gLq/ev+hiWPEikL1/XwVgiiy3NA041j16C58JjaSIkiNZHvGcPE/EndqlSvFRp3wKzr+ VPs251i4sEe6lGlcqeBPRU0UupVZzqU17NCvuZtNgX9/HWIl7jw2ME+OH+8SLnuSEwhU kNeF/ur6+8t1uvxf1dyJywa9RdmkEIVXvGoZ4pwa7sXPMhFfFNHVMsz+QxmGbx+x7EVc IdXbI/oxucavAvutqy1Z+md5CdhXkszg6GH8PeYyDr0MIeYxClIPi2CcuLOjAnuG2xa3 EJIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gGRWBnzV; 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 l21si4414764oic.126.2020.02.23.16.53.54; Sun, 23 Feb 2020 16:54:06 -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=gGRWBnzV; 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 S1727324AbgBXAwn (ORCPT + 99 others); Sun, 23 Feb 2020 19:52:43 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35067 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbgBXAwn (ORCPT ); Sun, 23 Feb 2020 19:52:43 -0500 Received: by mail-pl1-f195.google.com with SMTP id g6so3341643plt.2 for ; Sun, 23 Feb 2020 16:52:43 -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=EkJrYV9NW5v7JI25cfmTE4c1LpjI4vJZT80unhRKBzs=; b=gGRWBnzVl81llKsCV2p0eLp81Ky2WSG+mHk5aqBjScuwmIQ84JAuGD3AGopIQcKYn5 J3WqCwmmSvvmFs+Q5qGsk/4+lCRnynq3jddYY6o9+kfnQHD/0RFMGjK3XYNpqnNpllOK tgKPOX2PmDNcAb58AIdCtGSQ1JFu23TZFNph07+3lHWfo1ik7uw5PNaNlI9RT8MqNfLR 2cNNagtxFfjubRZan+lF86PpPYuHqyJ5GlFkUppesaTgHGfy1CgITBRMFjWmdmJcXFhV ol/PqlzcdArcfLybfUYLPRo4CJreWTqv1gYd+hcoiKGAPe2/Z9ZFGez50aQkuFGIUYx7 Ze5A== 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=EkJrYV9NW5v7JI25cfmTE4c1LpjI4vJZT80unhRKBzs=; b=sEsbggsXEpcgraU5L2B5gngtp+R+i+ajJwpCmsl61Wb3iDWvrvbmWMVcspJvl1psR3 ofdYYRBAp7Hcsq2fXz743GR99Qma0etPucJstMAprpdCuoe/M9koDL8eMvgWLWyTcA2W HxLN9HcJvOffZ14vbtiZbGeJo3g7FccpBZTlbJHcbHpaKjOB08hnv1ro2GGeuWTmbZiu ZtUDrUqPr57xoibR77VVPVeK4QgQqGYPrhUQ8HtLEFFo/5CgjLh63oZyhTKW4rgcA5sq TSetKzDWrt19flZk9j5L64eoWJyWqDjjf/bjZ67iFu4TAZdGSrBgYgi6vDL8bNJhf9Ly UByA== X-Gm-Message-State: APjAAAWkPMmQnWL364uR57lHJJ+rghKsKNzAOJ3hZ77XASIzQrpiRLAj +0K8DjZGJZydMSTcfVfgQQY= X-Received: by 2002:a17:90a:c708:: with SMTP id o8mr17656341pjt.104.1582505562717; Sun, 23 Feb 2020 16:52:42 -0800 (PST) Received: from localhost ([106.51.232.35]) by smtp.gmail.com with ESMTPSA id k12sm8969578pgm.25.2020.02.23.16.52.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Feb 2020 16:52:42 -0800 (PST) Date: Mon, 24 Feb 2020 06:22:40 +0530 From: afzal mohammed To: linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Cc: Chris Zankel , Max Filippov , Andrew Morton , Kees Cook , Thomas Gleixner , Sinan Kaya Subject: [PATCH v2 15/18] xtensa: replace setup_irq() by request_irq() Message-ID: <79fac2f973605ac55fd1f5ab38f3afa20da07a84.1582471508.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(). The early boot setup_irq() invocations happen either via 'init_IRQ()' or '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 Acked-by: Max Filippov --- v2: * Replace pr_err("request_irq() on %s failed" by pr_err("%s: request_irq() failed" * Commit message massage arch/xtensa/kernel/smp.c | 8 ++------ arch/xtensa/kernel/time.c | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c index 83b244ce61ee..b3f34030fa24 100644 --- a/arch/xtensa/kernel/smp.c +++ b/arch/xtensa/kernel/smp.c @@ -53,16 +53,12 @@ static void system_flush_invalidate_dcache_range(unsigned long start, #define IPI_IRQ 0 static irqreturn_t ipi_interrupt(int irq, void *dev_id); -static struct irqaction ipi_irqaction = { - .handler = ipi_interrupt, - .flags = IRQF_PERCPU, - .name = "ipi", -}; void ipi_init(void) { unsigned irq = irq_create_mapping(NULL, IPI_IRQ); - setup_irq(irq, &ipi_irqaction); + if (request_irq(irq, ipi_interrupt, IRQF_PERCPU, "ipi", NULL)) + pr_err("%s: request_irq() failed\n", "ipi"); } static inline unsigned int get_core_count(void) diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 69db8c93c1f9..21d604af16b7 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -128,12 +128,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction timer_irqaction = { - .handler = timer_interrupt, - .flags = IRQF_TIMER, - .name = "timer", -}; - void local_timer_setup(unsigned cpu) { struct ccount_timer *timer = &per_cpu(ccount_timer, cpu); @@ -199,7 +193,9 @@ void __init time_init(void) __func__); clocksource_register_hz(&ccount_clocksource, ccount_freq); local_timer_setup(0); - setup_irq(this_cpu_ptr(&ccount_timer)->evt.irq, &timer_irqaction); + if (request_irq(this_cpu_ptr(&ccount_timer)->evt.irq, timer_interrupt, + IRQF_TIMER, "timer", NULL)) + pr_err("%s: request_irq() failed\n", "timer"); sched_clock_register(ccount_sched_clock_read, 32, ccount_freq); timer_probe(); } -- 2.25.1