Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Feb 1, 2006
2 parents 69396dc + 3103039 commit ef59c4e
Show file tree
Hide file tree
Showing 21 changed files with 294 additions and 404 deletions.
14 changes: 14 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,17 @@ Why: The 8250 serial driver now has the ability to deal with the differences
brother on Alchemy SOCs. The loss of features is not considered an
issue.
Who: Ralf Baechle <ralf@linux-mips.org>

---------------------------

What: Legacy /proc/pci interface (PCI_LEGACY_PROC)
When: March 2006
Why: deprecated since 2.5.53 in favor of lspci(8)
Who: Adrian Bunk <bunk@stusta.de>

---------------------------

What: pci_module_init(driver)
When: January 2007
Why: Is replaced by pci_register_driver(pci_driver).
Who: Richard Knutsson <ricknu-0@student.ltu.se> and Greg Kroah-Hartman <gregkh@suse.de>
5 changes: 5 additions & 0 deletions arch/i386/pci/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
case PCI_DEVICE_ID_INTEL_ICH7_30:
case PCI_DEVICE_ID_INTEL_ICH7_31:
case PCI_DEVICE_ID_INTEL_ESB2_0:
case PCI_DEVICE_ID_INTEL_ICH8_0:
case PCI_DEVICE_ID_INTEL_ICH8_1:
case PCI_DEVICE_ID_INTEL_ICH8_2:
case PCI_DEVICE_ID_INTEL_ICH8_3:
case PCI_DEVICE_ID_INTEL_ICH8_4:
r->name = "PIIX/ICH";
r->get = pirq_piix_get;
r->set = pirq_piix_set;
Expand Down
15 changes: 13 additions & 2 deletions arch/i386/pci/mmconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
while (1) {
++cfg_num;
if (cfg_num >= pci_mmcfg_config_num) {
/* Not found - fallback to type 1 */
return 0;
break;
}
cfg = &pci_mmcfg_config[cfg_num];
if (cfg->pci_segment_group_number != seg)
Expand All @@ -46,6 +45,18 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
(cfg->end_bus_number >= bus))
return cfg->base_address;
}

/* Handle more broken MCFG tables on Asus etc.
They only contain a single entry for bus 0-0. Assume
this applies to all busses. */
cfg = &pci_mmcfg_config[0];
if (pci_mmcfg_config_num == 1 &&
cfg->pci_segment_group_number == 0 &&
(cfg->start_bus_number | cfg->end_bus_number) == 0)
return cfg->base_address;

/* Fall back to type 0 */
return 0;
}

static inline void pci_exp_set_dev_base(unsigned int base, int bus, int devfn)
Expand Down
19 changes: 14 additions & 5 deletions arch/x86_64/pci/mmconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,27 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)

while (1) {
++cfg_num;
if (cfg_num >= pci_mmcfg_config_num) {
/* Not found - fall back to type 1. This happens
e.g. on the internal devices of a K8 northbridge. */
return NULL;
}
if (cfg_num >= pci_mmcfg_config_num)
break;
cfg = pci_mmcfg_virt[cfg_num].cfg;
if (cfg->pci_segment_group_number != seg)
continue;
if ((cfg->start_bus_number <= bus) &&
(cfg->end_bus_number >= bus))
return pci_mmcfg_virt[cfg_num].virt;
}

/* Handle more broken MCFG tables on Asus etc.
They only contain a single entry for bus 0-0. Assume
this applies to all busses. */
cfg = &pci_mmcfg_config[0];
if (pci_mmcfg_config_num == 1 &&
cfg->pci_segment_group_number == 0 &&
(cfg->start_bus_number | cfg->end_bus_number) == 0)
return cfg->base_address;

/* Fall back to type 0 */
return 0;
}

static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
Expand Down
3 changes: 1 addition & 2 deletions drivers/pci/hotplug/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ config HOTPLUG_PCI
---help---
Say Y here if you have a motherboard with a PCI Hotplug controller.
This allows you to add and remove PCI cards while the machine is
powered up and running. The file system pcihpfs must be mounted
in order to interact with any PCI Hotplug controllers.
powered up and running.

To compile this driver as a module, choose M here: the
module will be called pci_hotplug.
Expand Down
21 changes: 9 additions & 12 deletions drivers/pci/hotplug/acpiphp_ibm.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static int ibm_get_table_from_acpi(char **bufp)
}

package = (union acpi_object *) buffer.pointer;
if(!(package) ||
if (!(package) ||
(package->type != ACPI_TYPE_PACKAGE) ||
!(package->package.elements)) {
err("%s: Invalid APCI object\n", __FUNCTION__);
Expand Down Expand Up @@ -405,7 +405,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
}
info.hardware_id.value[sizeof(info.hardware_id.value) - 1] = '\0';

if(info.current_status && (info.valid & ACPI_VALID_HID) &&
if (info.current_status && (info.valid & ACPI_VALID_HID) &&
(!strcmp(info.hardware_id.value, IBM_HARDWARE_ID1) ||
!strcmp(info.hardware_id.value, IBM_HARDWARE_ID2))) {
dbg("found hardware: %s, handle: %p\n", info.hardware_id.value,
Expand Down Expand Up @@ -449,13 +449,11 @@ static int __init ibm_acpiphp_init(void)
}

ibm_note.device = device;
status = acpi_install_notify_handler(
ibm_acpi_handle,
ACPI_DEVICE_NOTIFY,
ibm_handle_events,
status = acpi_install_notify_handler(ibm_acpi_handle,
ACPI_DEVICE_NOTIFY, ibm_handle_events,
&ibm_note);
if (ACPI_FAILURE(status)) {
err("%s: Failed to register notification handler\n",
err("%s: Failed to register notification handler\n",
__FUNCTION__);
retval = -EBUSY;
goto init_cleanup;
Expand All @@ -482,14 +480,13 @@ static void __exit ibm_acpiphp_exit(void)
if (acpiphp_unregister_attention(&ibm_attention_info))
err("%s: attention info deregistration failed", __FUNCTION__);

status = acpi_remove_notify_handler(
status = acpi_remove_notify_handler(
ibm_acpi_handle,
ACPI_DEVICE_NOTIFY,
ibm_handle_events);
if (ACPI_FAILURE(status))
err("%s: Notification handler removal failed\n",
__FUNCTION__);
// remove the /sys entries
if (ACPI_FAILURE(status))
err("%s: Notification handler removal failed\n", __FUNCTION__);
/* remove the /sys entries */
if (sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr))
err("%s: removal of sysfs file apci_table failed\n",
__FUNCTION__);
Expand Down
4 changes: 2 additions & 2 deletions drivers/pci/hotplug/ibmphp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
{
int rc = 0;
struct slot *pslot;
u8 cmd;
u8 cmd = 0x00; /* avoid compiler warning */

debug("set_attention_status - Entry hotplug_slot[%lx] value[%x]\n",
(ulong) hotplug_slot, value);
ibmphp_lock_operations();
cmd = 0x00; // avoid compiler warning


if (hotplug_slot) {
switch (value) {
Expand Down
64 changes: 34 additions & 30 deletions drivers/pci/hotplug/rpadlpar_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ static struct slot *find_slot(struct device_node *dn)
struct list_head *tmp, *n;
struct slot *slot;

list_for_each_safe(tmp, n, &rpaphp_slot_head) {
slot = list_entry(tmp, struct slot, rpaphp_slot_list);
if (slot->dn == dn)
return slot;
}
list_for_each_safe(tmp, n, &rpaphp_slot_head) {
slot = list_entry(tmp, struct slot, rpaphp_slot_list);
if (slot->dn == dn)
return slot;
}

return NULL;
return NULL;
}

static struct pci_dev *dlpar_find_new_dev(struct pci_bus *parent,
Expand All @@ -126,9 +126,9 @@ static struct pci_dev *dlpar_find_new_dev(struct pci_bus *parent,
return NULL;
}

static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn)
static void dlpar_pci_add_bus(struct device_node *dn)
{
struct pci_dn *pdn = dn->data;
struct pci_dn *pdn = PCI_DN(dn);
struct pci_controller *phb = pdn->phb;
struct pci_dev *dev = NULL;

Expand All @@ -139,52 +139,52 @@ static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn)
if (!dev) {
printk(KERN_ERR "%s: failed to create pci dev for %s\n",
__FUNCTION__, dn->full_name);
return NULL;
return;
}

if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
of_scan_pci_bridge(dn, dev);

rpaphp_init_new_devs(dev->subordinate);
pcibios_fixup_new_pci_devices(dev->subordinate,0);

/* Claim new bus resources */
pcibios_claim_one_bus(dev->bus);

/* ioremap() for child bus, which may or may not succeed */
(void) remap_bus_range(dev->bus);
remap_bus_range(dev->subordinate);

/* Add new devices to global lists. Register in proc, sysfs. */
pci_bus_add_devices(phb->bus);

/* Confirm new bridge dev was created */
dev = dlpar_find_new_dev(phb->bus, dn);
if (dev) {
if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
printk(KERN_ERR "%s: unexpected header type %d\n",
__FUNCTION__, dev->hdr_type);
return NULL;
}
}

return dev;
}

static int dlpar_add_pci_slot(char *drc_name, struct device_node *dn)
{
struct pci_dev *dev;
struct pci_controller *phb;

if (rpaphp_find_pci_bus(dn))
if (pcibios_find_pci_bus(dn))
return -EINVAL;

/* Add pci bus */
dev = dlpar_pci_add_bus(dn);
dlpar_pci_add_bus(dn);

/* Confirm new bridge dev was created */
phb = PCI_DN(dn)->phb;
dev = dlpar_find_new_dev(phb->bus, dn);

if (!dev) {
printk(KERN_ERR "%s: unable to add bus %s\n", __FUNCTION__,
drc_name);
return -EIO;
}

if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
printk(KERN_ERR "%s: unexpected header type %d, unable to add bus %s\n",
__FUNCTION__, dev->hdr_type, drc_name);
return -EIO;
}

/* Add hotplug slot */
if (rpaphp_add_slot(dn)) {
printk(KERN_ERR "%s: unable to add hotplug slot %s\n",
Expand Down Expand Up @@ -221,13 +221,13 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
struct pci_dn *pdn;
int rc = 0;

if (!rpaphp_find_pci_bus(dn))
if (!pcibios_find_pci_bus(dn))
return -EINVAL;

slot = find_slot(dn);
if (slot) {
/* Remove hotplug slot */
if (rpaphp_remove_slot(slot)) {
if (rpaphp_deregister_slot(slot)) {
printk(KERN_ERR
"%s: unable to remove hotplug slot %s\n",
__FUNCTION__, drc_name);
Expand Down Expand Up @@ -366,21 +366,25 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
struct pci_bus *bus;
struct slot *slot;

bus = rpaphp_find_pci_bus(dn);
bus = pcibios_find_pci_bus(dn);
if (!bus)
return -EINVAL;

slot = find_slot(dn);
if (slot) {
/* Remove hotplug slot */
if (rpaphp_remove_slot(slot)) {
if (rpaphp_deregister_slot(slot)) {
printk(KERN_ERR
"%s: unable to remove hotplug slot %s\n",
__FUNCTION__, drc_name);
return -EIO;
}
} else {
rpaphp_unconfig_pci_adapter(bus);
struct pci_dev *dev, *tmp;
list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
eeh_remove_bus_device(dev);
pci_remove_bus_device(dev);
}
}

if (unmap_bus_range(bus)) {
Expand Down
14 changes: 4 additions & 10 deletions drivers/pci/hotplug/rpaphp.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,10 @@ extern int num_slots;
/* function prototypes */

/* rpaphp_pci.c */
extern struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn);
extern int rpaphp_claim_resource(struct pci_dev *dev, int resource);
extern int rpaphp_enable_pci_slot(struct slot *slot);
extern int register_pci_slot(struct slot *slot);
extern int rpaphp_register_pci_slot(struct slot *slot);
extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
extern void rpaphp_init_new_devs(struct pci_bus *bus);
extern void rpaphp_eeh_init_nodes(struct device_node *dn);

extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
extern int rpaphp_get_sensor_state(struct slot *slot, int *state);

/* rpaphp_core.c */
extern int rpaphp_add_slot(struct device_node *dn);
Expand All @@ -108,8 +102,8 @@ extern int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
/* rpaphp_slot.c */
extern void dealloc_slot_struct(struct slot *slot);
extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
extern int register_slot(struct slot *slot);
extern int deregister_slot(struct slot *slot);
extern int rpaphp_register_slot(struct slot *slot);
extern int rpaphp_deregister_slot(struct slot *slot);
extern int rpaphp_get_power_status(struct slot *slot, u8 * value);
extern int rpaphp_set_attention_status(struct slot *slot, u8 status);

Expand Down
Loading

0 comments on commit ef59c4e

Please sign in to comment.