Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1847822ybv; Sun, 23 Feb 2020 16:50:20 -0800 (PST) X-Google-Smtp-Source: APXvYqw+MENe8fbvlABjgr0KpV5q2Nm3No/EKo1VY4VsW7Mii1Bp0jbFdg5lR51GNdDNc0a9VYEc X-Received: by 2002:aca:5150:: with SMTP id f77mr10412681oib.52.1582505419936; Sun, 23 Feb 2020 16:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582505419; cv=none; d=google.com; s=arc-20160816; b=NvJBOaPKTuFqklEh8Ra76O0jjtzYbH2JoSEsEqqZo2vRnA+ymRbD5VuXgqIeTQJw+g kBV2D75RqywqJqXqI1Luc2zsKkbxU43Kxw0hlGLDy96p+JfjVjxQDhMZsConqknGLI65 1abvXMyxl2cNiKSvtIRwhczRgR4ylXDTZIFg64S/1lMl04utR4TtSg6zcDDbGVByitfY x/Lu6kR3LkCix2M86xycyhRR6M3LTcGIaMmy+qkeRZWSL9ZPv8zbHBm/Etd1Kw3+jWbb GAN1jzX+8/WeZr8ShN01buNyga3XxJMpolkUUUEIB+4r+Pkso2PhoFMXMqjoccP/OM8f 91pA== 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=Meowi5DfMOFxxX4xOwtpguRWIG7M6enGckZnIU74nGo=; b=lsK1Rsu2xV4tZZaHQ/5i6GV8n76jPcwGlIsaVFKvuwrEp2kR0gfcCo0FYKGFyHevkG xhqfypPy8Lpbs+83InhOc1Wr373+QmUq6/yq7niSZaxy4waFssioy+qRn/a6SQSPI4qy jQNPMMz21pmU5bSzPhPvUtPbLUZ0leGmlH2JRD9GHqnIQmOJqN0X94Ph/2G7NQW0MV25 QCEvIKolWeA/RpUJha+asuzziHjUZeRW+i5CvQ7kUZz3Is2uhUZNzU7NeJOW0LS6kxDa FDmderddH14UOPK0N+RRHRzir/oFCRHjSEJRRdKYUj+nufV/VuPhj3vm1KAWdDnjJ+Uc 7iKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="W/7+FoB+"; 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 k8si5443174otp.69.2020.02.23.16.50.07; Sun, 23 Feb 2020 16:50:19 -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="W/7+FoB+"; 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 S1727238AbgBXAti (ORCPT + 99 others); Sun, 23 Feb 2020 19:49:38 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:34966 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbgBXAth (ORCPT ); Sun, 23 Feb 2020 19:49:37 -0500 Received: by mail-pl1-f195.google.com with SMTP id g6so3338908plt.2; Sun, 23 Feb 2020 16:49:37 -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=Meowi5DfMOFxxX4xOwtpguRWIG7M6enGckZnIU74nGo=; b=W/7+FoB+ozkb+Xyyu4fSfdCAdsMwfsUrHmvM+zIYWkrC4IDkacHAv5yJjhxw8eGbHM K5zmd2tsZ08+yz4hXj+t1SrUrpYWok5Hehs29Fz2y8KASRqHGUnVIFRN/iHcUH3bougI ME62u7PNQFHIMrcxB8YPUf1ctok/reiQZ6qKxXSOUJ7YPvfAUHR49P2t1E3OPUwh5pX8 JgqwSSB+JyvlSC+8TDPyj2JpVR0aah6/fkKqo9563ICz3Ii436VD/3yS3FwUxGeFzAdS V0U4cLpZ6qN6UwvgVNSJ8JLZIDHBtuJvhRRqz6AUCbL5kpUaWl8uE5GZOmC8oN02y3FT JUUw== 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=Meowi5DfMOFxxX4xOwtpguRWIG7M6enGckZnIU74nGo=; b=ZI6hNGNsMZ2ptmHBcQd6eJvqCFg8q9Y8cz5ovdof4QjuoZpkT3MmziEQu4qqpJKzdo lTSZcIIXLSNGbfeKKRzZFm4Pdy9PtNvrxJu/ztuF7GP36w52W+mI0K6tqHS+NSlTJ5Lz N/hPoqPxtDvQY+HF4Es7SCrcrcjoETPebcaOKAUQyV19mKy6j0T3wD2lxXlnluTDb0X3 TI9YZNHQaQ8H/PH0vEneqmRCa4cYFThq9bSgtEZ/QlGJUsOM7n8VRhhsBjapzAiVQT7F iwZSUyoBo20vNdDzpgRxpC00/mKaMAJ9KEd5dOERUjSO3fvTraL5Dk+T10hHKBuDdJgn kN3g== X-Gm-Message-State: APjAAAWYCXwi4hdHm3mN/JkoTCJHy2to77e+JXoGmIfhnKkehjcEbwST oB997NFrhuVBrdT7l0FEPsLNIbPVhA8= X-Received: by 2002:a17:902:8a81:: with SMTP id p1mr47501862plo.284.1582505376985; Sun, 23 Feb 2020 16:49:36 -0800 (PST) Received: from localhost ([106.51.232.35]) by smtp.gmail.com with ESMTPSA id 70sm10063367pfw.140.2020.02.23.16.49.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Feb 2020 16:49:36 -0800 (PST) Date: Mon, 24 Feb 2020 06:19:35 +0530 From: afzal mohammed To: linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Brian Cain , Richard Fontana , Greg Kroah-Hartman , Allison Randal , Thomas Gleixner , Alexios Zavras Subject: [PATCH v2 04/18] hexagon: replace setup_irq() by request_irq() Message-ID: <44775ff418e0b784311c1d86aae4927da7fcc645.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 --- v2: * Replace pr_err("request_irq() on %s failed" by pr_err("%s: request_irq() failed" * Commit message massage arch/hexagon/kernel/smp.c | 17 ++++++++--------- arch/hexagon/kernel/time.c | 11 +++-------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c index 0bbbe652a513..67f4b0bff250 100644 --- a/arch/hexagon/kernel/smp.c +++ b/arch/hexagon/kernel/smp.c @@ -114,12 +114,6 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg) local_irq_restore(flags); } -static struct irqaction ipi_intdesc = { - .handler = handle_ipi, - .flags = IRQF_TRIGGER_RISING, - .name = "ipi_handler" -}; - void __init smp_prepare_boot_cpu(void) { } @@ -155,7 +149,9 @@ void start_secondary(void) cpu = smp_processor_id(); - setup_irq(BASE_IPI_IRQ + cpu, &ipi_intdesc); + if (request_irq(BASE_IPI_IRQ + cpu, handle_ipi, IRQF_TRIGGER_RISING, + "ipi_handler", NULL)) + pr_err("%s: request_irq() failed\n", "ipi_handler"); /* Register the clock_event dummy */ setup_percpu_clockdev(); @@ -213,8 +209,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus) set_cpu_present(i, true); /* Also need to register the interrupts for IPI */ - if (max_cpus > 1) - setup_irq(BASE_IPI_IRQ, &ipi_intdesc); + if (max_cpus > 1) { + if (request_irq(BASE_IPI_IRQ, handle_ipi, IRQF_TRIGGER_RISING, + "ipi_handler", NULL)) + pr_err("%s: request_irq() failed\n", "ipi_handler"); + } } void smp_send_reschedule(int cpu) diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c index f99e9257bed4..26550e46cf91 100644 --- a/arch/hexagon/kernel/time.c +++ b/arch/hexagon/kernel/time.c @@ -143,13 +143,6 @@ static irqreturn_t timer_interrupt(int irq, void *devid) return IRQ_HANDLED; } -/* This should also be pulled from devtree */ -static struct irqaction rtos_timer_intdesc = { - .handler = timer_interrupt, - .flags = IRQF_TIMER | IRQF_TRIGGER_RISING, - .name = "rtos_timer" -}; - /* * time_init_deferred - called by start_kernel to set up timer/clock source * @@ -195,7 +188,9 @@ void __init time_init_deferred(void) #endif clockevents_register_device(ce_dev); - setup_irq(ce_dev->irq, &rtos_timer_intdesc); + if (request_irq(ce_dev->irq, timer_interrupt, + IRQF_TIMER | IRQF_TRIGGER_RISING, "rtos_timer", NULL)) + pr_err("%s: request_irq() failed\n", "rtos_timer"); } void __init time_init(void) -- 2.25.1