Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5794438ybv; Wed, 12 Feb 2020 00:04:07 -0800 (PST) X-Google-Smtp-Source: APXvYqy+bOha+RL9mOSpzztHvDod/6Xm51VLiX+kimYPgfz3WTduR0OPsGiJaGQe0Pyk3IfWszAl X-Received: by 2002:aca:ebc3:: with SMTP id j186mr5266259oih.15.1581494647779; Wed, 12 Feb 2020 00:04:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581494647; cv=none; d=google.com; s=arc-20160816; b=E1Ict2I6Esza57q9ArOLcDfn0L/X5iLyoks9FdO3LKJu9AniEzSfOccP+bG6s3IuVh TDvmpijRzqpbVeXy1ZtCL8KgYDUcJDyNFtM6Bc+PFp08W9A8vtH9gDJK1SsiHHXkwBzo LJlrRPVvWR43dBDZuelxbZtjIhlvXFT8yiUoR4AEc8sD+dJfEPhirGkDq2wGPRnoRTTc jB7mtgjDdfIrcH2bPyHS1SKBc8sxQKwAFwBtRbUC7/g3vsrHM9nShF1j/aDVHIejf9mM UnzkwoM7X902UdDV21qsrg9EduSkMcnfQr9Y+Oqf4JUlovi5K3+UesYZH03+vOiNpfx0 jVcw== 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=mh5ve1clOQdwoBlgvdFQOY/xr1cX6ZXuLGLTs9NtboA=; b=jvolzJrOLXDj/PoymHkqLwuQY/D+cS0uzhVciP6q2+oSeCe+0KmVgmqZ1Ppnt73oAC 5AGBfi5JT/xM82aUKxIaUQzGYGHZq6tnszEEAI9W137+7rNGXyfMcYYxmiV2PYrvgfv9 ilx/XOMjBaFBlYTvMUG2bvJVP79vYELCsvjiFEz/pejWAgqSZRepxLJN/i1NJuPkElDp VbUqusNVh7Nb1U225z9ea7b4ksNLc+f78h5XHPYsXpzlZOBPn1AD8U0j7pRAdnlENiPD JRL19x5vKyOmrR1dbS0jcDWh7RJxEWEZWMCjukREjkId3M6UEWnmpizKmWxyym1BsVAE qD8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n1n6T4kJ; 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.03.50; Wed, 12 Feb 2020 00:04:07 -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=n1n6T4kJ; 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 S1728507AbgBLIDX (ORCPT + 99 others); Wed, 12 Feb 2020 03:03:23 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34247 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbgBLIDW (ORCPT ); Wed, 12 Feb 2020 03:03:22 -0500 Received: by mail-pg1-f195.google.com with SMTP id j4so800351pgi.1; Wed, 12 Feb 2020 00:03:22 -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=mh5ve1clOQdwoBlgvdFQOY/xr1cX6ZXuLGLTs9NtboA=; b=n1n6T4kJFtsezqzjNTIJbiRdniLbBs7C7ifuY43SPeXCeKrPCBcJIpIojykSSlc74F 6X31qwVyjoQpkgGL7Ss984xf9nq0ejM97+9gH4ERYkslfwcdeDW9Xtrbv2OG1tO9Ocy5 Z9dTEYxJbLgFbn8fZ2xm1LsUChLhjeNAMju3xYYIoCGY3WxN7R/J6d/9elf1jJvUXrZb anG+hdr1w695BArD+Zs46e9/kqdwF8t9OVPcH/hTx54BwWhI4o3rwl+wHUDURvdXS1Bf 4BOB/Z7NZX2tIGA3AKhmiLolDsw7OiJ5BwiSRDec/vagWEjz4RPfCQ57wxnW6PfnW0Ks 8OMA== 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=mh5ve1clOQdwoBlgvdFQOY/xr1cX6ZXuLGLTs9NtboA=; b=BnJvJ1N8BB3pA7zPD9LG6Ndgpw5K3F/xraOeyrdLtFPF5sO5T+Vz1EEvyV7bJk3t1X t6Br7i2GQYIp6ctr8g9U5UXdXjzmAuxIs31YRBoMRNG1XRDGZY4yNHhenLfnH6YvFv5L Mrx4DOxsmvzv5xoGoAN+f7KKIPwiQYsPMzVyc2uZNok9TsVDFhj5usDntw/7EYK4e3bW RW3WDqhg2I/iVdHb0eFAw6Ieq8sOOEe/yQwXmJ3lLbNoi0kU0MGb08DuuIn2TS/SrcFZ FYCuVyjebmPwNTdaTymp6WIUkuhZMw8AStmWIxV8kUSE3+Ev2C5dnVeV6kpew0U39rYK 3LHA== X-Gm-Message-State: APjAAAXAUv6qElHY7WSX0miYa354yFiz6pzngl/j2NCHLZWOrRfISJxi 3xCotWx15D3BJy832ruDMxQmWare+0k= X-Received: by 2002:a63:ed01:: with SMTP id d1mr10151600pgi.95.1581494601503; Wed, 12 Feb 2020 00:03:21 -0800 (PST) Received: from localhost ([106.51.21.91]) by smtp.gmail.com with ESMTPSA id g7sm7056749pfq.33.2020.02.12.00.03.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:03:21 -0800 (PST) Date: Wed, 12 Feb 2020 13:33:19 +0530 From: afzal mohammed To: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tony Luck , Fenghua Yu , Tom Vaden , Mike Rapoport , Andrew Morton , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 05/18] ia64: replace setup_irq() by request_irq() Message-ID: <14bfa52a434351ea6612d514b033e9dbb73a9727.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/ia64/kernel/irq_ia64.c | 42 ++++++++++-------------------- arch/ia64/kernel/mca.c | 51 +++++++++++-------------------------- 2 files changed, 29 insertions(+), 64 deletions(-) diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 8e91c86e8072..166a38dae663 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c @@ -351,11 +351,6 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction irq_move_irqaction = { - .handler = smp_irq_move_cleanup_interrupt, - .name = "irq_move" -}; - static int __init parse_vector_domain(char *arg) { if (!arg) @@ -586,28 +581,15 @@ static irqreturn_t dummy_handler (int irq, void *dev_id) return IRQ_NONE; } -static struct irqaction ipi_irqaction = { - .handler = handle_IPI, - .name = "IPI" -}; - /* * KVM uses this interrupt to force a cpu out of guest mode */ -static struct irqaction resched_irqaction = { - .handler = dummy_handler, - .name = "resched" -}; - -static struct irqaction tlb_irqaction = { - .handler = dummy_handler, - .name = "tlb_flush" -}; #endif void -ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action) +ia64_native_register_percpu_irq(ia64_vector vec, const char *name, + irq_handler_t handler) { unsigned int irq; @@ -615,8 +597,9 @@ ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action) BUG_ON(bind_irq_vector(irq, vec, CPU_MASK_ALL)); irq_set_status_flags(irq, IRQ_PER_CPU); irq_set_chip(irq, &irq_type_ia64_lsapic); - if (action) - setup_irq(irq, action); + if (handler) + if (request_irq(irq, handler, 0, name, NULL)) + pr_err("request_irq() for %s failed", name); irq_set_handler(irq, handle_percpu_irq); } @@ -624,9 +607,10 @@ void __init ia64_native_register_ipi(void) { #ifdef CONFIG_SMP - register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction); - register_percpu_irq(IA64_IPI_RESCHEDULE, &resched_irqaction); - register_percpu_irq(IA64_IPI_LOCAL_TLB_FLUSH, &tlb_irqaction); + register_percpu_irq(IA64_IPI_VECTOR, "IPI", handle_IPI); + register_percpu_irq(IA64_IPI_RESCHEDULE, "resched", dummy_handler); + register_percpu_irq(IA64_IPI_LOCAL_TLB_FLUSH, "tlb_flush", + dummy_handler); #endif } @@ -635,10 +619,12 @@ init_IRQ (void) { acpi_boot_init(); ia64_register_ipi(); - register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL); + register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL, NULL); #ifdef CONFIG_SMP - if (vector_domain_type != VECTOR_DOMAIN_NONE) - register_percpu_irq(IA64_IRQ_MOVE_VECTOR, &irq_move_irqaction); + if (vector_domain_type != VECTOR_DOMAIN_NONE) { + register_percpu_irq(IA64_IRQ_MOVE_VECTOR, "irq_move", + smp_irq_move_cleanup_interrupt); + } #endif #ifdef CONFIG_PERFMON pfm_init_percpu(); diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index bf2cb9294795..f4be4ad7bf0d 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -1766,36 +1766,6 @@ ia64_mca_disable_cpe_polling(char *str) __setup("disable_cpe_poll", ia64_mca_disable_cpe_polling); -static struct irqaction cmci_irqaction = { - .handler = ia64_mca_cmc_int_handler, - .name = "cmc_hndlr" -}; - -static struct irqaction cmcp_irqaction = { - .handler = ia64_mca_cmc_int_caller, - .name = "cmc_poll" -}; - -static struct irqaction mca_rdzv_irqaction = { - .handler = ia64_mca_rendez_int_handler, - .name = "mca_rdzv" -}; - -static struct irqaction mca_wkup_irqaction = { - .handler = ia64_mca_wakeup_int_handler, - .name = "mca_wkup" -}; - -static struct irqaction mca_cpe_irqaction = { - .handler = ia64_mca_cpe_int_handler, - .name = "cpe_hndlr" -}; - -static struct irqaction mca_cpep_irqaction = { - .handler = ia64_mca_cpe_int_caller, - .name = "cpe_poll" -}; - /* Minimal format of the MCA/INIT stacks. The pseudo processes that run on * these stacks can never sleep, they cannot return from the kernel to user * space, they do not appear in a normal ps listing. So there is no need to @@ -2056,18 +2026,23 @@ void __init ia64_mca_irq_init(void) * Configure the CMCI/P vector and handler. Interrupts for CMC are * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c). */ - register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction); - register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction); + register_percpu_irq(IA64_CMC_VECTOR, "cmc_hndlr", + ia64_mca_cmc_int_handler); + register_percpu_irq(IA64_CMCP_VECTOR, "cmc_poll", + ia64_mca_cmc_int_caller); ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */ /* Setup the MCA rendezvous interrupt vector */ - register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction); + register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, "mca_rdzv", + ia64_mca_rendez_int_handler); /* Setup the MCA wakeup interrupt vector */ - register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction); + register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, "mca_wkup", + ia64_mca_wakeup_int_handler); /* Setup the CPEI/P handler */ - register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction); + register_percpu_irq(IA64_CPEP_VECTOR, "cpe_poll", + ia64_mca_cpe_int_caller); } /* @@ -2108,7 +2083,11 @@ ia64_mca_late_init(void) if (irq > 0) { cpe_poll_enabled = 0; irq_set_status_flags(irq, IRQ_PER_CPU); - setup_irq(irq, &mca_cpe_irqaction); + if (request_irq(irq, ia64_mca_cpe_int_handler, + 0, "cpe_hndlr", NULL)) { + pr_err("request_irq() on %s failed\n", + "cpe_hndlr"); + } ia64_cpe_irq = irq; ia64_mca_register_cpev(cpe_vector); IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", -- 2.24.1