Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5796407ybv; Wed, 12 Feb 2020 00:06:02 -0800 (PST) X-Google-Smtp-Source: APXvYqw3I+d0RYsg/fw+IgzoeiEID26oycSE77h7ppAsRkLKXFpjNhvV21TC4Fh6MsR6iaoGRJA4 X-Received: by 2002:a9d:6d10:: with SMTP id o16mr8614057otp.28.1581494762478; Wed, 12 Feb 2020 00:06:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581494762; cv=none; d=google.com; s=arc-20160816; b=WeMjaimEQNAflhFGAlIKBwsV17QyRmeXIMk7cjCtigGIVyd8S06T5rNGqd82WJrdJV QRxQcuh8vpbUpByLqnBbDpn8eSGbFv+mVl76tRdR6uvC2+KoM1i4FuukROlZ3xm8EpND noQItE+rZ2C+kEMB8ATHKnF14K9o5I3N/F9A0uUjaIJMwKy/OkVPOnXl+moXRkGZutwq wLese6DSdzJafOJ8oa3fps28LbG/CzEavQuedfk7RM3ksrRhBnjXjh8q3J3j56xEV8O5 uhfZBk23mrf4bVyaH+M+epYvhFJ+2TdbGqq9qesaNkUG2RhYlxNyRuHdOIEtde+NzINf +WLA== 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=7cVJrf+4rXD3RIvKPMDPkxaYFB3IsTOj78t7ZIWn1gM=; b=BBEROz6wYIW+MCeBNqLsKOoxGUNpdMArSntGRIJ3efWpxWlEoAh5jxjjMNpkOpxjG8 m7JHQ+O5ibvkbGfZvyDaSOqOablohWZYT4T/FlDL/9rrXZYFtJK5aZF9mF4QOV7Ac2jz sH4s11weKri4pVEWSNcbcT2IC0JA7Tgf/qdykxXvkjQA8SLXtRkZHybBfmIq77vsyMms YJEZbRfLRbdhcaSPYvh4XJnpkUXXL5BcQl93/rwpBf4teIz9eQJmoY4X1rLR7RWniX4L nuT4KlVCcDFvgwrdinr2CjtBodtFoUl/QY540B9MpyWYKRFKEQ13VtnNkRgsUK5qDN6H 8lnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b2rWZgdT; 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 s5si3315658otd.141.2020.02.12.00.05.49; Wed, 12 Feb 2020 00:06:02 -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=b2rWZgdT; 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 S1728451AbgBLIF3 (ORCPT + 99 others); Wed, 12 Feb 2020 03:05:29 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43941 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728323AbgBLIF3 (ORCPT ); Wed, 12 Feb 2020 03:05:29 -0500 Received: by mail-pf1-f194.google.com with SMTP id s1so829620pfh.10 for ; Wed, 12 Feb 2020 00:05:28 -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=7cVJrf+4rXD3RIvKPMDPkxaYFB3IsTOj78t7ZIWn1gM=; b=b2rWZgdTS+HavWtrTjLQrHTONKBSuIgdXx6mgRc1+KE2M2+sTlKIfE+pEP2oUglRjA SqSCImuVddgreHZII0cvxRG7LSH6Gid0BMel/HQhdaD2HOap8nFJRotmzz8mNWGki35E 0F/ndCza8rBC7MrfxMuXoTfPE2vBsg/LmSkh3/QI4DhvEG01cdCLb/Qw4hrz+46py+bQ rmo+mAVXPUixKaVaBlTQWhz/+e6lPA13o9eRNtBd8rw0JXi0NF45w/seYrG+MdOjfw48 pZAuXpzo7SoqK42Hzj8oRkGpN9kt3rgf269kbkiF5aLrlIxHFdq9eul+GVUOSIA9ZJPu 8ULg== 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=7cVJrf+4rXD3RIvKPMDPkxaYFB3IsTOj78t7ZIWn1gM=; b=aW1Ya8oVPBmptsv9+eIvRZXXiWRiA85sx8Ilr3XJ2pKjDrBKBbISTeprrBigbmBH7p /X9rJbdcF49TEcg/6zKCHu1Z7pisn/AunzuvhOAw8Vy+tBM/IL2rFY2X9MfuI/RQpl6D S2sA3M4AtIc2VKIF6WHE7c8sPl7WXU5EGAaP2e/zQAcVBu8dR/6CmJuPAwj5tSg3X2OA b6ifQsd6ErA4ymztyoe/EdH2TMZujlRVXvYQEYP85vG0ABcvfApS6xgSzEGQ/ZMox61U wsd1hnZcgOEyYmB1v+Z6vPBfBl++SYMDiMi7IOVgi7mHudWGgdKk0QnhEd8uhjWfAhgC p2pg== X-Gm-Message-State: APjAAAVDnbUn1qm1gVxMiSsJ/4nize77+59tD6DbRQ1NhilTudscOVLB v2RPdIg3/MbVqLDXG/PAlRE= X-Received: by 2002:a63:d04c:: with SMTP id s12mr11239449pgi.105.1581494728515; Wed, 12 Feb 2020 00:05:28 -0800 (PST) Received: from localhost ([106.51.21.91]) by smtp.gmail.com with ESMTPSA id o10sm6508939pgq.68.2020.02.12.00.05.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:05:28 -0800 (PST) Date: Wed, 12 Feb 2020 13:35:26 +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 15/18] xtensa: replace setup_irq() by request_irq() Message-ID: <85574e1ae1e6870ef01b6e61c5b1c5f393c2ac4b.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 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..22a117ca0c4d 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("request_irq() on %s 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..cd7651c603d2 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("request_irq() on %s failed\n", "timer"); sched_clock_register(ccount_sched_clock_read, 32, ccount_freq); timer_probe(); } -- 2.24.1