Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2488794ybx; Fri, 8 Nov 2019 05:08:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwGyBFwgVqf8Jk/AgC3ym1xGudosCm52Sd0ltLabskk1rvJFM++VRtxLIo7Hm1CRMGO7/Br X-Received: by 2002:aa7:d299:: with SMTP id w25mr10463350edq.14.1573218513820; Fri, 08 Nov 2019 05:08:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573218513; cv=none; d=google.com; s=arc-20160816; b=nv2lFoXCuh5NDGs/woldJ/wt84Nyo2UFJEyZwyQtz6I5S9C6qdeXw269SO0qcBYUfF yKj31fvuRgdee/BhHKmIIxQzR7IiZDTT6FjTdRSQuYeL7sM0edvhgqpSefy9wQQ0Kbm4 Ibx3EQroPMdg8+l8VhQVaW/HopkjjmEkpb4AGxMuQNvfeUI3vSKniC4nKWIgIExDpcFT BLG3vIRWwRxcT+k00eiHhBmQd2f4K8Tp36Gdepaha1NGQmiXY6Lu7z9rhQk8eTls2l2B m/JY5NQ8SODexdaTuk2suYE13r6PTe+Ik1I42nP9sDML3DRNawg6QEq49ZEcSloR7QvU PTww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XBMri+/30LVPDwr/Z+UtZHm4sLSriiAUm4o/nxS90ZM=; b=axB3mm+W2O/88pBnnSFUjC7RTb1Z2X37BDuVQtPBHWIOXN/KBK/kz6lOLLtDSZkMGX DAduhhQ0NWEFMPw8jriAY/5GwbGY2tVEGxBxNv308o6HAHcVl6hNhkJsYpduqtjM6NKw yp5+KM+EcVbrYPzshHN1gKSBhFXh/Z+wy/Zb8hcomLhRBKbmMgubxFsRFf7SgJzGe0/+ i9VnzRIQqIVAfp1ZUGz0FyKp9CPaq/DrWlqp2tx1Akv5/lpdhn0ODZd9eH9Dn5miSJZh ch24lOR/p7skBI91bky+oEIYMS1TZ2Gs05ohFMZrRwl1zZDvcwYW2uERUCVYWyv1+J/+ kuTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=iMPvlmMC; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p17si3943980ejm.4.2019.11.08.05.08.08; Fri, 08 Nov 2019 05:08:33 -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=@rasmusvillemoes.dk header.s=google header.b=iMPvlmMC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbfKHNBq (ORCPT + 99 others); Fri, 8 Nov 2019 08:01:46 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:42828 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728015AbfKHNBp (ORCPT ); Fri, 8 Nov 2019 08:01:45 -0500 Received: by mail-lj1-f196.google.com with SMTP id n5so6122571ljc.9 for ; Fri, 08 Nov 2019 05:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XBMri+/30LVPDwr/Z+UtZHm4sLSriiAUm4o/nxS90ZM=; b=iMPvlmMCvod0FN1nC9Xfoxe9VFeVCDr0/g0n1DjjJ5HKuIql2dY5TK/RIBodr7QFJs Ge4srl9274vy84VVa9W68VDsl5HRT/aXz0epnb7/pl/5sxWGOmiQgiFZDxKPPg/v3DMz VTs+/nLr5ZN2XdFAOiQVRTIUukU0xvF1sugEg= 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:mime-version:content-transfer-encoding; bh=XBMri+/30LVPDwr/Z+UtZHm4sLSriiAUm4o/nxS90ZM=; b=PHo9cYWlUgQox1vqLaBCTdumT5TZYFhGNUESu3Y6u6JZ87gRHQ67E9UHuPMJDlo3aX fjZedUWVmBf1PeKHSmVLHdCbIbrJ6I13zFmk23kypQo5HVgA+gfgmIH6yFmkHO8pVewr CUqSNBLEHI8E9EDz3aZWxIKnvE2xWuIzS5jb00+RRah/0GtcxLeewkh5+QinZ9vOsiz7 J4lqIE8eBbM2Lq/Ak8Iy7JsiqB5N0UIG8yj1szZNwLXklCbpPDB12FtAlo9dw8PVJVFt Ddm5BRQvaPyc81kvbCPFKSLDF8Jsm/yPbHzWLvfsQ3oTzyBjhUOrubeqJj+GxnbRuaDz KR2w== X-Gm-Message-State: APjAAAXPCm1Zm1zQq4k2wM/SZ4wIj0JSLCjym8hIwTFclnz9hiNJzA3s VQ1URm2/JqmmogkJCLjmob3+cg== X-Received: by 2002:a2e:9712:: with SMTP id r18mr6970474lji.12.1573218101817; Fri, 08 Nov 2019 05:01:41 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id d28sm2454725lfn.33.2019.11.08.05.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 05:01:41 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Rasmus Villemoes Subject: [PATCH v4 11/47] soc: fsl: qe: use qe_ic_cascade_{low,high}_mpic also on 83xx Date: Fri, 8 Nov 2019 14:00:47 +0100 Message-Id: <20191108130123.6839-12-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108130123.6839-1-linux@rasmusvillemoes.dk> References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The *_ipic and *_mpic handlers are almost identical - the only difference is that the latter end with an unconditional chip->irq_eoi() call. Since IPIC does not have ->irq_eoi, we can reduce some code duplication by calling irq_eoi conditionally. This is similar to what is already done in mpc8xxx_gpio_irq_cascade(). This leaves the functions slightly misnamed, but that will be fixed in a subsequent patch. Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/83xx/misc.c | 2 +- include/soc/fsl/qe/qe_ic.h | 24 ++++-------------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c index f46d7bf3b140..779791c0570f 100644 --- a/arch/powerpc/platforms/83xx/misc.c +++ b/arch/powerpc/platforms/83xx/misc.c @@ -100,7 +100,7 @@ void __init mpc83xx_qe_init_IRQ(void) if (!np) return; } - qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); + qe_ic_init(np, 0, qe_ic_cascade_low_mpic, qe_ic_cascade_high_mpic); of_node_put(np); } diff --git a/include/soc/fsl/qe/qe_ic.h b/include/soc/fsl/qe/qe_ic.h index 714a9b890d8d..bfaa233d8328 100644 --- a/include/soc/fsl/qe/qe_ic.h +++ b/include/soc/fsl/qe/qe_ic.h @@ -74,24 +74,6 @@ void qe_ic_set_highest_priority(unsigned int virq, int high); int qe_ic_set_priority(unsigned int virq, unsigned int priority); int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); -static inline void qe_ic_cascade_low_ipic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); -} - -static inline void qe_ic_cascade_high_ipic(struct irq_desc *desc) -{ - struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); - unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); - - if (cascade_irq != NO_IRQ) - generic_handle_irq(cascade_irq); -} - static inline void qe_ic_cascade_low_mpic(struct irq_desc *desc) { struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); @@ -101,7 +83,8 @@ static inline void qe_ic_cascade_low_mpic(struct irq_desc *desc) if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); - chip->irq_eoi(&desc->irq_data); + if (chip->irq_eoi) + chip->irq_eoi(&desc->irq_data); } static inline void qe_ic_cascade_high_mpic(struct irq_desc *desc) @@ -113,7 +96,8 @@ static inline void qe_ic_cascade_high_mpic(struct irq_desc *desc) if (cascade_irq != NO_IRQ) generic_handle_irq(cascade_irq); - chip->irq_eoi(&desc->irq_data); + if (chip->irq_eoi) + chip->irq_eoi(&desc->irq_data); } static inline void qe_ic_cascade_muxed_mpic(struct irq_desc *desc) -- 2.23.0