Commit 615ddd7a authored by David S. Miller's avatar David S. Miller

[SPARC64]: Zap pci_controller_lock.

It is only taken during boot time bus probe, thus
protects nothing at run time and causes bogus bug
messages when PREEMPT is enabled.  When we support
PCI controller hot plug we will add a suitable locking
mechanism.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24fac1d2
...@@ -41,7 +41,6 @@ asmlinkage int sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -41,7 +41,6 @@ asmlinkage int sys_pciconfig_write(unsigned long bus, unsigned long dfn,
#else #else
/* List of all PCI controllers found in the system. */ /* List of all PCI controllers found in the system. */
spinlock_t pci_controller_lock = SPIN_LOCK_UNLOCKED;
struct pci_controller_info *pci_controller_root = NULL; struct pci_controller_info *pci_controller_root = NULL;
/* Each PCI controller found gets a unique index. */ /* Each PCI controller found gets a unique index. */
...@@ -298,12 +297,9 @@ static void __init pci_controller_probe(void) ...@@ -298,12 +297,9 @@ static void __init pci_controller_probe(void)
static void __init pci_scan_each_controller_bus(void) static void __init pci_scan_each_controller_bus(void)
{ {
struct pci_controller_info *p; struct pci_controller_info *p;
unsigned long flags;
spin_lock_irqsave(&pci_controller_lock, flags);
for (p = pci_controller_root; p; p = p->next) for (p = pci_controller_root; p; p = p->next)
p->scan_bus(p); p->scan_bus(p);
spin_unlock_irqrestore(&pci_controller_lock, flags);
} }
/* Reorder the pci_dev chain, so that onboard devices come first /* Reorder the pci_dev chain, so that onboard devices come first
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/io.h> #include <asm/io.h>
extern spinlock_t pci_controller_lock;
extern struct pci_controller_info *pci_controller_root; extern struct pci_controller_info *pci_controller_root;
extern int pci_num_controllers; extern int pci_num_controllers;
......
...@@ -1487,22 +1487,18 @@ void __init psycho_init(int node, char *model_name) ...@@ -1487,22 +1487,18 @@ void __init psycho_init(int node, char *model_name)
struct linux_prom64_registers pr_regs[3]; struct linux_prom64_registers pr_regs[3];
struct pci_controller_info *p; struct pci_controller_info *p;
struct pci_iommu *iommu; struct pci_iommu *iommu;
unsigned long flags;
u32 upa_portid; u32 upa_portid;
int is_pbm_a, err; int is_pbm_a, err;
upa_portid = prom_getintdefault(node, "upa-portid", 0xff); upa_portid = prom_getintdefault(node, "upa-portid", 0xff);
spin_lock_irqsave(&pci_controller_lock, flags);
for(p = pci_controller_root; p; p = p->next) { for(p = pci_controller_root; p; p = p->next) {
if (p->pbm_A.portid == upa_portid) { if (p->pbm_A.portid == upa_portid) {
spin_unlock_irqrestore(&pci_controller_lock, flags);
is_pbm_a = (p->pbm_A.prom_node == 0); is_pbm_a = (p->pbm_A.prom_node == 0);
psycho_pbm_init(p, node, is_pbm_a); psycho_pbm_init(p, node, is_pbm_a);
return; return;
} }
} }
spin_unlock_irqrestore(&pci_controller_lock, flags);
p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC); p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
if (!p) { if (!p) {
...@@ -1518,10 +1514,8 @@ void __init psycho_init(int node, char *model_name) ...@@ -1518,10 +1514,8 @@ void __init psycho_init(int node, char *model_name)
memset(iommu, 0, sizeof(*iommu)); memset(iommu, 0, sizeof(*iommu));
p->pbm_A.iommu = p->pbm_B.iommu = iommu; p->pbm_A.iommu = p->pbm_B.iommu = iommu;
spin_lock_irqsave(&pci_controller_lock, flags);
p->next = pci_controller_root; p->next = pci_controller_root;
pci_controller_root = p; pci_controller_root = p;
spin_unlock_irqrestore(&pci_controller_lock, flags);
p->pbm_A.portid = upa_portid; p->pbm_A.portid = upa_portid;
p->pbm_B.portid = upa_portid; p->pbm_B.portid = upa_portid;
......
...@@ -1602,10 +1602,8 @@ void __init sabre_init(int pnode, char *model_name) ...@@ -1602,10 +1602,8 @@ void __init sabre_init(int pnode, char *model_name)
upa_portid = prom_getintdefault(pnode, "upa-portid", 0xff); upa_portid = prom_getintdefault(pnode, "upa-portid", 0xff);
spin_lock_irqsave(&pci_controller_lock, flags);
p->next = pci_controller_root; p->next = pci_controller_root;
pci_controller_root = p; pci_controller_root = p;
spin_unlock_irqrestore(&pci_controller_lock, flags);
p->pbm_A.portid = upa_portid; p->pbm_A.portid = upa_portid;
p->pbm_B.portid = upa_portid; p->pbm_B.portid = upa_portid;
......
...@@ -2081,13 +2081,11 @@ static void __init __schizo_init(int node, char *model_name, int chip_type) ...@@ -2081,13 +2081,11 @@ static void __init __schizo_init(int node, char *model_name, int chip_type)
{ {
struct pci_controller_info *p; struct pci_controller_info *p;
struct pci_iommu *iommu; struct pci_iommu *iommu;
unsigned long flags;
int is_pbm_a; int is_pbm_a;
u32 portid; u32 portid;
portid = prom_getintdefault(node, "portid", 0xff); portid = prom_getintdefault(node, "portid", 0xff);
spin_lock_irqsave(&pci_controller_lock, flags);
for(p = pci_controller_root; p; p = p->next) { for(p = pci_controller_root; p; p = p->next) {
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
...@@ -2099,13 +2097,11 @@ static void __init __schizo_init(int node, char *model_name, int chip_type) ...@@ -2099,13 +2097,11 @@ static void __init __schizo_init(int node, char *model_name, int chip_type)
&p->pbm_B); &p->pbm_B);
if (portid_compare(pbm->portid, portid, chip_type)) { if (portid_compare(pbm->portid, portid, chip_type)) {
spin_unlock_irqrestore(&pci_controller_lock, flags);
is_pbm_a = (p->pbm_A.prom_node == 0); is_pbm_a = (p->pbm_A.prom_node == 0);
schizo_pbm_init(p, node, portid, chip_type); schizo_pbm_init(p, node, portid, chip_type);
return; return;
} }
} }
spin_unlock_irqrestore(&pci_controller_lock, flags);
p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC); p = kmalloc(sizeof(struct pci_controller_info), GFP_ATOMIC);
if (!p) { if (!p) {
...@@ -2130,10 +2126,8 @@ static void __init __schizo_init(int node, char *model_name, int chip_type) ...@@ -2130,10 +2126,8 @@ static void __init __schizo_init(int node, char *model_name, int chip_type)
memset(iommu, 0, sizeof(*iommu)); memset(iommu, 0, sizeof(*iommu));
p->pbm_B.iommu = iommu; p->pbm_B.iommu = iommu;
spin_lock_irqsave(&pci_controller_lock, flags);
p->next = pci_controller_root; p->next = pci_controller_root;
pci_controller_root = p; pci_controller_root = p;
spin_unlock_irqrestore(&pci_controller_lock, flags);
p->index = pci_num_controllers++; p->index = pci_num_controllers++;
p->pbms_same_domain = 0; p->pbms_same_domain = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment