Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp475368ybh; Thu, 12 Mar 2020 05:35:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtPlYcnTQaaoSq8DrB2Lezd765IpJeFJkDQ87M8n8bNciAxKlMJ03GE5br7L31uIdGd0ed8 X-Received: by 2002:a9d:48d:: with SMTP id 13mr5719769otm.249.1584016546379; Thu, 12 Mar 2020 05:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584016546; cv=none; d=google.com; s=arc-20160816; b=OFgcVTLiUbuxgW/sP8/4fWD5r3SimUmNtbv7Nf/5vekdoaH8rN2tvxfbO7Mf9Wdo7T gvROyFqAGgcu/Sxnyki8f66rvCPR8ucv0FrCvjRDs7ZIIny7gMihTUIS56H5Sxgoc9Bp umg8Of/xV2o5Wxft2EeR959zkGZgMjdChLxJckOl0vBL7JWS9TfYaSGuoxhznLDgXuCZ fGIaAISdnE8DbcIICh1pfQKPjbYXUxfFVotYsSxJFi32apZ20vDGyDbqHjW363hS3uqT RxrOxHHevAPdwUbVhbrIOoMwWLMDKj7MEneeKcjyElBkoGaaNkdolhcN/XIKiFvozeKw kW5A== 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=uArEIWDizojf1gfTMVx1qCJUduEJPhHKxNwomQ/vzcc=; b=M5ssV6Lmmftrl10iUmdJNqoVAoayBFzd+JwMEeA1mW1lSOIFyw0+Lm8w5B/HkoZOSv QweaANBDCBMGIv5t2WpAZuRGbsP/efJflNq8ahCo54OiMWaCAEkAUOelelLS5hqi4VGD YaGB+OdKNVMfp6n5VvqKXJ9qAHsH22MJ34T5v+ipqsSAU6KrkvcqVPpCEviTOvbEMG4j f4SBOdPvHSiqUYrPS2D6OMUD2C1kvVV0gFmkd/HnsT2hHVIL8HlZDiJGOp4TcrxxGnu1 nIigyP8Ga8J9MU08+iKCN7gIdQVmaelkZ42PQzB7zALQvpdCNR78H65ek95qVxzblXCJ HSPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=bxRBBSCr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si2691666oti.311.2020.03.12.05.35.33; Thu, 12 Mar 2020 05:35:46 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=bxRBBSCr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726677AbgCLMek (ORCPT + 99 others); Thu, 12 Mar 2020 08:34:40 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:42192 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726299AbgCLMek (ORCPT ); Thu, 12 Mar 2020 08:34:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uArEIWDizojf1gfTMVx1qCJUduEJPhHKxNwomQ/vzcc=; b=bxRBBSCrPliEVChheadid/egV 5hQidV2aAqDPPk8Q+WIyDRA8K7d/p4tvDMUrVvU9rrRjUMyN7FM6G6XoDXIFxOCjRCCIA7ROvGYKh S+ul/OBJQCx4kykw0TyI5hOC05w8GkxVhss6KrkUmZeCmJzbCAKYdfBjv3qeWaizqTqsVqti4rLhl iRMdWyecuMT/JH24hvKEqM0xEZs+/bKLomgMFjlfxKAgGlrqvK4xXgol8kEnz8sofW3xNfolo3gDj 9xOHOKpMnVz0ThDJ6FZJ8YRUs1ohapG7qRe5jjNwMsyV0V5wmSBEt+jZ1+mjIJy6UPbUQ4qxuc9fn z0tvbDfxw==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:59536) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jCN2o-0001Bp-3W; Thu, 12 Mar 2020 12:34:34 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jCN2m-0006KF-PN; Thu, 12 Mar 2020 12:34:32 +0000 Date: Thu, 12 Mar 2020 12:34:32 +0000 From: Russell King - ARM Linux admin To: afzal mohammed Cc: Viresh Kumar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] ARM: footbridge: replace setup_irq() by request_irq() Message-ID: <20200312123432.GZ25745@shell.armlinux.org.uk> References: <20200301122131.3902-1-afzal.mohd.ma@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200301122131.3902-1-afzal.mohd.ma@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 01, 2020 at 05:51:31PM +0530, afzal mohammed wrote: > request_irq() is preferred over setup_irq(). Invocations of setup_irq() > occur after memory allocators are ready. > > 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(). > > [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos > > Signed-off-by: afzal mohammed > --- > Hi sub-arch maintainers, > > If the patch is okay, please take it thr' your tree. This patch causes a build warning: arch/arm/mach-footbridge/isa-irq.c:113:15: warning: unused variable 'irq' [-Wunused-variable] because you introduce a new 'int irq' variable in a sub-block where the parent already declares 'irq', causing the parent 'irq' to be unused. Hence, I'm dropping this patch. I think you need to look more carefully at the code you are modifying, and maybe even build test it. Cross compilers are available from kernel.org. Russell. > > Regards > afzal > > v3: > * Split out from series, also create subarch level patch as Thomas > suggested to take it thr' respective maintainers > * Modify string displayed in case of error as suggested by Thomas > * Re-arrange code as required to improve readability > * Remove irrelevant parts from commit message & improve > > v2: > * Replace pr_err("request_irq() on %s failed" by > pr_err("%s: request_irq() failed" > * Commit message massage > > arch/arm/mach-footbridge/dc21285-timer.c | 11 +++-------- > arch/arm/mach-footbridge/isa-irq.c | 10 ++++------ > arch/arm/mach-footbridge/isa-timer.c | 11 +++-------- > 3 files changed, 10 insertions(+), 22 deletions(-) > > diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c > index f76212d2dbf1..2908c9ef3c9b 100644 > --- a/arch/arm/mach-footbridge/dc21285-timer.c > +++ b/arch/arm/mach-footbridge/dc21285-timer.c > @@ -101,13 +101,6 @@ static irqreturn_t timer1_interrupt(int irq, void *dev_id) > return IRQ_HANDLED; > } > > -static struct irqaction footbridge_timer_irq = { > - .name = "dc21285_timer1", > - .handler = timer1_interrupt, > - .flags = IRQF_TIMER | IRQF_IRQPOLL, > - .dev_id = &ckevt_dc21285, > -}; > - > /* > * Set up timer interrupt. > */ > @@ -118,7 +111,9 @@ void __init footbridge_timer_init(void) > > clocksource_register_hz(&cksrc_dc21285, rate); > > - setup_irq(ce->irq, &footbridge_timer_irq); > + if (request_irq(ce->irq, timer1_interrupt, IRQF_TIMER | IRQF_IRQPOLL, > + "dc21285_timer1", &ckevt_dc21285)) > + pr_err("Failed to request irq %d (dc21285_timer1)", ce->irq); > > ce->cpumask = cpumask_of(smp_processor_id()); > clockevents_config_and_register(ce, rate, 0x4, 0xffffff); > diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c > index 88a553932c33..16c5455199e8 100644 > --- a/arch/arm/mach-footbridge/isa-irq.c > +++ b/arch/arm/mach-footbridge/isa-irq.c > @@ -96,11 +96,6 @@ static void isa_irq_handler(struct irq_desc *desc) > generic_handle_irq(isa_irq); > } > > -static struct irqaction irq_cascade = { > - .handler = no_action, > - .name = "cascade", > -}; > - > static struct resource pic1_resource = { > .name = "pic1", > .start = 0x20, > @@ -146,6 +141,8 @@ void __init isa_init_irq(unsigned int host_irq) > } > > if (host_irq != (unsigned int)-1) { > + int irq = IRQ_ISA_CASCADE; > + > for (irq = _ISA_IRQ(0); irq < _ISA_IRQ(8); irq++) { > irq_set_chip_and_handler(irq, &isa_lo_chip, > handle_level_irq); > @@ -160,7 +157,8 @@ void __init isa_init_irq(unsigned int host_irq) > > request_resource(&ioport_resource, &pic1_resource); > request_resource(&ioport_resource, &pic2_resource); > - setup_irq(IRQ_ISA_CASCADE, &irq_cascade); > + if (request_irq(irq, no_action, 0, "cascade", NULL)) > + pr_err("Failed to request irq %d (cascade)\n", irq); > > irq_set_chained_handler(host_irq, isa_irq_handler); > > diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c > index 82f45591fb2c..723e3eae995d 100644 > --- a/arch/arm/mach-footbridge/isa-timer.c > +++ b/arch/arm/mach-footbridge/isa-timer.c > @@ -25,17 +25,12 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) > return IRQ_HANDLED; > } > > -static struct irqaction pit_timer_irq = { > - .name = "pit", > - .handler = pit_timer_interrupt, > - .flags = IRQF_TIMER | IRQF_IRQPOLL, > - .dev_id = &i8253_clockevent, > -}; > - > void __init isa_timer_init(void) > { > clocksource_i8253_init(); > > - setup_irq(i8253_clockevent.irq, &pit_timer_irq); > + if (request_irq(i8253_clockevent.irq, pit_timer_interrupt, > + IRQF_TIMER | IRQF_IRQPOLL, "pit", &i8253_clockevent)) > + pr_err("Failed to request irq %d(pit)\n", i8253_clockevent.irq); > clockevent_i8253_init(false); > } > -- > 2.25.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up