All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Schmidt <list.linux-scsi@jan-o-sch.net>
To: "Moore, Eric" <Eric.Moore@lsi.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: mpt2sas: BUG: using smp_processor_id() in preemptible
Date: Tue, 21 Feb 2012 10:01:13 +0100	[thread overview]
Message-ID: <4F435D59.1000302@jan-o-sch.net> (raw)
In-Reply-To: <4565AEA676113A449269C2F3A549520FB5AE22B0@cosmail03.lsi.com>

Hi Eric,

On 21.02.2012 00:06, Moore, Eric wrote:
> Jan - the smp_processor_id() is part of NUMA support which I added over a year ago. I don't see any problem with the driver running on sles11sp2 which has btrfs support ( I'm not sure  if CONFIG_DEBUG_PREEMPT is turned on as I have not checked).   Any theory why its oopsing in smp_processor_id() ?

-- excerpt from include/linux/smp.h --
/*
 * smp_processor_id(): get the current CPU ID.
 *
 * if DEBUG_PREEMPT is enabled then we check whether it is
 * used in a preemption-safe way. (smp_processor_id() is safe
 * if it's used in a preemption-off critical section, or in
 * a thread that is bound to the current CPU.)
[...]
 */
#ifdef CONFIG_DEBUG_PREEMPT
  extern unsigned int debug_smp_processor_id(void);
# define smp_processor_id() debug_smp_processor_id()
#else
# define smp_processor_id() raw_smp_processor_id()
#endif
 
#define get_cpu()               ({ preempt_disable(); smp_processor_id(); })
#define put_cpu()               preempt_enable()
-- end --

... and ...

-- excerpt from drivers/scsi/mpt2sas/mpt2sas_base.c --
static inline u8 
_base_get_msix_index(struct MPT2SAS_ADAPTER *ioc)
{
        return ioc->cpu_msix_table[smp_processor_id()]; 
}
-- end --

Suggestion: Use get_cpu() and put_cpu().

-Jan

  reply	other threads:[~2012-02-21  9:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 13:56 mpt2sas: BUG: using smp_processor_id() in preemptible Jan Schmidt
2012-02-20 23:06 ` Moore, Eric
2012-02-21  9:01   ` Jan Schmidt [this message]
2012-02-21 14:18     ` James Bottomley
2012-02-21 14:24       ` Jan Schmidt

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=4F435D59.1000302@jan-o-sch.net \
    --to=list.linux-scsi@jan-o-sch.net \
    --cc=Eric.Moore@lsi.com \
    --cc=linux-scsi@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 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.