All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX
@ 2012-04-28  6:27 Alex Shi
  2012-04-30  5:29 ` Nandigama, Nagalakshmi
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Shi @ 2012-04-28  6:27 UTC (permalink / raw)
  To: JBottomley, Nagalakshmi.Nandigama; +Cc: linux-scsi, linux-kernel, alex.shi

smp_processor_id() need used in preempt safe ENV. Otherwise, the
cpu may be preempted and run on other cpus. But here, we don't care much
the specific CPU which handler the MSI, so just replace it by
raw_smp_processor_id() to avoid preempt debug warning.

Signed-off-by: Alex Shi <alex.shi@intel.com>
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 8a59a77..3f518ba 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()];
 }
 
 /**
-- 
1.7.5.4


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

* RE: [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX
  2012-04-28  6:27 [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX Alex Shi
@ 2012-04-30  5:29 ` Nandigama, Nagalakshmi
  2012-05-01  3:36   ` Alex Shi
  0 siblings, 1 reply; 3+ messages in thread
From: Nandigama, Nagalakshmi @ 2012-04-30  5:29 UTC (permalink / raw)
  To: Alex Shi, JBottomley; +Cc: linux-scsi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]

Alex, 
I submitted this patch already. 

James, request you to pick up the patch that I previously submitted for fixing this issue. Attaching the patch that I submitted previously.


Regards,
Nagalakshmi


-----Original Message-----
From: Alex Shi [mailto:alex.shi@intel.com] 
Sent: Saturday, April 28, 2012 11:58 AM
To: JBottomley@parallels.com; Nandigama, Nagalakshmi
Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; alex.shi@intel.com
Subject: [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX

smp_processor_id() need used in preempt safe ENV. Otherwise, the
cpu may be preempted and run on other cpus. But here, we don't care much
the specific CPU which handler the MSI, so just replace it by
raw_smp_processor_id() to avoid preempt debug warning.

Signed-off-by: Alex Shi <alex.shi@intel.com>
---
 drivers/scsi/mpt2sas/mpt2sas_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 8a59a77..3f518ba 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()];
 }
 
 /**
-- 
1.7.5.4


[-- Attachment #2: Type: message/rfc822, Size: 2627 bytes --]

From: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
To: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>, "stable@vger.kernel.org" <stable@vger.kernel.org>, "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>, "Prakash, Sathya" <Sathya.Prakash@lsi.com>, "Moore, Eric" <Eric.Moore@lsi.com>
Cc: "jejb@kernel.org" <jejb@kernel.org>
Subject: RE: [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible
Date: Fri, 27 Apr 2012 16:09:16 +0530
Message-ID: <A6888A6805518E4EA4AF7072A28264A6067E92E962@inbmail02.lsi.com>

James, this patch is not picked up for 3.5. Request you to push this patch for next release.

Regards,
Nagalakshmi


-----Original Message-----
From: nagalakshmi.nandigama@lsi.com [mailto:nagalakshmi.nandigama@lsi.com]
Sent: Tuesday, April 17, 2012 11:25 AM
To: stable@vger.kernel.org; linux-scsi@vger.kernel.org; Nandigama, Nagalakshmi; Prakash, Sathya; Moore, Eric
Cc: jejb@kernel.org
Subject: [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() in preemptible

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] 3+ messages in thread

* Re: [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX
  2012-04-30  5:29 ` Nandigama, Nagalakshmi
@ 2012-05-01  3:36   ` Alex Shi
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Shi @ 2012-05-01  3:36 UTC (permalink / raw)
  To: Nandigama, Nagalakshmi; +Cc: JBottomley, linux-scsi, linux-kernel

On 04/30/2012 01:29 PM, Nandigama, Nagalakshmi wrote:

> Alex, 
> I submitted this patch already. 


Ok. that's fine.

> 
> James, request you to pick up the patch that I previously submitted for fixing this issue. Attaching the patch that I submitted previously.
> 
> 
> Regards,
> Nagalakshmi
> 
> 
> -----Original Message-----
> From: Alex Shi [mailto:alex.shi@intel.com] 
> Sent: Saturday, April 28, 2012 11:58 AM
> To: JBottomley@parallels.com; Nandigama, Nagalakshmi
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; alex.shi@intel.com
> Subject: [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX
> 
> smp_processor_id() need used in preempt safe ENV. Otherwise, the
> cpu may be preempted and run on other cpus. But here, we don't care much
> the specific CPU which handler the MSI, so just replace it by
> raw_smp_processor_id() to avoid preempt debug warning.
> 
> Signed-off-by: Alex Shi <alex.shi@intel.com>
> ---
>  drivers/scsi/mpt2sas/mpt2sas_base.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> index 8a59a77..3f518ba 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()];
>  }
>  
>  /**



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

end of thread, other threads:[~2012-05-01  3:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-28  6:27 [PATCH] scsi/mpt2sas: remove unnecesscary preempt requirement for MSIX Alex Shi
2012-04-30  5:29 ` Nandigama, Nagalakshmi
2012-05-01  3:36   ` Alex Shi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.