From patchwork Fri Mar 27 12:44:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: afzal mohammed X-Patchwork-Id: 11462351 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 CEF611667 for ; Fri, 27 Mar 2020 12:44:45 +0000 (UTC) Received: by mail.kernel.org (Postfix) id CA58F20848; Fri, 27 Mar 2020 12:44:45 +0000 (UTC) Delivered-To: soc@kernel.org Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) (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 A5C642082E; Fri, 27 Mar 2020 12:44:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YeUXuFl8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5C642082E 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-pf1-f193.google.com with SMTP id c20so1905077pfi.7; Fri, 27 Mar 2020 05:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xFdvPRnQ5Nq8J+GnOFEHtRkDs3iYX4yKgZJqfls3/Pk=; b=YeUXuFl8dwFM3mWt1H2uHEqUccLT5Xz+QFYTGztMmEJoY6CJssaZCuvAawjQwmUXCq WE7TnXJ0S7ox17JZ+21+DTHw+iZW/GlO1d0lUqXN7992tY+agbibzc+IMP/oGW7vpWM5 gE13iQAxCOeB4Yl8kdzjItjkLawp/ZVSOtQ4rKgzu700xbuaJQMe5Ccsu8TwjVsLusAH wK8EPmnr3IelGS4b8u3BeSJXBSboMATZKfmjFAV+FFSy/aE3tJvInzpdaqzOsuRN9bzc vICZ6w+pbojyLVGrrIUCRIp/TNOH4/Mgwtm5lC6p4NGYsrXsAPUp7ocz2WJkTycuDQYY /ULg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xFdvPRnQ5Nq8J+GnOFEHtRkDs3iYX4yKgZJqfls3/Pk=; b=F7pAGvmtE0BgX9c4W4akgK4YmfqMmWG+X/xIyG5ot9f1TTwfSnu63+IFGxhBz55xt6 Ha5pk8ulEikgZwTTyK4TD8hDSTkMn8SOCdXF4kYJquWbXkBOXXt+OWyzkd8w0Gv91J5G 9MY0FxVuA4z0CLgb6aozBZphP3JsLiV/L8xWJArn0Dq4q/J+k6+++7xrLkiYwX0Zw8EN 6P/TFNSv/NJUYb2CSkiN4ybbVn6CnAlvhpzc1x4NVWtUZIiwgVBr7PO5RXBrwRxZEG3T WWcjH0JWEV8z7Vd7fD09hhgJJVVbJu2apaZmaE1Rxy2D6PURX9KchEfjTZqzIEbjIpLn ix0A== X-Gm-Message-State: ANhLgQ2cwIQng78Jt24qIX9ietP4NijUE7dRlZTC6dZwkOHZFFYvX8VH QEIzGDXjOV/LrsGuux1vhkk= X-Google-Smtp-Source: ADFU+vuLkq2V3axK2zqaj7bfQQYwxISRui0bqL+BPM0Z4hxEntrKa7bvyaSE7IdlBKgOhRoaLMMD4Q== X-Received: by 2002:a63:2442:: with SMTP id k63mr5968884pgk.250.1585313085217; Fri, 27 Mar 2020 05:44:45 -0700 (PDT) Received: from localhost.localdomain ([49.207.51.33]) by smtp.gmail.com with ESMTPSA id 1sm3752699pjo.10.2020.03.27.05.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 05:44:44 -0700 (PDT) From: afzal mohammed List-Id: To: Arnd Bergmann , SoC Team Cc: afzal mohammed , Thomas Gleixner , Tony Lindgren , Alexander Sverdlin , =?utf-8?q?Krzysztof_Ha?= =?utf-8?q?=C5=82asa?= , Viresh Kumar , Lubomir Rintel , Gregory CLEMENT , Hartley Sweeten , Viresh Kumar , Shiraz Hashim , Andrew Lunn , Jason Cooper , Sebastian Hesselbarth , Russell King , Linux ARM , "linux-kernel@vger.kernel.org" , arm-soc , Olof Johansson Subject: [PATCH v4 4/5] ARM: mmp: replace setup_irq() by request_irq() Date: Fri, 27 Mar 2020 18:14:37 +0530 Message-Id: <20200327124437.4239-1-afzal.mohd.ma@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: 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 Acked-by: Lubomir Rintel Tested-by: Lubomir Rintel --- v4: * Add received tags 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);