linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible
@ 2012-04-17  5:55 nagalakshmi.nandigama
  2012-04-18  3:14 ` Matthew Wilcox
  2012-04-27 10:39 ` Nandigama, Nagalakshmi
  0 siblings, 2 replies; 8+ messages in thread
From: nagalakshmi.nandigama @ 2012-04-17  5:55 UTC (permalink / raw)
  To: stable, linux-scsi, Nagalakshmi.Nandigama, Sathya.Prakash,
	Eric.Moore; +Cc: jejb

When CONFIG_DEBUG_PREEMPT is enabled, bug is observed in the smp_processor_id().
This is because smp_processor_id() is not called in preempt safe condition.

To fix this issue, use raw_smp_processor_id instead of smp_processor_id.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
CC: stable@vger.kernel.org
---

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 272fab7..b010be0 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1792,7 +1792,7 @@ static inline void _base_writeq(__u64 b, volatile void __iomem *addr,
 static inline u8
 _base_get_msix_index(struct MPT2SAS_ADAPTER *ioc)
 {
-	return ioc->cpu_msix_table[smp_processor_id()];
+	return ioc->cpu_msix_table[raw_smp_processor_id()];
 }
 
 /**

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-04-27 10:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17  5:55 [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible nagalakshmi.nandigama
2012-04-18  3:14 ` Matthew Wilcox
2012-04-18  3:35   ` Moore, Eric
2012-04-18  4:13     ` Matthew Wilcox
2012-04-20 11:00       ` [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() inpreemptible Nandigama, Nagalakshmi
2012-04-23  1:29         ` Alex Shi
2012-04-20 11:07       ` [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible James Bottomley
2012-04-27 10:39 ` Nandigama, Nagalakshmi

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).