lkml.org 
[lkml]   [2012]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
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?

thanks,

greg k-h


\
 
 \ /
  Last update: 2012-03-02 21:11    [W:0.056 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site