* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 2005-2006 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2005 Silicon Graphics, Inc. All rights reserved.
*
* This work was based on the 2.4/2.6 kernel development by Dick Reigner.
* Work to add BIOS PROM support was completed by Mike Habeck.
#include <linux/pci.h>
#include <linux/proc_fs.h>
#include <linux/types.h>
-#include <linux/mutex.h>
#include <asm/sn/addrs.h>
#include <asm/sn/l1.h>
.get_power_status = get_power_status,
};
-static DEFINE_MUTEX(sn_hotplug_mutex);
+static DECLARE_MUTEX(sn_hotplug_sem);
static ssize_t path_show (struct hotplug_slot *bss_hotplug_slot,
char *buf)
list_for_each_entry(child, &subordinate_bus->devices, bus_list)
sn_bus_free_data(child);
}
- /*
- * Some drivers may use dma accesses during the
- * driver remove function. We release the sysdata
- * areas after the driver remove functions have
- * been called.
- */
- sn_bus_store_sysdata(dev);
sn_pci_unfixup_slot(dev);
}
int rc;
/* Serialize the Linux PCI infrastructure */
- mutex_lock(&sn_hotplug_mutex);
+ down(&sn_hotplug_sem);
/*
* Power-on and initialize the slot in the SN
*/
rc = sn_slot_enable(bss_hotplug_slot, slot->device_num);
if (rc) {
- mutex_unlock(&sn_hotplug_mutex);
+ up(&sn_hotplug_sem);
return rc;
}
PCI_DEVFN(slot->device_num + 1, 0));
if (!num_funcs) {
dev_dbg(slot->pci_bus->self, "no device in slot\n");
- mutex_unlock(&sn_hotplug_mutex);
+ up(&sn_hotplug_sem);
return -ENODEV;
}
if (new_ppb)
pci_bus_add_devices(new_bus);
- mutex_unlock(&sn_hotplug_mutex);
+ up(&sn_hotplug_sem);
if (rc == 0)
dev_dbg(slot->pci_bus->self,
int rc;
/* Acquire update access to the bus */
- mutex_lock(&sn_hotplug_mutex);
+ down(&sn_hotplug_sem);
/* is it okay to bring this slot down? */
rc = sn_slot_disable(bss_hotplug_slot, slot->device_num,
PCI_DEVFN(slot->device_num + 1,
PCI_FUNC(func)));
if (dev) {
+ /*
+ * Some drivers may use dma accesses during the
+ * driver remove function. We release the sysdata
+ * areas after the driver remove functions have
+ * been called.
+ */
+ sn_bus_store_sysdata(dev);
sn_bus_free_data(dev);
pci_remove_bus_device(dev);
pci_dev_put(dev);
PCI_REQ_SLOT_DISABLE);
leaving:
/* Release the bus lock */
- mutex_unlock(&sn_hotplug_mutex);
+ up(&sn_hotplug_sem);
return rc;
}
struct pcibus_info *pcibus_info;
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus);
- mutex_lock(&sn_hotplug_mutex);
+ down(&sn_hotplug_sem);
*value = pcibus_info->pbi_enabled_devices & (1 << slot->device_num);
- mutex_unlock(&sn_hotplug_mutex);
+ up(&sn_hotplug_sem);
return 0;
}