Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1677879ybb; Sat, 11 Apr 2020 09:06:21 -0700 (PDT) X-Google-Smtp-Source: APiQypL8wjIS1Pc6sP/u/W0d/Y2PWW20Yl0ymqOs6X1QbS9L9ZfJIvpVhFX0yMzuh9vrr/Xc5o4E X-Received: by 2002:ac8:73c3:: with SMTP id v3mr4160716qtp.378.1586621181610; Sat, 11 Apr 2020 09:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586621181; cv=none; d=google.com; s=arc-20160816; b=dCjI5QfISpK1SkBTRyAgT5nNFrQTdjw6zlUNOVg8+S1b4xfCWGzuXkPy3b2fPAoT8M yAy5o9uDDxC5TPZ1V3Vpse1bNfuTlLUCffI5E1U0s/SyMKxpme1kHwogL/WRdMexaYSo vx+oZKyIE3QQkVM1ZQNgBdvZ4B6GYZAtJ1clofdSXhIhFPhTMpaSN/iZDre+MvRnsyfw fofI06tQ248KxbbAh2/Rvnoc4eRbLtVmNy+QpeIQBgiBxAw9dQ7/qTdjrdlkG9n+KtDs 4IFvsphXChuzAj/77WwNyokMDVit1e61QnrPtTUwRRazmNL+Q8O7DR5E1kfAHUhOgrgB +s4Q== 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=GMnG2j5kk+O2i07cQtSOcLpZb+BBBEK51LCwl+FnQqI=; b=ih7R+K2hU6PqQXnCET0WSj/fbrTmJYnaWA3X1XN6qboROxhH6rhu5e7nBQEg63ccdP xk8RtOjuNbWT8nsSD6WUdd3tiHAAhAKT1avJ/L/74v8m0Z/7YjJpdn0FO49+BM0mtrdt PLqqw6qCzqKv8Q9zQVHChUeU4ZRR8hzr5DGI4Vtqr6oY3F8/ofZUDnmftdiztMpRRe4n 5CkgKihseeWcu88jSy4Szf4gwSVi2num2BZaOUdiwg2le65pW+y7dZ5kfbn7EYUykCjq h9zLrI6G7su5YfDXm5Wrhb8QTGVvdEufU69lkWS+XXnbpBoc36au/BlAryPlUBhlpLdy 3uGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pg0y+mBf; 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 b19si2953476qtq.330.2020.04.11.09.06.07; Sat, 11 Apr 2020 09:06:21 -0700 (PDT) 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=pg0y+mBf; 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 S1726713AbgDKQEh (ORCPT + 99 others); Sat, 11 Apr 2020 12:04:37 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44392 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbgDKQEh (ORCPT ); Sat, 11 Apr 2020 12:04:37 -0400 Received: by mail-pl1-f193.google.com with SMTP id h11so1704104plr.11; Sat, 11 Apr 2020 09:04:37 -0700 (PDT) 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=GMnG2j5kk+O2i07cQtSOcLpZb+BBBEK51LCwl+FnQqI=; b=pg0y+mBfFiZSt/IYWvDz/nhCt33BNvbN56cTCAcqw5qyzPpbHXsQvw4YiKwuoFigFJ x4+BpX5VTbRCs1SRjG1KXqcNhQt8mM/Hd1T1VvGfVNhAcJwcwUCpmHrW/nhv7atQ3t+s CeeooBxtZyLaN/LY+gOX7ZTgFPq7W7vmtJhHScjAgEc5L8ClIN6dQEZuQQZoS5kUebHi Z10rRnjLTam7/QpfojWmjvVxv4nRQG3PnjFd6/qdLgoG1Kwyt9Ufl24OFMlpz/7PKpai +2/INjOoCNyU1Kzj1oLav0YA83E7EI7rVkMGomKeJfI10L0WRCvYNY5wEyRlnkiEb7Jm /Zig== 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=GMnG2j5kk+O2i07cQtSOcLpZb+BBBEK51LCwl+FnQqI=; b=XJNbnIltavf+2oJmwS2Eq5PclSawBvOPG8o7Kzca3K0iI/J3I/qI6bY2Dzbis2QDPC B+s8/JLNdpDsgjpTaAM6QMl9YC2gqNgJJ4haaNGEvXaIIJu6NMNbDLzNZFbcSX35lFsN drbwN36aC7n1JmdOYCVug1JdadEv67y27MpkcjTl6aoMgov+um4LIp6wpbQsLWQG2lmE CInlAUr2WaUitTEQOf9QlrrC09ys9s50RzyxgT5BJZ/metdemeFGVHeGPB1GxnpkvNIY axPdl6GhZ5FbxyZgySVAdus6cMQcoDghV2I33SkhgGcjmAgWkjxtjrwhn5IpWOoI89PY xr3g== X-Gm-Message-State: AGi0PuZfKXfcgHj1rwnQXmg3Qvko0zik40OreKC/snsPE5V+Ks/cMdGM LmzzJ4UnCcykT97Zaz3m8cw= X-Received: by 2002:a17:902:b087:: with SMTP id p7mr9718749plr.287.1586621076622; Sat, 11 Apr 2020 09:04:36 -0700 (PDT) Received: from localhost ([183.82.183.27]) by smtp.gmail.com with ESMTPSA id r23sm4569628pfh.162.2020.04.11.09.04.35 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Apr 2020 09:04:36 -0700 (PDT) Date: Sat, 11 Apr 2020 21:34:34 +0530 From: afzal mohammed To: Thomas Bogendoerfer Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH 1/3] MIPS: Replace setup_percpu_irq() by request_percpu_irq() variant Message-ID: <82270883881f29f8ad4b289f915cdbb8620608f6.1586434781.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 Recently all usages of setup_irq() was replaced by request_irq() as allocators are ready by the time setup_irq() was invoked. Similarly setup_percpu_irq() can be replaced by request_percpu_irq(). But in the callers handled here __request_percpu_irq() has to be used as request_percpu_irq() does not give the user a chance to pass the flags, and IRQF_TIMER has to be passed here, so the variant __request_percpu_irq() is used. Signed-off-by: afzal mohammed --- arch/mips/include/asm/cevt-r4k.h | 1 - arch/mips/kernel/cevt-r4k.c | 11 ----------- arch/mips/sgi-ip27/ip27-timer.c | 13 +++++-------- arch/mips/sgi-ip30/ip30-timer.c | 6 +++--- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/arch/mips/include/asm/cevt-r4k.h b/arch/mips/include/asm/cevt-r4k.h index 2e13a038d260..5229eb34f28a 100644 --- a/arch/mips/include/asm/cevt-r4k.h +++ b/arch/mips/include/asm/cevt-r4k.h @@ -23,7 +23,6 @@ void mips_event_handler(struct clock_event_device *dev); int c0_compare_int_usable(void); irqreturn_t c0_compare_interrupt(int, void *); -extern struct irqaction c0_compare_irqaction; extern int cp0_timer_irq_installed; #endif /* __ASM_CEVT_R4K_H */ diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 17a9cbb8b3df..4ffa9f485d07 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c @@ -158,17 +158,6 @@ irqreturn_t c0_compare_interrupt(int irq, void *dev_id) return IRQ_NONE; } -struct irqaction c0_compare_irqaction = { - .handler = c0_compare_interrupt, - /* - * IRQF_SHARED: The timer interrupt may be shared with other interrupts - * such as perf counter and FDC interrupts. - */ - .flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED, - .name = "timer", -}; - - void mips_event_handler(struct clock_event_device *dev) { } diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index 61f3565f3645..6e2b58b47580 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c @@ -68,13 +68,6 @@ static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id) return IRQ_HANDLED; } -struct irqaction hub_rt_irqaction = { - .handler = hub_rt_counter_handler, - .percpu_dev_id = &hub_rt_clockevent, - .flags = IRQF_PERCPU | IRQF_TIMER, - .name = "hub-rt", -}; - /* * This is a hack; we really need to figure these values out dynamically * @@ -111,9 +104,13 @@ void hub_rt_clock_event_init(void) static void __init hub_rt_clock_event_global_init(void) { + int irq = IP27_RT_TIMER_IRQ; + irq_set_handler(IP27_RT_TIMER_IRQ, handle_percpu_devid_irq); irq_set_percpu_devid(IP27_RT_TIMER_IRQ); - setup_percpu_irq(IP27_RT_TIMER_IRQ, &hub_rt_irqaction); + if (__request_percpu_irq(irq, hub_rt_counter_handler, IRQF_TIMER, + "hub-rt", &hub_rt_clockevent) < 0) + pr_err("Failed to request percpu irq %d (hub-rt)\n", irq); } static u64 hub_rt_read(struct clocksource *cs) diff --git a/arch/mips/sgi-ip30/ip30-timer.c b/arch/mips/sgi-ip30/ip30-timer.c index d13e105478ae..dcc22eaddcda 100644 --- a/arch/mips/sgi-ip30/ip30-timer.c +++ b/arch/mips/sgi-ip30/ip30-timer.c @@ -52,11 +52,11 @@ void __init plat_time_init(void) int irq = get_c0_compare_int(); cp0_timer_irq_installed = 1; - c0_compare_irqaction.percpu_dev_id = &mips_clockevent_device; - c0_compare_irqaction.flags &= ~IRQF_SHARED; irq_set_handler(irq, handle_percpu_devid_irq); irq_set_percpu_devid(irq); - setup_percpu_irq(irq, &c0_compare_irqaction); + if (__request_percpu_irq(irq, c0_compare_interrupt, IRQF_TIMER, "timer", + &mips_clockevent_device) < 0) + pr_err("Failed to request percpu irq %d (timer)\n", irq); enable_percpu_irq(irq, IRQ_TYPE_NONE); ip30_heart_clocksource_init(); -- 2.18.0