Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4293898ybv; Tue, 25 Feb 2020 17:13:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzwh/9Y40SSo13mpREgfmp/rF5w40C7BTUgtxgoLOecV6rZXgE+WUhKccwmubCsJoVJiVvq X-Received: by 2002:aca:b187:: with SMTP id a129mr1276475oif.175.1582679598478; Tue, 25 Feb 2020 17:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582679598; cv=none; d=google.com; s=arc-20160816; b=PhYVb9mtpYxSqVjRCe1whvj2t4tva5TjopckVXHk/2SgN5tshx6+uMfGWhbtzbfgBw s9ItScx9dQ8wrXBm6uLJDp8J7hQfg+vr9lotx8fYsZm1yWtPrqYtlZgpUCA7pEGY1ZLJ rMXjnM9hff8BC3MoHQyQvzb9HA8Hi5B3ZfSE/stKTdRBhr2dJHcfdE3eXxozRDSa70oO JQDDHyYEtS9jqefpYgfvZ5VlZoWUdBzq8dREfY5kGYYWU2MzVPfvHIMSH8TN2ik4xSNW pCZffAkwQrLTi8dVuD73fLxqTrehpEA4U3HJwNaE5xzZpkYkeJb/yfjJqpSFTbtI811i NkBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=6u277TXkKiUHsIWXRnjqRTKYxw+eSC9uWr1wnxtQGK4=; b=kz2QYHoSHaIn9jbK52KFXcKPsHqKaFf8Qm6AOMq+0yKwynLIBUwCNV2v+7xrX1t5YB XgIqOS0UsjL1bFaV0UPqnoRDkshjSnfCTn2VHZjmdT1xMiDEZXR0MpQAgufrHD/Tu1kr l+hjvqPt/LrK6OJJ4S5jpcgBHWW3qlHkjNQ+W2FGGVat42TtMlFN4fpWwd55d95HpKz6 EfVP/zFWAxlnitYv93cC6PQ6PR29kJJPxVXvvq9fs148Dmjv8kDgr0dVhAu5/g021SBZ iR2WFwipy96zGGUclSovm297jR3TSDoA3s4Lb6QVJ6JVbl71WhcMQSdO8ZsfVoXpxIcy AJag== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y71si273402oia.82.2020.02.25.17.13.05; Tue, 25 Feb 2020 17:13:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbgBZBL5 (ORCPT + 99 others); Tue, 25 Feb 2020 20:11:57 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:50308 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729540AbgBZBL5 (ORCPT ); Tue, 25 Feb 2020 20:11:57 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id B1ED329F75; Tue, 25 Feb 2020 20:11:53 -0500 (EST) Date: Wed, 26 Feb 2020 12:11:55 +1100 (AEDT) From: Finn Thain To: Greg Ungerer cc: afzal mohammed , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Geert Uytterhoeven Subject: Re: [PATCH v2 06/18] m68k: Replace setup_irq() by request_irq() In-Reply-To: <73c3ad08-963d-fea2-91d7-b06e4ef8d3ef@linux-m68k.org> Message-ID: References: <00b0bf964278dd0bb3e093283994399ff796cca5.1582471508.git.afzal.mohd.ma@gmail.com> <73c3ad08-963d-fea2-91d7-b06e4ef8d3ef@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Feb 2020, Greg Ungerer wrote: > Hi Afzal, > > On 24/2/20 10:50 am, afzal mohammed wrote: > > 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 > > Tested-by: Greg Ungerer # ColdFire > > --- > > > > v2: > > * Replace pr_err("request_irq() on %s failed" by > > pr_err("%s: request_irq() failed" > > * Commit message massage > > * remove now irrelevant comment lines at 3 places > > > > arch/m68k/68000/timers.c | 11 ++--------- > > arch/m68k/coldfire/pit.c | 11 ++--------- > > arch/m68k/coldfire/sltimers.c | 19 +++++-------------- > > arch/m68k/coldfire/timers.c | 21 +++++---------------- > > 4 files changed, 14 insertions(+), 48 deletions(-) > > > > diff --git a/arch/m68k/68000/timers.c b/arch/m68k/68000/timers.c > > index 71ddb4c98726..55a76a2d3d58 100644 > > --- a/arch/m68k/68000/timers.c > > +++ b/arch/m68k/68000/timers.c > > @@ -68,14 +68,6 @@ static irqreturn_t hw_tick(int irq, void *dummy) > > /***************************************************************************/ > > -static struct irqaction m68328_timer_irq = { > > - .name = "timer", > > - .flags = IRQF_TIMER, > > - .handler = hw_tick, > > -}; > > - > > > > -/***************************************************************************/ > > - > > static u64 m68328_read_clk(struct clocksource *cs) > > { > > unsigned long flags; > > @@ -106,7 +98,8 @@ void hw_timer_init(irq_handler_t handler) > > TCTL = 0; > > /* set ISR */ > > - setup_irq(TMR_IRQ_NUM, &m68328_timer_irq); > > + if (request_irq(TMR_IRQ_NUM, hw_tick, IRQF_TIMER, "timer", NULL)) > > + pr_err("%s: request_irq() failed\n", "timer"); > > Why not just: > > pr_err("timer: request_irq() failed\n"); > I believe that the compiler would coalesce the two "timer" string constants in the patch from Afzal (as per my suggestion). I suspect that your version costs a few extra bytes everywhere it appears (but I didn't check). > And maybe would it be useful to print out the error return code from a > failed request_irq()? What about displaying the requested IRQ number as > well? Just a thought. > That error would almost always be -EBUSY, right? Moreover, compare this change, - setup_irq(TMR_IRQ_NUM, &m68328_timer_irq); + request_irq(TMR_IRQ_NUM, hw_tick, IRQF_TIMER, "timer", NULL); with this change, + int err; - setup_irq(TMR_IRQ_NUM, &m68328_timer_irq); + err = request_irq(TMR_IRQ_NUM, hw_tick, IRQF_TIMER, "timer", NULL); + if (err) + return err; Isn't the latter change the more common pattern? It prints nothing. And arguably, the former example is actually the change that's described in the commit description. This patch seems to be making two orthogonal changes but I'll leave that question to the maintainer. (I'm not really trying to NAK this patch.)