linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Myron Stowe <mstowe@redhat.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Myron Stowe <myron.stowe@redhat.com>,
	jbarnes@virtuousgeek.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
Date: Fri, 02 Mar 2012 13:18:20 -0700	[thread overview]
Message-ID: <1330719500.2378.20.camel@zim.stowe> (raw)
In-Reply-To: <20120302200027.GA4817@kroah.com>

On Fri, 2012-03-02 at 12:00 -0800, Greg KH wrote:
> On Fri, Mar 02, 2012 at 12:45:01PM -0700, Myron Stowe wrote:
> > 'pcibios_fwaddrmap_lookup()' is used to maintain FW-assigned BIOS BAR
> > values for reinstatement when normal resource assignment attempts
> > fail and must be called with the 'pcibios_fwaddrmap_lock' spinlock
> > held.
> > 
> > This patch adds a WARN_ON notification if the spinlock is not currently
> > held by the caller.
> > 
> > Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
> > ---
> > 
> >  arch/x86/pci/i386.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
> > index 33e6a0b..831971e 100644
> > --- a/arch/x86/pci/i386.c
> > +++ b/arch/x86/pci/i386.c
> > @@ -57,6 +57,8 @@ static struct pcibios_fwaddrmap *pcibios_fwaddrmap_lookup(struct pci_dev *dev)
> >  {
> >  	struct pcibios_fwaddrmap *map;
> >  
> > +	WARN_ON(!spin_is_locked(&pcibios_fwaddrmap_lock));
> > +
> 
> What is this going to help with?  How can someone then recover from this
> issue?  Just adding a warning message isn't going to fix any problems
> here, why not fix the root cause?

Greg:

We have not seen any issues.  Jesse just asked me to consider adding
such as a sanity check (I believe he said something to the effect: "I
had to read the code a couple of times to assure myself that the lock
was held" - but I should let Jesse comment himself).

Myron
> 
> thanks,
> 
> greg k-h



  reply	other threads:[~2012-03-02 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 19:45 [PATCH] x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()' Myron Stowe
2012-03-02 20:00 ` Greg KH
2012-03-02 20:18   ` Myron Stowe [this message]
2012-03-02 20:24   ` Jesse Barnes
2012-03-02 20:41     ` Greg KH
2012-03-02 21:09       ` Jesse Barnes
2012-03-02 20:04 ` Jesse Barnes

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=1330719500.2378.20.camel@zim.stowe \
    --to=mstowe@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=myron.stowe@redhat.com \
    /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).