Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2630881ybb; Fri, 27 Mar 2020 09:11:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvfQongAgL1VpeVCdbL/rsNcapKRK4otViLK7O28rh23pBCP6773DBLNSxUmGBwvuaE/jN2 X-Received: by 2002:aca:5403:: with SMTP id i3mr4634360oib.174.1585325465270; Fri, 27 Mar 2020 09:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585325465; cv=none; d=google.com; s=arc-20160816; b=M5hI4j4OS1AtVV5aADPRV4WwQLhBd0sKUSKowVenzERKxYUUb5Yz7naj2U+t7uyBS5 elV0Kb+NwvF4pCg1yn2Dxtp31+2YtS7tj8vQVU6nrZFrKGPcbvQOluxyehOtWLfFBxF/ dXPzdT0h5V2h99MKfeHj7sFgWaS2guI4M4Wp5rPWaVgIF/dY4eMZ5PLzLchezWKZ4q8U 7qwXQ+0TAyfRVuAmw2oIn3+qaAlwfFFvwSzzDxnwDSVhSMn8pVZyNP8ywN2yX0YHNd/8 2zRhfg6qDtMgtb9htFPxcQizW+hkSb35a6HnDLT4lLCMYczdyrh5UhhzORNDXBdYK7+N IDzw== 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=75IkkZ1NYInUGk9X1drfGLOcKHAXU9ALtpboPRPENVs=; b=GFWT7HXxUJxmzZdeYpvBRDt7TIuMDkRddYLeMO8rsLTmHtMzN/Kpkpg3yiB1gR5bE6 yQk/Au750055frW/jqVVBqR0h+7iC3S7TE5vaM6McYQrmGBzQdDlh8obHlrbc0UoMLV8 Ow+9kynPlARY0cNfcbtcxgtN0veFveCkkamaemI1+ouOMTBiLBmlw54uPQb/9Vcwzvxv qmF4ymjmbzYh38bPrXtSkmOnVUBK/vR2EWSmN5iBhGCL0FL8SXBTjzbCKtiuo5Kh3S97 ChUO16VzGBnbg8rhPSDllLSeZlNa097hI4ysj0h2Qi4+ksihauc2GGd2fVjXJ97LpeNh vq3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bAG8+6cf; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si2612581oth.0.2020.03.27.09.10.49; Fri, 27 Mar 2020 09:11:05 -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=pass header.i=@gmail.com header.s=20161025 header.b=bAG8+6cf; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727725AbgC0QK2 (ORCPT + 99 others); Fri, 27 Mar 2020 12:10:28 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:38191 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbgC0QK1 (ORCPT ); Fri, 27 Mar 2020 12:10:27 -0400 Received: by mail-pj1-f67.google.com with SMTP id m15so3964173pje.3; Fri, 27 Mar 2020 09:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=75IkkZ1NYInUGk9X1drfGLOcKHAXU9ALtpboPRPENVs=; b=bAG8+6cfrQfvrSSLoJGkn9Mx3btLb8agasQ1eNRiHrr91lZ6srxsGXppBKGid71T9u ZDEDVH5LOFJFKs7Nf60HoWfxbVzMLaeu68qEaBucSTc5D9yeo7sDdVdj6QxhKFEPHaZE vBx+UAiICx+3zfGJOZfhHlEzUpMa9x1YIAg922wy3yrs4Uk2ePM4FFFu8eUUUK16w9s4 CrkEbth6870yo3dqnnz1tHHJ8moLr91D+7+pngGKMvnvH2g8Gkat5oPaz5U9Xjp5Jc3m ZI6Roj9K//5uSvv97m57UA129ZRAIpM7gyLFDd2Wh0pvFAk6RXYL61KHeU+6UG8P1cNb J/Uw== 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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=75IkkZ1NYInUGk9X1drfGLOcKHAXU9ALtpboPRPENVs=; b=hPcphFn5B0+3SICCkZypHMNa34ZiNoDNOVW8qvpQHEMkBXs1kmyTa9wrXGu2abZlpH PUCbhWIVvV9EbQI2fl6toWtXH9Sq8G7nnzceXc7pOQOhgXIlO7oj20BgmYXqRktkv6ou BM6K5r+SYkZNMDImoOAc09QZm6O8PGm+/l6dJMNM1ql4XwH3LxXE01Nm4WLaG3Vhw9kR 9SQWNk+ozpFiEiIE0+j/Kprk/C8kCrYvSqJFt12OOeTcK2bQ9Agmby2x+xg7SYaqGnLh TMOPH8KOuxlQVgn1WH1Nkj8zdzqy0rk3SHPvK8z5w72baCFKaYw/v6PCC+YMTha2R2AE lo7A== X-Gm-Message-State: ANhLgQ2uLWcVVw1+WpAvO8wnAMlvwxBwGfaN75NpwNW6Ms6lRQcQ9G+G 6xvQrdWLIUo0bKwTymTiawUB/Ymr X-Received: by 2002:a17:902:b281:: with SMTP id u1mr13999282plr.287.1585325426590; Fri, 27 Mar 2020 09:10:26 -0700 (PDT) Received: from localhost ([49.207.55.57]) by smtp.gmail.com with ESMTPSA id u14sm4159413pgg.67.2020.03.27.09.10.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 09:10:26 -0700 (PDT) Date: Fri, 27 Mar 2020 21:40:24 +0530 From: afzal mohammed To: Thomas Gleixner Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Yoshinori Sato , Rich Felker Subject: [PATCH v5 4/6] sh: replace setup_irq() by request_irq() Message-ID: References: <20200321174303.GA7930@afzalpc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Link to v3, v2 & v1, [v3] https://lkml.kernel.org/r/20200304005120.5403-1-afzal.mohd.ma@gmail.com [v2] https://lkml.kernel.org/r/cover.1582471508.git.afzal.mohd.ma@gmail.com [v1] https://lkml.kernel.org/r/cover.1581478323.git.afzal.mohd.ma@gmail.com v5: * No change v4: * Non-existent v3: * Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers * Modify pr_err displayed in case of error * Re-arrange code & choose pr_err args 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/sh/boards/mach-cayman/irq.c | 18 ++++++------------ arch/sh/drivers/dma/dma-pvr2.c | 9 +++------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c index 3b6ea2d99013..0305d0b51730 100644 --- a/arch/sh/boards/mach-cayman/irq.c +++ b/arch/sh/boards/mach-cayman/irq.c @@ -40,16 +40,6 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id) return IRQ_NONE; } -static struct irqaction cayman_action_smsc = { - .name = "Cayman SMSC Mux", - .handler = cayman_interrupt_smsc, -}; - -static struct irqaction cayman_action_pci2 = { - .name = "Cayman PCI2 Mux", - .handler = cayman_interrupt_pci2, -}; - static void enable_cayman_irq(struct irq_data *data) { unsigned int irq = data->irq; @@ -149,6 +139,10 @@ void init_cayman_irq(void) } /* Setup the SMSC interrupt */ - setup_irq(SMSC_IRQ, &cayman_action_smsc); - setup_irq(PCI2_IRQ, &cayman_action_pci2); + if (request_irq(SMSC_IRQ, cayman_interrupt_smsc, 0, "Cayman SMSC Mux", + NULL)) + pr_err("Failed to register Cayman SMSC Mux interrupt\n"); + if (request_irq(PCI2_IRQ, cayman_interrupt_pci2, 0, "Cayman PCI2 Mux", + NULL)) + pr_err("Failed to register Cayman PCI2 Mux interrupt\n"); } diff --git a/arch/sh/drivers/dma/dma-pvr2.c b/arch/sh/drivers/dma/dma-pvr2.c index b5dbd1f75768..21c347543e19 100644 --- a/arch/sh/drivers/dma/dma-pvr2.c +++ b/arch/sh/drivers/dma/dma-pvr2.c @@ -64,11 +64,6 @@ static int pvr2_xfer_dma(struct dma_channel *chan) return 0; } -static struct irqaction pvr2_dma_irq = { - .name = "pvr2 DMA handler", - .handler = pvr2_dma_interrupt, -}; - static struct dma_ops pvr2_dma_ops = { .request = pvr2_request_dma, .get_residue = pvr2_get_dma_residue, @@ -84,7 +79,9 @@ static struct dma_info pvr2_dma_info = { static int __init pvr2_dma_init(void) { - setup_irq(HW_EVENT_PVR2_DMA, &pvr2_dma_irq); + if (request_irq(HW_EVENT_PVR2_DMA, pvr2_dma_interrupt, 0, + "pvr2 DMA handler", NULL)) + pr_err("Failed to register pvr2 DMA handler interrupt\n"); request_dma(PVR2_CASCADE_CHAN, "pvr2 cascade"); return register_dmac(&pvr2_dma_info); -- 2.25.1