From: nagalakshmi.nandigama@lsi.com Date: Tue, 17 Apr 2012 05:55:04 +0000 (+0530) Subject: SCSI: mpt2sas: Fix unsafe using smp_processor_id() in preemptible X-Git-Tag: v3.4.4~44 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=696615b7f9872cf81a840cde982775c521f56ea3;p=karo-tx-linux.git SCSI: mpt2sas: Fix unsafe using smp_processor_id() in preemptible commit a2c658505bf5c75516ee0a79287223e86a2474af upstream. 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 Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 18084788ee3c..3f03342b3030 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -1785,7 +1785,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()]; } /**