Skip to content

Commit

Permalink
x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
Browse files Browse the repository at this point in the history
'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>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Myron Stowe authored and Jesse Barnes committed Mar 2, 2012
1 parent 6748dcc commit 63ab387
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

list_for_each_entry(map, &pcibios_fwaddrmappings, list)
if (map->dev == dev)
return map;
Expand Down

0 comments on commit 63ab387

Please sign in to comment.