From nobody Tue Jun 23 17:22:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BE2CC433F5 for ; Tue, 1 Mar 2022 10:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234165AbiCAKM2 (ORCPT ); Tue, 1 Mar 2022 05:12:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233620AbiCAKMT (ORCPT ); Tue, 1 Mar 2022 05:12:19 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0FD723D9 for ; Tue, 1 Mar 2022 02:11:38 -0800 (PST) Date: Tue, 01 Mar 2022 10:11:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1646129497; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3qeGJX0SIhs4mI90650UsQtcYjPLhiqoCG3lN7p4yBo=; b=IozzukERP/AcvXUVMUriqBbAzSS04JvhSQxYa/BAHHMppU4DNVD8oLEN6v0t3heVo+dKa3 FgC3nIZIq56EGuB/IxZc/wcgj4v2HT6Q4q+W3520UOk9hTo584aMlzvht2TlXUizNVInI1 YJQhsuBEOK1SAClKR3Fzhkdx8y05rhXPeGziiQf7cPDea4VFnbfF4eimVPkjIJN4Eau4Fi kuGZCqqKg1UiIPmt13Jh75iN4HCrrgyTWhrSP/HQ2/HCj83Ypo4VKZ5QnpDpj/vblNFRnT QtsYuCT2aY5+S7EjE3RMr55m2htknGOwvNlg9Z+QXdBU8/8VGa/2h4xRAXMlQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1646129497; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3qeGJX0SIhs4mI90650UsQtcYjPLhiqoCG3lN7p4yBo=; b=sWOvcGRjtoqAVGm7qtYJXePTx+tjawu0sLqtURhprLcliUVbCut50zOpdMs7yEu7mnAKkH SFo2wkHx8hA+mxDw== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/qcom-pdc: Kill non-wakeup irqdomain Cc: Marc Zyngier , tglx@linutronix.de In-Reply-To: <20220224101226.88373-3-maz@kernel.org> References: <20220224101226.88373-3-maz@kernel.org> MIME-Version: 1.0 Message-ID: <164612949655.16921.380901203198635513.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of ir= qchip: Commit-ID: 4dc70713dc24dceeea7f106828674744a6294860 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-plat= forms/4dc70713dc24dceeea7f106828674744a6294860 Author: Marc Zyngier AuthorDate: Thu, 24 Feb 2022 10:12:23=20 Committer: Marc Zyngier CommitterDate: Tue, 01 Mar 2022 10:06:24=20 irqchip/qcom-pdc: Kill non-wakeup irqdomain A careful look at the way the PDC driver works shows that: - all interrupts are in the same space - all interrupts are treated the same And yet the driver creates two domains based on whether the interrupt gets mapped directly or from the pinctrl code, which is obviously a waste of resources. Kill the non-wakeup domain and unify all the interrupt handling. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220224101226.88373-3-maz@kernel.org --- drivers/irqchip/qcom-pdc.c | 84 ++++--------------------------------- 1 file changed, 10 insertions(+), 74 deletions(-) diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 3b214c4..5be5314 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -21,7 +21,6 @@ #include #include =20 -#define PDC_MAX_IRQS 168 #define PDC_MAX_GPIO_IRQS 256 =20 #define CLEAR_INTR(reg, intr) (reg & ~(1 << intr)) @@ -228,51 +227,6 @@ static int qcom_pdc_alloc(struct irq_domain *domain, u= nsigned int virq, if (ret) return ret; =20 - ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, - &qcom_pdc_gic_chip, NULL); - if (ret) - return ret; - - region =3D get_pin_region(hwirq); - if (!region) - return irq_domain_disconnect_hierarchy(domain->parent, virq); - - if (type & IRQ_TYPE_EDGE_BOTH) - type =3D IRQ_TYPE_EDGE_RISING; - - if (type & IRQ_TYPE_LEVEL_MASK) - type =3D IRQ_TYPE_LEVEL_HIGH; - - parent_fwspec.fwnode =3D domain->parent->fwnode; - parent_fwspec.param_count =3D 3; - parent_fwspec.param[0] =3D 0; - parent_fwspec.param[1] =3D pin_to_hwirq(region, hwirq); - parent_fwspec.param[2] =3D type; - - return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, - &parent_fwspec); -} - -static const struct irq_domain_ops qcom_pdc_ops =3D { - .translate =3D qcom_pdc_translate, - .alloc =3D qcom_pdc_alloc, - .free =3D irq_domain_free_irqs_common, -}; - -static int qcom_pdc_gpio_alloc(struct irq_domain *domain, unsigned int vir= q, - unsigned int nr_irqs, void *data) -{ - struct irq_fwspec *fwspec =3D data; - struct irq_fwspec parent_fwspec; - struct pdc_pin_region *region; - irq_hw_number_t hwirq; - unsigned int type; - int ret; - - ret =3D qcom_pdc_translate(domain, fwspec, &hwirq, &type); - if (ret) - return ret; - if (hwirq =3D=3D GPIO_NO_WAKE_IRQ) return irq_domain_disconnect_hierarchy(domain, virq); =20 @@ -301,16 +255,9 @@ static int qcom_pdc_gpio_alloc(struct irq_domain *doma= in, unsigned int virq, &parent_fwspec); } =20 -static int qcom_pdc_gpio_domain_select(struct irq_domain *d, - struct irq_fwspec *fwspec, - enum irq_domain_bus_token bus_token) -{ - return bus_token =3D=3D DOMAIN_BUS_WAKEUP; -} - -static const struct irq_domain_ops qcom_pdc_gpio_ops =3D { - .select =3D qcom_pdc_gpio_domain_select, - .alloc =3D qcom_pdc_gpio_alloc, +static const struct irq_domain_ops qcom_pdc_ops =3D { + .translate =3D qcom_pdc_translate, + .alloc =3D qcom_pdc_alloc, .free =3D irq_domain_free_irqs_common, }; =20 @@ -361,7 +308,7 @@ static int pdc_setup_pin_mapping(struct device_node *np) =20 static int qcom_pdc_init(struct device_node *node, struct device_node *par= ent) { - struct irq_domain *parent_domain, *pdc_domain, *pdc_gpio_domain; + struct irq_domain *parent_domain, *pdc_domain; int ret; =20 pdc_base =3D of_iomap(node, 0); @@ -383,32 +330,21 @@ static int qcom_pdc_init(struct device_node *node, st= ruct device_node *parent) goto fail; } =20 - pdc_domain =3D irq_domain_create_hierarchy(parent_domain, 0, PDC_MAX_IRQS, - of_fwnode_handle(node), - &qcom_pdc_ops, NULL); - if (!pdc_domain) { - pr_err("%pOF: GIC domain add failed\n", node); - ret =3D -ENOMEM; - goto fail; - } - - pdc_gpio_domain =3D irq_domain_create_hierarchy(parent_domain, + pdc_domain =3D irq_domain_create_hierarchy(parent_domain, IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP, PDC_MAX_GPIO_IRQS, of_fwnode_handle(node), - &qcom_pdc_gpio_ops, NULL); - if (!pdc_gpio_domain) { - pr_err("%pOF: PDC domain add failed for GPIO domain\n", node); + &qcom_pdc_ops, NULL); + if (!pdc_domain) { + pr_err("%pOF: PDC domain add failed\n", node); ret =3D -ENOMEM; - goto remove; + goto fail; } =20 - irq_domain_update_bus_token(pdc_gpio_domain, DOMAIN_BUS_WAKEUP); + irq_domain_update_bus_token(pdc_domain, DOMAIN_BUS_WAKEUP); =20 return 0; =20 -remove: - irq_domain_remove(pdc_domain); fail: kfree(pdc_region); iounmap(pdc_base);