linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <alex.shi@intel.com>
To: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
	"Moore, Eric" <Eric.Moore@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>,
	"jejb@kernel.org" <jejb@kernel.org>
Subject: Re: [PATCH] [SCSI] mpt2sas : Fix unsafe using smp_processor_id() inpreemptible
Date: Mon, 23 Apr 2012 09:29:42 +0800	[thread overview]
Message-ID: <4F94B086.4000502@intel.com> (raw)
In-Reply-To: <A6888A6805518E4EA4AF7072A28264A6067E89B20C@inbmail02.lsi.com>

On 04/20/2012 07:00 PM, Nandigama, Nagalakshmi wrote:

> diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
> index 272fab7..0f47f56 100644
> --- a/drivers/scsi/mpt2sas/mpt2sas_base.c
> +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
> @@ -1792,7 +1792,10 @@ 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()];
> +       int cpu = get_cpu();
> +       put_cpu();
> +       return ioc->cpu_msix_table[cpu];
> +
>  }


If we don't care the correctness interrupt CPU. Do
preempt_enable/preempt_disable is just waste of time.
A patch like following is enough, :)

 _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()];
 }


BTW, I didn't subscribe linux-scsi mailing list, so cc to me is
appreciated.

  reply	other threads:[~2012-04-23  1:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=4F94B086.4000502@intel.com \
    --to=alex.shi@intel.com \
    --cc=Eric.Moore@lsi.com \
    --cc=Nagalakshmi.Nandigama@lsi.com \
    --cc=Sathya.Prakash@lsi.com \
    --cc=jejb@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=stable@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).