Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1552629ybi; Sat, 27 Jul 2019 12:20:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjd7xlwzotHn4B/6KAw3SiAklKkyT8DoWH99A/NrptwbKM91YJw4lKqIPsyW6OPdjycUo5 X-Received: by 2002:a63:6901:: with SMTP id e1mr66599997pgc.390.1564255221851; Sat, 27 Jul 2019 12:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564255221; cv=none; d=google.com; s=arc-20160816; b=kZbKoFvqGKE5mpAJAVuUnSniH6VUE0peEy7eHsRt+ldHJeU8lyR6ttUUUR85aefR7R VQ0EN9V86FtCtW6c7itwNx0jyEZH4HKWrG10IXCbJL7JgIz+rehtk7KCaWjMr+MuiOER eLyFZ//VOab5vUMGgZXo6NGIHIRJqbb0oHEew+pZ6ern4QzIJD0RzTltlxPSY3WGG6N3 N8/dgz/OS/rBrqBzkH6bNi0w231Ujivh7A10yhna7Jb5Mvu+THTfVgqFzW4qwXxmZ8Ft 5A43YIH9GmjJVmlpwjvDIxVveeihpN49BaUZhZ8Rm9fcyOjH3Wfqd6cm2SBNBivtlO/O S+DA== 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=aN0LkOEHW98v+tptgk3RNYOKGQkp5CctwsH80KkRwcg=; b=n0McMbcWpT5MFJlGjfA8prWSt+HlewpulF82xEw9xtg8iSQeRIDxcvuKu9+nRehq++ uWfPLBofCdW9Vnr/SiV70y/AZU2qxYY0dfKY0q/E7h6sJ5K6QKijQsaz9CbzyPl4ApKE rvcxAg15SggeJ+7FeqhB76bzQp+0jB5LK3gpc4voSltY61idTjIpXQnOhzQglxlfVWUh uLaPYWB3fT6chqFI8chva+741/K1qfMJOzj0h93xpmMNSRMgtX1c+piq/gv4BL2/LDCK uSG0wAkS9K/Um4aangstB5Uh4SFvDCww/zbRJgkfFWkky77YuZEYcvHPizhPQbInTIrN 1XKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=fcgXJXi8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si22297033pgm.406.2019.07.27.12.20.07; Sat, 27 Jul 2019 12:20:21 -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=fail header.i=@crapouillou.net header.s=mail header.b=fcgXJXi8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388179AbfG0TSI (ORCPT + 99 others); Sat, 27 Jul 2019 15:18:08 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:43958 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387841AbfG0TSI (ORCPT ); Sat, 27 Jul 2019 15:18:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1564255079; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aN0LkOEHW98v+tptgk3RNYOKGQkp5CctwsH80KkRwcg=; b=fcgXJXi8hnnP5oSfBBDooTYIob+QBOq3x6N8XnTCx5SKBpWMhQpl1pSG8G2HY6TkSeU1rq zUcqJXb22s8WZt6+4xTUnnuyd/GVJa/1+eDmX15DhWzgwXZLnYBpPmaC3uBfDrPntw0Mef sx0ZRMZj1lUjUV1SEu7F9BbLiELNb2I= From: Paul Cercueil To: Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: linux-kernel@vger.kernel.org, od@zcrc.me, Paul Cercueil Subject: [PATCH 3/4] irqchip: ingenic: Get virq number from IRQ domain Date: Sat, 27 Jul 2019 15:17:40 -0400 Message-Id: <20190727191741.30317-3-paul@crapouillou.net> In-Reply-To: <20190727191741.30317-1-paul@crapouillou.net> References: <20190727191741.30317-1-paul@crapouillou.net> 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 Get the virq number from the IRQ domain instead of calculating it from the hardcoded irq base. Signed-off-by: Paul Cercueil --- drivers/irqchip/irq-ingenic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-ingenic.c b/drivers/irqchip/irq-ingenic.c index d97a3a500249..82a079fa3a3d 100644 --- a/drivers/irqchip/irq-ingenic.c +++ b/drivers/irqchip/irq-ingenic.c @@ -21,6 +21,7 @@ struct ingenic_intc_data { void __iomem *base; + struct irq_domain *domain; unsigned num_chips; }; @@ -34,6 +35,7 @@ struct ingenic_intc_data { static irqreturn_t intc_cascade(int irq, void *data) { struct ingenic_intc_data *intc = irq_get_handler_data(irq); + struct irq_domain *domain = intc->domain; uint32_t irq_reg; unsigned i; @@ -43,7 +45,8 @@ static irqreturn_t intc_cascade(int irq, void *data) if (!irq_reg) continue; - generic_handle_irq(__fls(irq_reg) + (i * 32) + JZ4740_IRQ_BASE); + irq = irq_find_mapping(domain, __fls(irq_reg) + (i * 32)); + generic_handle_irq(irq); } return IRQ_HANDLED; @@ -95,6 +98,8 @@ static int __init ingenic_intc_of_init(struct device_node *node, goto out_unmap_base; } + intc->domain = domain; + for (i = 0; i < num_chips; i++) { /* Mask all irqs */ writel(0xffffffff, intc->base + (i * CHIP_SIZE) + -- 2.21.0.593.g511ec345e18