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: <1363618756-15851-3-git-send-email-eduardo.valentin@ti.com>
Date:	Mon, 18 Mar 2013 10:59:10 -0400
From:	Eduardo Valentin <eduardo.valentin@...com>
To:	<gregkh@...uxfoundation.org>
CC:	<devel@...verdev.osuosl.org>, <linux-omap@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
	Eduardo Valentin <eduardo.valentin@...com>,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: [PATCH 2/8] staging: omap-thermal: use spin_lock_irqsave inside IRQ handler

Even if the IRQ is not firing because it is ONE_SHOT and disable
at INTC level, the IRQ handler must use spin_lock_irqsave.
It is necessary to disable IRQs from the current
CPU while it is holding a spin_lock which is need.

Cc: Dan Carpenter <dan.carpenter@...cle.com>

Signed-off-by: Eduardo Valentin <eduardo.valentin@...com>

diff --git a/drivers/staging/omap-thermal/omap-bandgap.c b/drivers/staging/omap-thermal/omap-bandgap.c
index cb7aa35..a4ac06c 100644
--- a/drivers/staging/omap-thermal/omap-bandgap.c
+++ b/drivers/staging/omap-thermal/omap-bandgap.c
@@ -168,9 +168,10 @@ static irqreturn_t omap_bandgap_talert_irq_handler(int irq, void *data)
 	struct omap_bandgap *bg_ptr = data;
 	struct temp_sensor_registers *tsr;
 	u32 t_hot = 0, t_cold = 0, ctrl;
+	unsigned long flags;
 	int i;
 
-	spin_lock(&bg_ptr->lock);
+	spin_lock_irqsave(&bg_ptr->lock, flags);
 	for (i = 0; i < bg_ptr->conf->sensor_count; i++) {
 		tsr = bg_ptr->conf->sensors[i].registers;
 		ctrl = omap_bandgap_readl(bg_ptr, tsr->bgap_status);
@@ -209,7 +210,7 @@ static irqreturn_t omap_bandgap_talert_irq_handler(int irq, void *data)
 		if (bg_ptr->conf->report_temperature)
 			bg_ptr->conf->report_temperature(bg_ptr, i);
 	}
-	spin_unlock(&bg_ptr->lock);
+	spin_unlock_irqrestore(&bg_ptr->lock, flags);
 
 	return IRQ_HANDLED;
 }
-- 
1.7.7.1.488.ge8e1c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ