Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5795188ybv; Wed, 12 Feb 2020 00:04:51 -0800 (PST) X-Google-Smtp-Source: APXvYqz+WC/MwJmgd9gVQmFpbEEpJcjn9F0jN5Rucq56SqowzCgKfptfV7UeO+ZvTFF2v1cuZah2 X-Received: by 2002:a9d:6a06:: with SMTP id g6mr7721712otn.305.1581494691539; Wed, 12 Feb 2020 00:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581494691; cv=none; d=google.com; s=arc-20160816; b=IwMainJ9/0Gltp7dezb4q7EAkzDu8KMI4ghERzWlAnVCfGB/xC2Px+CmNjzTPNDntX djhNTxPlJx49lcyGMb6mEAgCVbxVfxLLnZytVUA4BX+uUf/kjuzOo8Op7JfMY8hdbN7V qYLkDQg7imZFLxSQw22PJfqGRE6A4hz+Ja7jqnPEMfk69sT63v7aZ6AvRLD6i2HOoRa3 bD02LpWETkD3RnrKJ9ADwepkm3VgfsUp+wZtTNnJBEEkh3HJhz/i7Kw7vX9PBqgUmkoD hgxu3VmtFMhg+y7grITNirUvX+Bq3j3x02rPZyhpvAi4hiXOYLeXAub3IG5hATSKcZhd XGkA== 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=js3m1GRJWAzwHRVNbuv8Yo8F0b3Y/0tD1p72T0JsIgY=; b=kSizMeSnFp2MnZ/n+iHxaqJiWJ2VIq5UzESQdFPpMhiGDlOM7lPn9d4Y/x5ZLJlsgo 3l8+ApDghKvjp9+v0nrbpxV7YeRQvlgJeT7Pg8/jMtCnnlzmuATI+EZR445znfLsHj1s itw5JMp6Err30J8z0HDn7rbPS5GZ8rod3ZGizWZYTeuargjerxv/tgO78z9L+Dwh7l9q WVDQWXgJAZi0/gmIKe1rrGXnTB0YKCtkHUeyhb4B+sx/RZ/HdTcgQLtUmYJQcTXlZy0F YomsPAL1dVuFRsfynhSuSp+F0QRx5ix6loPmGTzvCldgKtw9LxJ+Q3ox3Ln3jfJci1+x DWbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iA394d5U; 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 l26si3570956otd.143.2020.02.12.00.04.35; Wed, 12 Feb 2020 00:04:51 -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=iA394d5U; 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 S1728481AbgBLIDJ (ORCPT + 99 others); Wed, 12 Feb 2020 03:03:09 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:36930 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728250AbgBLIDI (ORCPT ); Wed, 12 Feb 2020 03:03:08 -0500 Received: by mail-pj1-f68.google.com with SMTP id m13so543210pjb.2; Wed, 12 Feb 2020 00:03:08 -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=js3m1GRJWAzwHRVNbuv8Yo8F0b3Y/0tD1p72T0JsIgY=; b=iA394d5UYe1aB937cb4A8d6BIgNag9uRRjNEHG3KXbE83HUYelShMerBc/GzaJOTww UH0MjxzHm30XlYL4X1//xmuWvii0HglyFyf+4G4H0iMEaS/SMz+AsyOMCckoGeZhr79i gsp9h84e42oCD3ZkG0LlYTkpQwv7tbl9FTMxIs4eSRFVPpC2yIDmT/KQewIOC+7rdiOJ VikWfWXRy7xU4XxWt8rgKNZe5YTNzHZ1FCppNwBqvW0HVr4EypvkxIgiPIx1gLDD+KlM DL+AvKcBeI4MnD4VszncCPsOwMN2GMxaxMZFuf8WHdIHc5zilrXJoyVzTzNEvcGLBIWh PrEg== 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=js3m1GRJWAzwHRVNbuv8Yo8F0b3Y/0tD1p72T0JsIgY=; b=Jifaf+fGnJ1vOUHDckTq/3/mIUAAsLTkoH3Yf7L1zxagVjK4y/Z7HJVh7eT9Viy6fy 9fZ4GEUNcnLQzEYaH/aJR8NSN8iNEmPxEPfwdsPqNAJto/xv+raxeaqj/abBuVciSpQo v4KRAFoM7GI0yvz343KANROUac0h5T2p+GIazZrWUsipqVkv+Ldj/LkpdRx16Y2wKBnm /hFTQdaeYkvK4MhwMiCLzuVCt2/Pq/mGxqpjfff2A+tJTQdToidccmtX24Cbw65Wq57N PqVZWVQ1UJWjs/QqGnV05/aUhkPfxFMLrRghmxHGBK37pNICKnW/32+zAZEh+b8zeYI6 9EKA== X-Gm-Message-State: APjAAAVT9Qvhgzp66qUkKh+b9eftlwcLttXm3BB6QzNDYaZfstO/wBV1 h4ArBk6BK5/fSU1q7u/Nc+0eZPpkvrU= X-Received: by 2002:a17:902:503:: with SMTP id 3mr7382210plf.78.1581494588006; Wed, 12 Feb 2020 00:03:08 -0800 (PST) Received: from localhost ([106.51.21.91]) by smtp.gmail.com with ESMTPSA id c6sm6653064pgk.78.2020.02.12.00.03.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:03:07 -0800 (PST) Date: Wed, 12 Feb 2020 13:33:05 +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 04/18] hexagon: replace setup_irq() by request_irq() Message-ID: <0413a7d89e648c6259b466b07b635a4509cdefd5.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/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..50a75af5540b 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("request_irq() on %s 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("request_irq() on %s 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..f5a558a9d287 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("request_irq() on %s failed\n", "rtos_timer"); } void __init time_init(void) -- 2.24.1