From patchwork Fri Mar 27 11:02:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: afzal mohammed X-Patchwork-Id: 11462203 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACB716CA for ; Fri, 27 Mar 2020 11:02:43 +0000 (UTC) Received: by mail.kernel.org (Postfix) id A7E43206F6; Fri, 27 Mar 2020 11:02:43 +0000 (UTC) Delivered-To: soc@kernel.org Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F723206F1 for ; Fri, 27 Mar 2020 11:02:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CI1DZ0ga" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F723206F1 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=afzal.mohd.ma@gmail.com Received: by mail-pj1-f68.google.com with SMTP id ng8so3702623pjb.2 for ; Fri, 27 Mar 2020 04:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=lep9LBz31iclaeiYHheN3KyAvNFVzhS7253SWJ4Fff4=; b=CI1DZ0ga1FfN81t4GUkMC31pdfbXIFBcqQj1fgwLNpEMaCwsnpGWQ/1y8ANkkBJP+F lZeMuOgqhp9ywbTQA/O0+TqinEBahP6/0pkS0cBne0M1RwrawDsC8+9ygh1McCoJmCTl jaqpVhOX18Fi/jrf4+CehuolWNiC4lnHhPivJaiiGRU4wX3xoE9mXplccb2PtQB7fYCy sEUBqOEUiAYkAl41PuC8Za0QeFSqqtVIizSO71LHectrvBf2N6RiGTb4Y98PaZc5Zbss TlrneMZppptQ2N1Dks8Ubd//rUs6dymQP0nTm52jrfNaD0PQNCyC9chC2EUvvKqH+N+9 d3Fw== 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:subject:message-id:mime-version :content-disposition:user-agent; bh=lep9LBz31iclaeiYHheN3KyAvNFVzhS7253SWJ4Fff4=; b=hsI8ahAldeownfCEhTm+mYikZ407A1byEqYEESzwc9nQB1iYZpkYrUfLTt232oU8NC rVK/cAlmXR5PITDt/mcP2J4Xw/932DGseF6eRR78ad17uCxoMEyE29V/tso3Z06oeofS H/RicSPal8PM0+4RQL5dZePcYy4I22wCaiclnsr/GeEGcUDFqiIvLl5zn1wK/QrIzR4X sFkFjmvF1ZBdsbUy+bjCHxrAaVSi0/Idrrg1riYh/+G22HAQ4Cscygw7netNqRRMJ5kz lEIPuDVa+x+dt3OAtYRh2FN3a6IRQULZuyYSWs6V126JoOWlMBLGiDiXHxsEPXXSrJCf viqQ== X-Gm-Message-State: ANhLgQ0zdR2O2vkrNuMeshtOeH+4M4utrL0gzHmn0OKJpvhU1NBja6vm pCVCVfmjDV9cDlUsUg+XQmQf/wVl X-Google-Smtp-Source: ADFU+vvZz+CACe8cogiMzmR9EzGHdL+VSpPcwygbd7k5hgEoqVLEFpX9xQ/gXanQ5qNUGDaZ+4JdSQ== X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr12796902plp.40.1585306962413; Fri, 27 Mar 2020 04:02:42 -0700 (PDT) Received: from localhost ([183.82.181.40]) by smtp.gmail.com with ESMTPSA id f69sm3947060pfa.124.2020.03.27.04.02.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 04:02:41 -0700 (PDT) Date: Fri, 27 Mar 2020 16:32:40 +0530 From: afzal mohammed List-Id: To: soc@kernel.org Subject: [afzal.mohd.ma@gmail.com: [PATCH v3] ARM: mmp: replace setup_irq() by request_irq()] Message-ID: <20200327110240.GD8207@afzalpc> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.3 (2018-01-21) ----- Forwarded message from afzal mohammed ----- Date: Sun, 1 Mar 2020 17:52:41 +0530 From: afzal mohammed To: Viresh Kumar , Lubomir Rintel , Russell King , Greg Kroah-Hartman , Enrico Weigelt , Kate Stewart , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: afzal mohammed Subject: [PATCH v3] ARM: mmp: replace setup_irq() by request_irq() X-Mailer: git-send-email 2.18.0 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. Regards afzal v3: * Split out from series, also split out from ARM patch to subarch level 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-mmp/time.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index c65cfc1ad99b..049a65f47b42 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c @@ -175,13 +175,6 @@ static void __init timer_config(void) __raw_writel(0x2, mmp_timer_base + TMR_CER); } -static struct irqaction timer_irq = { - .name = "timer", - .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = timer_interrupt, - .dev_id = &ckevt, -}; - void __init mmp_timer_init(int irq, unsigned long rate) { timer_config(); @@ -190,7 +183,9 @@ void __init mmp_timer_init(int irq, unsigned long rate) ckevt.cpumask = cpumask_of(0); - setup_irq(irq, &timer_irq); + if (request_irq(irq, timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, + "timer", &ckevt)) + pr_err("Failed to request irq %d (timer)\n", irq); clocksource_register_hz(&cksrc, rate); clockevents_config_and_register(&ckevt, rate, MIN_DELTA, MAX_DELTA);