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] [thread-next>] [day] [month] [year] [list]
Message-Id: <1500982035-28838-5-git-send-email-johannes.poehlmann@izt-labs.de>
Date:   Tue, 25 Jul 2017 13:27:14 +0200
From:   Johannes Poehlmann <johannes.poehlmann@...-labs.de>
To:     linux-kernel@...r.kernel.org
Cc:     Johannes Poehlmann <johannes.poehlmann@...-labs.de>,
        Evgeniy Polyakov <zbr@...emap.net>,
        Greg Kroah-Hartman <greg@...ah.com>
Subject: [PATCH v4 4/5] w1: ds1wm: silence interrupts on HW before claiming the interrupt

w1: ds1wm: silence interrupts on HW before claiming the interrupt.
This way avoid possible invalid interrupts in the initialization phase.

Signed-off-by: Johannes Poehlmann <johannes.poehlmann@...-labs.de>
Acked-by: Evgeniy Polyakov <zbr@...emap.net>
---
 drivers/w1/masters/ds1wm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index f8a3ba0..5314379 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -509,6 +509,7 @@ static int ds1wm_probe(struct platform_device *pdev)
 	struct ds1wm_driver_data *plat;
 	struct resource *res;
 	int ret;
+	u8 inten;
 
 	if (!pdev)
 		return -ENODEV;
@@ -562,6 +563,11 @@ static int ds1wm_probe(struct platform_device *pdev)
 	ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0);
 	ds1wm_data->reset_recover_delay = plat->reset_recover_delay;
 
+	/* Mask interrupts, set IAS before claiming interrupt */
+	inten = ds1wm_read_register(ds1wm_data, DS1WM_INT_EN);
+	ds1wm_write_register(ds1wm_data,
+		DS1WM_INT_EN, ds1wm_data->int_en_reg_none);
+
 	if (res->flags & IORESOURCE_IRQ_HIGHEDGE)
 		irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING);
 	if (res->flags & IORESOURCE_IRQ_LOWEDGE)
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ