Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6873576ybc; Thu, 28 Nov 2019 06:59:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyys+LXgn+6OgPYZr6FIsY2Q7fohP5GKu8SzjE2zt5+H9r0Xw0KEQ1trj05ahp1MtUGOGDT X-Received: by 2002:a17:906:c791:: with SMTP id cw17mr11629851ejb.69.1574953149946; Thu, 28 Nov 2019 06:59:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953149; cv=none; d=google.com; s=arc-20160816; b=wg9s8Oea1w7xvHaVVmo9HLYleS2Xf2QQLT+H9YKzLI0vNu17RmOI6+wEm2aviNcfLo JJSrRZ9JSYMNy2U1PjPJuqOKQE5KhUgNzFPE8pvPc9HeIN+HbzvL5D22bXQxxKBmGmBz kbm+zJO7x1/wkH5Fy2CQvi3Ts24EdgRyJdl3f7YpdivRwy74AYAvD1mcHIRSm4ZtUKH7 k1dI//AjwA4qcPn7NAJccp1pJ94+4jWt/Hw96i7a5O/y7OLs/hH0d/WWhIMLr2bvhBHW Pe8LF/vl8IvVC+8S9Is2hcDvtTJ0930Fb3DsKKYbaodHjAEUZ/bIVnwL0gGht6mlA011 fNWA== 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=Vf2Fz+jj9lIDscUS3A8RQ3uOyXTjQEG0ba9IOOikoBs=; b=v7Kl3dEqN9BGXr5xrbgbOBe5UEt9MfCdngIGnRII3+wWauZNJhgF94lZIE71fMpJ8p vj4HnMtSrbTZU2cTZ7InnwMQHeBeicnbrrKdMVQx2yhMIOdqncUdgnzJgOz2e3S6sNuO me9bNjIHUwc2UNwCf1CDn5UxnIGTl7SR9EI3YYJlAIbYH24cWvhefmeIRczUVjOilSH4 YKXSQrKdDYtStFhB3cREigArPjzKpptzXZ1ApufcZjo6n4uxmgblc4fp2VZ+vmdmdkqt OIeVA3paCTw5fnGZgpd5JEdfHTrG0SOMkrtPvSBTYmXPXHu1D45qv3U9Jwyw6P01w5+7 yKYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=f7ELNEHL; 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 y8si3001051ejc.86.2019.11.28.06.58.45; Thu, 28 Nov 2019 06:59:09 -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=f7ELNEHL; 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 S1727304AbfK1O5X (ORCPT + 99 others); Thu, 28 Nov 2019 09:57:23 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38861 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfK1O5U (ORCPT ); Thu, 28 Nov 2019 09:57:20 -0500 Received: by mail-lj1-f196.google.com with SMTP id k8so18297895ljh.5 for ; Thu, 28 Nov 2019 06:57:19 -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=Vf2Fz+jj9lIDscUS3A8RQ3uOyXTjQEG0ba9IOOikoBs=; b=f7ELNEHL3fudjaC9Is+gx4un2R7u3IQVwsuaM0hPXmik/iv0R/U+N8/DsXKAxHzE7F wU5L5PXvtHQrsrOCSpKiFkyxiU7KI6s9/dEg1DzoSWlHRS01JYdvN9QzEDQcu3m/rfeh g5XVdp+hoGqlaFksIMZ8c9vnaz5jW/z5ASgCQ= 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=Vf2Fz+jj9lIDscUS3A8RQ3uOyXTjQEG0ba9IOOikoBs=; b=QzVMNXB2Yambq5Hl+/VhvLe7szPcMbpFwxpS+2JjZRAcWq1Ro9glwZVApdmlrznDtA XTmZOUyXp61F2pEQaUYVmQmgnuoPSPH9ns7U4n48LVv7ZGdB/ArpQMOmYpCug2Wc4lgg paopuPCfAm2LygMWkWm/UNDtYv2StJDn2n3z/BGBpvMA+Ry4rPbyKAKCgzUSo4bg4DoG R/Zfnfcvlji53ZhhoshkX/76oHqxHlO/d3SuFf8erStd0BPOCoEIdRRugf4uxmDlM8ow b0A/24ArrWwBDMJ7qpCRPzuEusQOTtoADrOZHVAJHhk/6kyKWe3c90JUY4Vq7cAdTdOD cvxA== X-Gm-Message-State: APjAAAVzeB2CPVEB+0ApEPUjFHOZGrzLR728ezjfDWn5yrzMM5jG41yF 8YKhoaFtM6OGiVRfxTbc46ehuQ== X-Received: by 2002:a05:651c:305:: with SMTP id a5mr35412802ljp.144.1574953039041; Thu, 28 Nov 2019 06:57:19 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id u2sm2456803lfl.18.2019.11.28.06.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:18 -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 , Timur Tabi , Rasmus Villemoes Subject: [PATCH v6 11/49] soc: fsl: qe: use qe_ic_cascade_{low,high}_mpic also on 83xx Date: Thu, 28 Nov 2019 15:55:16 +0100 Message-Id: <20191128145554.1297-12-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128145554.1297-1-linux@rasmusvillemoes.dk> References: <20191128145554.1297-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. Reviewed-by: Timur Tabi 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