[SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptible
author[email protected] <[email protected]>
Tue, 17 Apr 2012 05:55:04 +0000 (11:25 +0530)
committerJames Bottomley <[email protected]>
Wed, 6 Jun 2012 03:38:56 +0000 (12:38 +0900)
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 <[email protected]>
CC: [email protected]
Signed-off-by: James Bottomley <[email protected]>
drivers/scsi/mpt2sas/mpt2sas_base.c

index 6102ef2cb2d863ff23712d2cc5e6db2032f878bb..9d46fcbe7755fd2aa258e3de91c5a8cd76e3079c 100644 (file)
@@ -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()];
 }
 
 /**