Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3964862ybf; Tue, 3 Mar 2020 16:52:53 -0800 (PST) X-Google-Smtp-Source: ADFU+vuf4Okw3VB/YA5a/5hNBH8x8SSGr51uYgZVQ6TRrYkEaBe+A8K3cvcPeLqOy5tH2W+USh0y X-Received: by 2002:a54:4119:: with SMTP id l25mr123994oic.83.1583283172899; Tue, 03 Mar 2020 16:52:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583283172; cv=none; d=google.com; s=arc-20160816; b=KTdwRwVuqpKeI8oj5CebgxW7EbLotlACO/OLGDdICNC+/g0YFXsu4KkEVKNuD5aV63 PKeFXiOaOjPZfAovsptKS37wYUyDP10i2ydCF4SU47/o2w8HjsjaP9rdRplFxj4/FiPk /wUIf4tLk/5cqlu/1lk+jeUnVfNf2ZuPFomYJBzqZT7Y6khJz/duRGWoOEADCUTZ1oA/ XazwecgHujpf80mSJd3l6i41us2AY7RCgJb7CV1v/MQFS+rFxCd+AlC7lyhbiBz3oGDi RUKzgTR9DXgYzQtC9c/w/gQ8XvGUnDnWxK/hQcpUM22KnEAeizFU9gwJRshvwPg1a5Pj MryA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=lloNdMClJUSkvGhdIQ2BDntfP0IRWiqdPxWclRqCiGw=; b=vsyTCHwCRUS9N+rZ148xLjK8IyAQbRsUXwdFunaWQTfcCzJtPmW/ViI5JtI5zRriQZ qm99fc9g+X6uAf3VPzPqk9fUNf/3pSYhp2Rq+bgA67/akhvviF5xN9OUjEu8PsZBzKoQ xF9dgz405bteVTB7HCvDCq1a/xWofr7z0ch9uJojTwCObLASh/BNfuhQvppEjPEwhcBN Wndo7E8pSCBTOJXRmbTYTiuOBdVEpv8t0QqSrfVN7u2WZNjTOosNhmmKNlvzaPMdDCnE KrIOYR2NcPGvR6BigaTa/zYTuBawo80srQ3iSO8wzLmMbQxd90xGHY0VGSMH+UpA+K0v 85Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RvMWVXFv; 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 a11si254894oib.154.2020.03.03.16.52.41; Tue, 03 Mar 2020 16:52:52 -0800 (PST) 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=RvMWVXFv; 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 S1728312AbgCDAv2 (ORCPT + 99 others); Tue, 3 Mar 2020 19:51:28 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:52905 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbgCDAv1 (ORCPT ); Tue, 3 Mar 2020 19:51:27 -0500 Received: by mail-pj1-f66.google.com with SMTP id lt1so110361pjb.2; Tue, 03 Mar 2020 16:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=lloNdMClJUSkvGhdIQ2BDntfP0IRWiqdPxWclRqCiGw=; b=RvMWVXFvSBYEeHr9ldSCUeTVDLSVZq2zLb5lJkMCPfhbvAnve8mbBBK6ETIJoYU/El aZ0eFdltzmbf+2ZhrDxZ5EPXSwV6A6oBvhu977alMLc17gGlIvf2eT+Kmmrn2nfatSCG Crxegw5BKcntlWzGXtmChqscDoxQiX7HOunteg8hHBVW2tH6iDJtahv/NSk9RvzJj7tv 7JaESdmc0lZPr74DGby2AajKCpgcDDD2Z3v/LbJ79vuwl6HkJqs74u8wP4KaSe+YjQEW OJHB+MpRx4NqTRM99laoYugpAMhz7FosJHzSa6fz+hDJC2G6YoA9Np/kO7H/s+vdqPu9 2qBA== 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; bh=lloNdMClJUSkvGhdIQ2BDntfP0IRWiqdPxWclRqCiGw=; b=e7qmoWzRKenMBE6CZy81EtUKMo1pjkLFEMB5ALvH08OerDOh0a3Avsvw3mL0bn8MPN rnqmXgEWIm+b8K5Hh9eWv3jBx/1EBGko5q+QBtsTfbR7pWkx5rNmEdl9jUCGNk9hj6/F L2uwWrAlwzdffgrlYvyjD5FpXTBxI7LJFIWxnNrY27D9I0/N7eghp5lI5y6fIcVWhwfI Yx+iLoW+C+khuNbjz7CI+KnXSUGAe+k8LOC/7KEb0rXiD1QE4uZa4O2sJTLJ3lX4/fy0 7YYfckRv3B5GUUhsUwmNqrumttHguNIby9Kmx9NB+QBhjqQaSWzByVtQONYpWWj4yznu OTMA== X-Gm-Message-State: ANhLgQ1ZP5sxyG0WhwOYS78LjUp14sa1IhgbY2vc9aC5VaiSMH4rqMBm tRaEz/xSkKDk2RwxHuumIiOcphNT X-Received: by 2002:a17:90a:328f:: with SMTP id l15mr275722pjb.55.1583283085004; Tue, 03 Mar 2020 16:51:25 -0800 (PST) Received: from localhost.localdomain ([106.51.232.35]) by smtp.gmail.com with ESMTPSA id y197sm27259685pfc.79.2020.03.03.16.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 16:51:24 -0800 (PST) From: afzal mohammed To: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Cc: afzal mohammed , Yoshinori Sato , Rich Felker Subject: [PATCH v3] sh: replace setup_irq() by request_irq() Date: Wed, 4 Mar 2020 06:21:19 +0530 Message-Id: <20200304005120.5403-1-afzal.mohd.ma@gmail.com> X-Mailer: git-send-email 2.18.0 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 --- Hi sh maintainers, if okay w/ this change, please consider taking it thr' your tree, else please let me know. Regards afzal Link to v2 & v1, [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 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