From: Eduardo Valentin <eduardo.valentin@ti.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Eduardo Valentin <eduardo.valentin@ti.com>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH 2/8] staging: omap-thermal: use spin_lock_irqsave inside IRQ handler
Date: Mon, 18 Mar 2013 10:59:10 -0400 [thread overview]
Message-ID: <1363618756-15851-3-git-send-email-eduardo.valentin@ti.com> (raw)
In-Reply-To: <1363618756-15851-1-git-send-email-eduardo.valentin@ti.com>
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@oracle.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.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
next prev parent reply other threads:[~2013-03-18 15:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 14:59 [PATCH 0/8] staging: [omap,ti-soc]-thermal: fixes and renaming Eduardo Valentin
2013-03-18 14:59 ` [PATCH 1/8] staging: omap-thermal: fix return value Eduardo Valentin
2013-03-18 16:39 ` Dan Carpenter
2013-03-18 17:20 ` Eduardo Valentin
2013-03-18 14:59 ` Eduardo Valentin [this message]
2013-03-18 19:16 ` [PATCH 2/8] staging: omap-thermal: use spin_lock_irqsave inside IRQ handler Dan Carpenter
2013-03-18 19:38 ` Eduardo Valentin
2013-03-18 19:58 ` Dan Carpenter
2013-03-18 14:59 ` [PATCH 3/8] staging: omap-thermal: rename bg_ptr to bgp Eduardo Valentin
2013-03-18 14:59 ` [PATCH 4/8] staging: rename omap-thermal driver to ti-soc-thermal Eduardo Valentin
2013-03-18 19:17 ` Dan Carpenter
2013-03-18 14:59 ` [PATCH 5/8] staging: ti-soc-thermal: make unexported functions local Eduardo Valentin
2013-03-18 14:59 ` [PATCH 6/8] staging: ti-soc-thermal: split writable data from readonly data Eduardo Valentin
2013-03-18 14:59 ` [PATCH 7/8] stating: ti-soc-thermal: use sizeof(*pointer) while allocating Eduardo Valentin
2013-03-18 14:59 ` [PATCH 8/8] staging: ti-soc-thermal: fix several kernel-doc warnings and error Eduardo Valentin
2013-03-19 14:36 ` [PATCH 0/8] staging: [omap,ti-soc]-thermal: fixes and renaming Eduardo Valentin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363618756-15851-3-git-send-email-eduardo.valentin@ti.com \
--to=eduardo.valentin@ti.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).