Commit c7ee6396 authored by Dely Sy's avatar Dely Sy Committed by Greg Kroah-Hartman

[PATCH] PCI Hotplug: fixes for shpc and pcie hot-plug drivers

This patch contains the following:
1.  Fix up the pcie and shpc options to make it easier for distros
    to use as what we have discussed;
2.  Fix bug encountered when installing the drivers on non-hotplug
    systems;
3.  Put PCI_CAP_ID_SHPC in include/linux/pci.h
parent 2cf3f126
......@@ -135,20 +135,11 @@ config HOTPLUG_PCI_PCIE
When in doubt, say N.
config HOTPLUG_PCI_PCIE_POLL_EVENT_MODE
bool "Use polling mechanism for hot-plug events."
bool "Use polling mechanism for hot-plug events (for testing purpose)"
depends on HOTPLUG_PCI_PCIE
help
Say Y here if you want to use the polling mechanism for hot-plug
events.
When in doubt, say N.
config HOTPLUG_PCI_PCIE_PHPRM_NONACPI
bool "Non-ACPI: Use $HPRT for resource/configuration"
depends on HOTPLUG_PCI_PCIE
help
Say Y here if Hotplug resource/configuration information is provided
by platform BIOS $HPRT or bridge resource information, not by ACPI.
events for early platform testing.
When in doubt, say N.
......@@ -165,29 +156,20 @@ config HOTPLUG_PCI_SHPC
When in doubt, say N.
config HOTPLUG_PCI_SHPC_POLL_EVENT_MODE
bool "Use polling mechanism for hot-plug events"
bool "Use polling mechanism for hot-plug events (for testing purpose)"
depends on HOTPLUG_PCI_SHPC
help
Say Y here if you want to use the polling mechanism for hot-plug
events.
When in doubt, say N.
config HOTPLUG_PCI_SHPC_PHPRM_NONACPI
bool "Non-ACPI: Use $HPRT for resource/configuration"
depends on HOTPLUG_PCI_SHPC
help
Say Y here if Hotplug resource/configuration information is provided
by platform BIOS $HPRT or bridge resource information, not by ACPI.
events for early platform testing.
When in doubt, say N.
config HOTPLUG_PCI_SHPC_PHPRM_LEGACY
bool "For AMD SHPC only: Use $HRT for resource/configuration"
depends on HOTPLUG_PCI_SHPC && HOTPLUG_PCI_SHPC_PHPRM_NONACPI
depends on HOTPLUG_PCI_SHPC && !ACPI_BUS
help
Say Y here for AMD SHPC. You have to select this option if you are
using this driver on AMD platform with SHPC.
using this driver on platform with AMD SHPC.
config HOTPLUG_PCI_RPA
tristate "RPA PCI Hotplug driver"
......
......@@ -51,10 +51,12 @@ pciehp-objs := pciehp_core.o \
pciehp_sysfs.o \
pciehp_hpc.o
ifeq ($(CONFIG_HOTPLUG_PCI_PCIE_PHPRM_NONACPI),y)
pciehp-objs += pciehprm_nonacpi.o
else
ifdef CONFIG_HOTPLUG_PCI_PCIE
ifdef CONFIG_ACPI_BUS
pciehp-objs += pciehprm_acpi.o
else
pciehp-objs += pciehprm_nonacpi.o
endif
endif
shpchp-objs := shpchp_core.o \
......@@ -63,12 +65,14 @@ shpchp-objs := shpchp_core.o \
shpchp_sysfs.o \
shpchp_hpc.o
ifeq ($(CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY),y)
ifdef CONFIG_HOTPLUG_PCI_SHPC
ifdef CONFIG_ACPI_BUS
shpchp-objs += shpchprm_acpi.o
else
ifdef CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY
shpchp-objs += shpchprm_legacy.o
else
ifeq ($(CONFIG_HOTPLUG_PCI_SHPC_PHPRM_NONACPI),y)
shpchp-objs += shpchprm_nonacpi.o
else
shpchp-objs += shpchprm_acpi.o
shpchp-objs += shpchprm_nonacpi.o
endif
endif
endif
......@@ -1188,6 +1188,9 @@ static void free_a_bridge( struct acpi_bridge *ab)
static void pciehprm_free_bridges ( struct acpi_bridge *ab)
{
if (!ab)
return;
if (ab->child)
pciehprm_free_bridges (ab->child);
......
......@@ -154,9 +154,6 @@ struct resource_lists {
/* Define AMD SHPC ID */
#define PCI_DEVICE_ID_AMD_GOLAM_7450 0x7450
/* Define SHPC CAP ID - not defined in kernel yet */
#define PCI_CAP_ID_SHPC 0x0C
#define INT_BUTTON_IGNORE 0
#define INT_PRESENCE_ON 1
#define INT_PRESENCE_OFF 2
......
......@@ -1187,6 +1187,9 @@ static void free_a_bridge( struct acpi_bridge *ab)
static void shpchprm_free_bridges ( struct acpi_bridge *ab)
{
if (!ab)
return;
if (ab->child)
shpchprm_free_bridges (ab->child);
......
......@@ -199,6 +199,7 @@
#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
......
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