From patchwork Fri Mar 27 11:02:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: afzal mohammed X-Patchwork-Id: 11462199 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 423806CA for ; Fri, 27 Mar 2020 11:02:06 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 3D307206F6; Fri, 27 Mar 2020 11:02:06 +0000 (UTC) Delivered-To: soc@kernel.org Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) (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 1AC0A206F1 for ; Fri, 27 Mar 2020 11:02:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P2td1+u+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AC0A206F1 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-f65.google.com with SMTP id g9so3632665pjp.0 for ; Fri, 27 Mar 2020 04:02:06 -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=r1XsCuobTS/AeJyMhsSyWPN4Di8cJ3LC/Y5P0qRjuRQ=; b=P2td1+u+OkP28mFZlwxh0LGM+fugbUN5STyHD4HHUwS1eedFklO3OeOOG/WtQevp+k fo6+1RoBdl45BxfuvhKEMCqYDze5zw4LacwZo1QDPHLmgX05V5CSMcxEwupOZ7rjfxy1 N57n3TLs5a95iq/FzdaEHeyMnSKqJyhdeeyD4qLvTP33TXM/Nvn+4BbjbMZpFvXpnIjQ yHF1hrPijWAdO8mqWg4nVeihNfoMzcx5vu4VBSWeKRPmST44LCL4Ayuk/9Xx3AMNbBL3 RrAd+yFUeQ0eOtbuyMFKemlUCnJX5PvqZgshWp1aZx5qXJUCCquc7VJe/GCgPGW1FMDC bhWg== 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=r1XsCuobTS/AeJyMhsSyWPN4Di8cJ3LC/Y5P0qRjuRQ=; b=U0GrG8qxW9as2vm5hddrEt4/m+KMmuOFkeFssPXBPSMvzLw9K/7u/AUwx6U+DURhcG f9JQ3nWEZ5CSpHsvPmOGfOuOK2wAOjEFcGMhirGEZqYNCASSgPT0UHegZYtM1KOdAieF UO9CwOkauRt/zrX3fDnLpvoxfEK5PZvduTkZz/1k4u56tcG1J0dOK0/f2WyzDM27Zw23 43BCvR4LXvBCecP2kGI7lP9II1ecZMAPh44f+6O2/BKLrSlGrZ4tdkHbGbojSwq7z25N e9bzIpxm2INfzIy41UjWT5S8VLQyJwgO8qidA/5d0S/vKfwaLbsLdS89XDiUr5fDchwI kIQg== X-Gm-Message-State: ANhLgQ0Xr1cTKklSDXQYXpq0MC2lISmDGcLfau78q0d+WmgA+IsEN50B eHUOVjJ+LjR/rgZD6Ss3yUx3jlEL X-Google-Smtp-Source: ADFU+vvLDn04zC5cHg1h3OJ8tzSzVDAhrZRA/XtenyXSAw0ZiYJ4wHHPbW+vNVxo0O4veHIwh7/CoQ== X-Received: by 2002:a17:902:710c:: with SMTP id a12mr12509673pll.283.1585306925076; Fri, 27 Mar 2020 04:02:05 -0700 (PDT) Received: from localhost ([183.82.181.40]) by smtp.gmail.com with ESMTPSA id r8sm3481023pjo.22.2020.03.27.04.02.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 04:02:04 -0700 (PDT) Date: Fri, 27 Mar 2020 16:32:02 +0530 From: afzal mohammed List-Id: To: soc@kernel.org Subject: [afzal.mohd.ma@gmail.com: [PATCH v3] ARM: spear: replace setup_irq() by request_irq()] Message-ID: <20200327110202.GB8207@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:53:15 +0530 From: afzal mohammed To: Viresh Kumar , Viresh Kumar , Shiraz Hashim , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: afzal mohammed Subject: [PATCH v3] ARM: spear: 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-spear/time.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c index 289e036c9c30..d1fdb6066f7b 100644 --- a/arch/arm/mach-spear/time.c +++ b/arch/arm/mach-spear/time.c @@ -181,12 +181,6 @@ static irqreturn_t spear_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct irqaction spear_timer_irq = { - .name = "timer", - .flags = IRQF_TIMER, - .handler = spear_timer_interrupt -}; - static void __init spear_clockevent_init(int irq) { u32 tick_rate; @@ -201,7 +195,8 @@ static void __init spear_clockevent_init(int irq) clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0); - setup_irq(irq, &spear_timer_irq); + if (request_irq(irq, spear_timer_interrupt, IRQF_TIMER, "timer", NULL)) + pr_err("Failed to request irq %d (timer)\n", irq); } static const struct of_device_id timer_of_match[] __initconst = {