lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <160243904120.7002.16402371248887672522.tip-bot2@tip-bot2>
Date:   Sun, 11 Oct 2020 17:57:21 -0000
From:   "tip-bot2 for Maulik Shah" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Stephen Boyd <swboyd@...omium.org>,
        Maulik Shah <mkshah@...eaurora.org>,
        Marc Zyngier <maz@...nel.org>,
        Douglas Anderson <dianders@...omium.org>,
        Linus Walleij <linus.walleij@...aro.org>, x86 <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: [tip: irq/core] irqchip/qcom-pdc: Reset PDC interrupts during init

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     d7bc63fa20b8a3b0d0645bed1887848c65c01529
Gitweb:        https://git.kernel.org/tip/d7bc63fa20b8a3b0d0645bed1887848c65c01529
Author:        Maulik Shah <mkshah@...eaurora.org>
AuthorDate:    Mon, 28 Sep 2020 10:02:04 +05:30
Committer:     Marc Zyngier <maz@...nel.org>
CommitterDate: Tue, 06 Oct 2020 11:26:41 +01:00

irqchip/qcom-pdc: Reset PDC interrupts during init

Kexec can directly boot into a new kernel without going to complete
reboot. This can leave the previous kernel's configuration for PDC
interrupts as is.

Clear previous kernel's configuration during init by setting interrupts
in enable bank to zero. The IRQs specified in qcom,pdc-ranges property
are the only ones that can be used by the new kernel so clear only those
IRQs. The remaining ones may be in use by a different kernel and should
not be set by new kernel.

Suggested-by: Stephen Boyd <swboyd@...omium.org>
Signed-off-by: Maulik Shah <mkshah@...eaurora.org>
Signed-off-by: Marc Zyngier <maz@...nel.org>
Tested-by: Stephen Boyd <swboyd@...omium.org>
Reviewed-by: Stephen Boyd <swboyd@...omium.org>
Reviewed-by: Douglas Anderson <dianders@...omium.org>
Acked-by: Linus Walleij <linus.walleij@...aro.org>
Link: https://lore.kernel.org/r/1601267524-20199-7-git-send-email-mkshah@codeaurora.org
---
 drivers/irqchip/qcom-pdc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c
index acc0620..bd39e9d 100644
--- a/drivers/irqchip/qcom-pdc.c
+++ b/drivers/irqchip/qcom-pdc.c
@@ -341,7 +341,8 @@ static const struct irq_domain_ops qcom_pdc_gpio_ops = {
 
 static int pdc_setup_pin_mapping(struct device_node *np)
 {
-	int ret, n;
+	int ret, n, i;
+	u32 irq_index, reg_index, val;
 
 	n = of_property_count_elems_of_size(np, "qcom,pdc-ranges", sizeof(u32));
 	if (n <= 0 || n % 3)
@@ -370,6 +371,14 @@ static int pdc_setup_pin_mapping(struct device_node *np)
 						 &pdc_region[n].cnt);
 		if (ret)
 			return ret;
+
+		for (i = 0; i < pdc_region[n].cnt; i++) {
+			reg_index = (i + pdc_region[n].pin_base) >> 5;
+			irq_index = (i + pdc_region[n].pin_base) & 0x1f;
+			val = pdc_reg_read(IRQ_ENABLE_BANK, reg_index);
+			val &= ~BIT(irq_index);
+			pdc_reg_write(IRQ_ENABLE_BANK, reg_index, val);
+		}
 	}
 
 	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ