Skip to content

Commit

Permalink
[PATCH] pciehp: reduce dependence on ACPI
Browse files Browse the repository at this point in the history
Reduce the PCI Express hotplug driver's dependence on ACPI.
We don't walk the acpi namespace anymore to build a list of
bridges and devices. We go to ACPI only to run the _OSC or
_OSHP methods to transition control of hotplug hardware from
system BIOS to the hotplug driver, and to run the _HPP
method to get hotplug device parameters like cache line size,
latency timer and SERR/PERR enable from BIOS.

Note that one of the side effects of this patch is that pciehp
does not automatically enable the hot-added device or its DMA
bus mastering capability now. It expects the device driver to
do that. This may break some drivers and we will have to fix
them as they are reported.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
rajesh.shah@intel.com authored and Greg Kroah-Hartman committed Nov 11, 2005
1 parent 71b720c commit a8a2be9
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 993 deletions.
11 changes: 11 additions & 0 deletions drivers/pci/hotplug/pciehp.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ extern int pciehp_debug;
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)

struct hotplug_params {
u8 cache_line_size;
u8 latency_timer;
u8 enable_serr;
u8 enable_perr;
};

struct pci_func {
struct pci_func *next;
u8 bus;
Expand Down Expand Up @@ -199,6 +206,10 @@ extern int pciehp_save_config (struct controller *ctrl, int busnumber, int num
extern int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot);
extern int pciehp_configure_device (struct slot *ctrl);
extern int pciehp_unconfigure_device (struct pci_func* func);
extern int get_hp_hw_control_from_firmware(struct pci_dev *dev);
extern void get_hp_params_from_firmware(struct pci_dev *dev,
struct hotplug_params *hpp);



/* Global variables */
Expand Down
20 changes: 6 additions & 14 deletions drivers/pci/hotplug/pciehp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <linux/init.h>
#include <asm/uaccess.h>
#include "pciehp.h"
#include "pciehprm.h"
#include <linux/interrupt.h>

/* Global variables */
Expand Down Expand Up @@ -381,6 +380,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
dbg("%s: DRV_thread pid = %d\n", __FUNCTION__, current->pid);

pdev = dev->port;
ctrl->pci_dev = pdev;

rc = pcie_init(ctrl, dev,
(php_intr_callback_t) pciehp_handle_attention_button,
Expand All @@ -392,8 +392,6 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
goto err_out_free_ctrl;
}

ctrl->pci_dev = pdev;

pci_set_drvdata(pdev, ctrl);

ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL);
Expand Down Expand Up @@ -609,18 +607,14 @@ static int __init pcied_init(void)
if (retval)
goto error_hpc_init;

retval = pciehprm_init(PCI);
if (!retval) {
retval = pcie_port_service_register(&hpdriver_portdrv);
dbg("pcie_port_service_register = %d\n", retval);
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
if (retval)
dbg("%s: Failure to register service\n", __FUNCTION__);
}
retval = pcie_port_service_register(&hpdriver_portdrv);
dbg("pcie_port_service_register = %d\n", retval);
info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
if (retval)
dbg("%s: Failure to register service\n", __FUNCTION__);

error_hpc_init:
if (retval) {
pciehprm_cleanup();
pciehp_event_stop_thread();
};

Expand All @@ -632,8 +626,6 @@ static void __exit pcied_cleanup(void)
dbg("unload_pciehpd()\n");
unload_pciehpd();

pciehprm_cleanup();

dbg("pcie_port_service_unregister\n");
pcie_port_service_unregister(&hpdriver_portdrv);

Expand Down
1 change: 0 additions & 1 deletion drivers/pci/hotplug/pciehp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <linux/pci.h>
#include "../pci.h"
#include "pciehp.h"
#include "pciehprm.h"

static void interrupt_event_handler(struct controller *ctrl);

Expand Down
4 changes: 4 additions & 0 deletions drivers/pci/hotplug/pciehp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,10 @@ int pcie_init(struct controller * ctrl,
}
dbg("%s: SLOT_STATUS offset %x writes slot_status %x\n", __FUNCTION__, SLOT_STATUS(ctrl->cap_base), temp_word);

rc = get_hp_hw_control_from_firmware(ctrl->pci_dev);
if (rc)
goto abort_free_ctlr;

/* Add this HPC instance into the HPC list */
spin_lock(&list_lock);
if (php_ctlr_list_head == 0) {
Expand Down
52 changes: 0 additions & 52 deletions drivers/pci/hotplug/pciehprm.h

This file was deleted.

Loading

0 comments on commit a8a2be9

Please sign in to comment.