Commit b7f21bb2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6

* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (21 commits)
  x86/PCI: make 32 bit NUMA node array int, not unsigned char
  x86/PCI: default pcibus cpumask to all cpus if it lacks affinity
  MAINTAINTERS: remove hotplug driver entries
  PCI: pciehp: remove slot capabilities definitions
  PCI: pciehp: remove error message definitions
  PCI: pciehp: remove number field
  PCI: pciehp: remove hpc_ops
  PCI: pciehp: remove pci_dev field
  PCI: pciehp: remove crit_sect mutex
  PCI: pciehp: remove slot_bus field
  PCI: pciehp: remove first_slot field
  PCI: pciehp: remove slot_device_offset field
  PCI: pciehp: remove hp_slot field
  PCI: pciehp: remove device field
  PCI: pciehp: remove bus field
  PCI: pciehp: remove slot_num_inc field
  PCI: pciehp: remove num_slots field
  PCI: pciehp: remove slot_list field
  PCI: fix VGA arbiter header file
  PCI: Disable AER with pci=nomsi
  ...

Fixed up trivial conflicts in MAINTAINERS
parents 7ca263cd 76baeebf
...@@ -257,12 +257,6 @@ W: http://www.lesswatts.org/projects/acpi/ ...@@ -257,12 +257,6 @@ W: http://www.lesswatts.org/projects/acpi/
S: Supported S: Supported
F: drivers/acpi/fan.c F: drivers/acpi/fan.c
ACPI PCI HOTPLUG DRIVER
M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
L: linux-pci@vger.kernel.org
S: Supported
F: drivers/pci/hotplug/acpi*
ACPI THERMAL DRIVER ACPI THERMAL DRIVER
M: Zhang Rui <rui.zhang@intel.com> M: Zhang Rui <rui.zhang@intel.com>
L: linux-acpi@vger.kernel.org L: linux-acpi@vger.kernel.org
...@@ -4005,11 +3999,11 @@ F: Documentation/PCI/ ...@@ -4005,11 +3999,11 @@ F: Documentation/PCI/
F: drivers/pci/ F: drivers/pci/
F: include/linux/pci* F: include/linux/pci*
PCIE HOTPLUG DRIVER PCI HOTPLUG
M: Kristen Carlson Accardi <kristen.c.accardi@intel.com> M: Jesse Barnes <jbarnes@virtuousgeek.org>
L: linux-pci@vger.kernel.org L: linux-pci@vger.kernel.org
S: Supported S: Supported
F: drivers/pci/pcie/ F: drivers/pci/hotplug
PCMCIA SUBSYSTEM PCMCIA SUBSYSTEM
P: Linux PCMCIA Team P: Linux PCMCIA Team
...@@ -4672,12 +4666,6 @@ F: drivers/serial/serial_lh7a40x.c ...@@ -4672,12 +4666,6 @@ F: drivers/serial/serial_lh7a40x.c
F: drivers/usb/gadget/lh7a40* F: drivers/usb/gadget/lh7a40*
F: drivers/usb/host/ohci-lh7a40* F: drivers/usb/host/ohci-lh7a40*
SHPC HOTPLUG DRIVER
M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
L: linux-pci@vger.kernel.org
S: Supported
F: drivers/pci/hotplug/shpchp*
SIMPLE FIRMWARE INTERFACE (SFI) SIMPLE FIRMWARE INTERFACE (SFI)
P: Len Brown P: Len Brown
M: lenb@kernel.org M: lenb@kernel.org
...@@ -4689,7 +4677,6 @@ F: arch/x86/kernel/*sfi* ...@@ -4689,7 +4677,6 @@ F: arch/x86/kernel/*sfi*
F: drivers/sfi/ F: drivers/sfi/
F: include/linux/sfi*.h F: include/linux/sfi*.h
SIMTEC EB110ATX (Chalice CATS) SIMTEC EB110ATX (Chalice CATS)
P: Ben Dooks P: Ben Dooks
M: Vincent Sanders <support@simtec.co.uk> M: Vincent Sanders <support@simtec.co.uk>
......
...@@ -143,7 +143,11 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) ...@@ -143,7 +143,11 @@ static inline int __pcibus_to_node(const struct pci_bus *bus)
static inline const struct cpumask * static inline const struct cpumask *
cpumask_of_pcibus(const struct pci_bus *bus) cpumask_of_pcibus(const struct pci_bus *bus)
{ {
return cpumask_of_node(__pcibus_to_node(bus)); int node;
node = __pcibus_to_node(bus);
return (node == -1) ? cpu_online_mask :
cpumask_of_node(node);
} }
#endif #endif
......
...@@ -646,7 +646,7 @@ int get_mp_bus_to_node(int busnum) ...@@ -646,7 +646,7 @@ int get_mp_bus_to_node(int busnum)
#else /* CONFIG_X86_32 */ #else /* CONFIG_X86_32 */
static unsigned char mp_bus_to_node[BUS_NR] = { static int mp_bus_to_node[BUS_NR] = {
[0 ... BUS_NR - 1] = -1 [0 ... BUS_NR - 1] = -1
}; };
......
...@@ -72,15 +72,9 @@ do { \ ...@@ -72,15 +72,9 @@ do { \
#define SLOT_NAME_SIZE 10 #define SLOT_NAME_SIZE 10
struct slot { struct slot {
u8 bus;
u8 device;
u8 state; u8 state;
u8 hp_slot;
u32 number;
struct controller *ctrl; struct controller *ctrl;
struct hpc_ops *hpc_ops;
struct hotplug_slot *hotplug_slot; struct hotplug_slot *hotplug_slot;
struct list_head slot_list;
struct delayed_work work; /* work for button event */ struct delayed_work work; /* work for button event */
struct mutex lock; struct mutex lock;
}; };
...@@ -92,18 +86,10 @@ struct event_info { ...@@ -92,18 +86,10 @@ struct event_info {
}; };
struct controller { struct controller {
struct mutex crit_sect; /* critical section mutex */
struct mutex ctrl_lock; /* controller lock */ struct mutex ctrl_lock; /* controller lock */
int num_slots; /* Number of slots on ctlr */
int slot_num_inc; /* 1 or -1 */
struct pci_dev *pci_dev;
struct pcie_device *pcie; /* PCI Express port service */ struct pcie_device *pcie; /* PCI Express port service */
struct list_head slot_list; struct slot *slot;
struct hpc_ops *hpc_ops;
wait_queue_head_t queue; /* sleep & wake process */ wait_queue_head_t queue; /* sleep & wake process */
u8 slot_device_offset;
u32 first_slot; /* First physical slot number */ /* PCIE only has 1 slot */
u8 slot_bus; /* Bus where the slots handled by this controller sit */
u32 slot_cap; u32 slot_cap;
u8 cap_base; u8 cap_base;
struct timer_list poll_timer; struct timer_list poll_timer;
...@@ -131,40 +117,20 @@ struct controller { ...@@ -131,40 +117,20 @@ struct controller {
#define POWERON_STATE 3 #define POWERON_STATE 3
#define POWEROFF_STATE 4 #define POWEROFF_STATE 4
/* Error messages */ #define ATTN_BUTTN(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_ABP)
#define INTERLOCK_OPEN 0x00000002 #define POWER_CTRL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PCP)
#define ADD_NOT_SUPPORTED 0x00000003 #define MRL_SENS(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_MRLSP)
#define CARD_FUNCTIONING 0x00000005 #define ATTN_LED(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_AIP)
#define ADAPTER_NOT_SAME 0x00000006 #define PWR_LED(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_PIP)
#define NO_ADAPTER_PRESENT 0x00000009 #define HP_SUPR_RM(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_HPS)
#define NOT_ENOUGH_RESOURCES 0x0000000B #define EMI(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_EIP)
#define DEVICE_TYPE_NOT_SUPPORTED 0x0000000C #define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & PCI_EXP_SLTCAP_NCCS)
#define WRONG_BUS_FREQUENCY 0x0000000D #define PSN(ctrl) ((ctrl)->slot_cap >> 19)
#define POWER_FAILURE 0x0000000E
/* Field definitions in Slot Capabilities Register */
#define ATTN_BUTTN_PRSN 0x00000001
#define PWR_CTRL_PRSN 0x00000002
#define MRL_SENS_PRSN 0x00000004
#define ATTN_LED_PRSN 0x00000008
#define PWR_LED_PRSN 0x00000010
#define HP_SUPR_RM_SUP 0x00000020
#define EMI_PRSN 0x00020000
#define NO_CMD_CMPL_SUP 0x00040000
#define ATTN_BUTTN(ctrl) ((ctrl)->slot_cap & ATTN_BUTTN_PRSN)
#define POWER_CTRL(ctrl) ((ctrl)->slot_cap & PWR_CTRL_PRSN)
#define MRL_SENS(ctrl) ((ctrl)->slot_cap & MRL_SENS_PRSN)
#define ATTN_LED(ctrl) ((ctrl)->slot_cap & ATTN_LED_PRSN)
#define PWR_LED(ctrl) ((ctrl)->slot_cap & PWR_LED_PRSN)
#define HP_SUPR_RM(ctrl) ((ctrl)->slot_cap & HP_SUPR_RM_SUP)
#define EMI(ctrl) ((ctrl)->slot_cap & EMI_PRSN)
#define NO_CMD_CMPL(ctrl) ((ctrl)->slot_cap & NO_CMD_CMPL_SUP)
extern int pciehp_sysfs_enable_slot(struct slot *slot); extern int pciehp_sysfs_enable_slot(struct slot *slot);
extern int pciehp_sysfs_disable_slot(struct slot *slot); extern int pciehp_sysfs_disable_slot(struct slot *slot);
extern u8 pciehp_handle_attention_button(struct slot *p_slot); extern u8 pciehp_handle_attention_button(struct slot *p_slot);
extern u8 pciehp_handle_switch_change(struct slot *p_slot); extern u8 pciehp_handle_switch_change(struct slot *p_slot);
extern u8 pciehp_handle_presence_change(struct slot *p_slot); extern u8 pciehp_handle_presence_change(struct slot *p_slot);
extern u8 pciehp_handle_power_fault(struct slot *p_slot); extern u8 pciehp_handle_power_fault(struct slot *p_slot);
extern int pciehp_configure_device(struct slot *p_slot); extern int pciehp_configure_device(struct slot *p_slot);
...@@ -175,45 +141,30 @@ int pcie_init_notification(struct controller *ctrl); ...@@ -175,45 +141,30 @@ int pcie_init_notification(struct controller *ctrl);
int pciehp_enable_slot(struct slot *p_slot); int pciehp_enable_slot(struct slot *p_slot);
int pciehp_disable_slot(struct slot *p_slot); int pciehp_disable_slot(struct slot *p_slot);
int pcie_enable_notification(struct controller *ctrl); int pcie_enable_notification(struct controller *ctrl);
int pciehp_power_on_slot(struct slot *slot);
int pciehp_power_off_slot(struct slot *slot);
int pciehp_get_power_status(struct slot *slot, u8 *status);
int pciehp_get_attention_status(struct slot *slot, u8 *status);
int pciehp_set_attention_status(struct slot *slot, u8 status);
int pciehp_get_latch_status(struct slot *slot, u8 *status);
int pciehp_get_adapter_status(struct slot *slot, u8 *status);
int pciehp_get_max_link_speed(struct slot *slot, enum pci_bus_speed *speed);
int pciehp_get_max_link_width(struct slot *slot, enum pcie_link_width *val);
int pciehp_get_cur_link_speed(struct slot *slot, enum pci_bus_speed *speed);
int pciehp_get_cur_link_width(struct slot *slot, enum pcie_link_width *val);
int pciehp_query_power_fault(struct slot *slot);
void pciehp_green_led_on(struct slot *slot);
void pciehp_green_led_off(struct slot *slot);
void pciehp_green_led_blink(struct slot *slot);
int pciehp_check_link_status(struct controller *ctrl);
void pciehp_release_ctrl(struct controller *ctrl);
static inline const char *slot_name(struct slot *slot) static inline const char *slot_name(struct slot *slot)
{ {
return hotplug_slot_name(slot->hotplug_slot); return hotplug_slot_name(slot->hotplug_slot);
} }
static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
{
struct slot *slot;
list_for_each_entry(slot, &ctrl->slot_list, slot_list) {
if (slot->device == device)
return slot;
}
ctrl_err(ctrl, "Slot (device=0x%02x) not found\n", device);
return NULL;
}
struct hpc_ops {
int (*power_on_slot)(struct slot *slot);
int (*power_off_slot)(struct slot *slot);
int (*get_power_status)(struct slot *slot, u8 *status);
int (*get_attention_status)(struct slot *slot, u8 *status);
int (*set_attention_status)(struct slot *slot, u8 status);
int (*get_latch_status)(struct slot *slot, u8 *status);
int (*get_adapter_status)(struct slot *slot, u8 *status);
int (*get_max_bus_speed)(struct slot *slot, enum pci_bus_speed *speed);
int (*get_cur_bus_speed)(struct slot *slot, enum pci_bus_speed *speed);
int (*get_max_lnk_width)(struct slot *slot, enum pcie_link_width *val);
int (*get_cur_lnk_width)(struct slot *slot, enum pcie_link_width *val);
int (*query_power_fault)(struct slot *slot);
void (*green_led_on)(struct slot *slot);
void (*green_led_off)(struct slot *slot);
void (*green_led_blink)(struct slot *slot);
void (*release_ctlr)(struct controller *ctrl);
int (*check_lnk_status)(struct controller *ctrl);
};
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
......
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
#define PCIEHP_DETECT_AUTO (2) #define PCIEHP_DETECT_AUTO (2)
#define PCIEHP_DETECT_DEFAULT PCIEHP_DETECT_AUTO #define PCIEHP_DETECT_DEFAULT PCIEHP_DETECT_AUTO
struct dummy_slot {
u32 number;
struct list_head list;
};
static int slot_detection_mode; static int slot_detection_mode;
static char *pciehp_detect_mode; static char *pciehp_detect_mode;
module_param(pciehp_detect_mode, charp, 0444); module_param(pciehp_detect_mode, charp, 0444);
...@@ -77,7 +82,7 @@ static int __init dummy_probe(struct pcie_device *dev) ...@@ -77,7 +82,7 @@ static int __init dummy_probe(struct pcie_device *dev)
int pos; int pos;
u32 slot_cap; u32 slot_cap;
acpi_handle handle; acpi_handle handle;
struct slot *slot, *tmp; struct dummy_slot *slot, *tmp;
struct pci_dev *pdev = dev->port; struct pci_dev *pdev = dev->port;
/* Note: pciehp_detect_mode != PCIEHP_DETECT_ACPI here */ /* Note: pciehp_detect_mode != PCIEHP_DETECT_ACPI here */
if (pciehp_get_hp_hw_control_from_firmware(pdev)) if (pciehp_get_hp_hw_control_from_firmware(pdev))
...@@ -89,11 +94,11 @@ static int __init dummy_probe(struct pcie_device *dev) ...@@ -89,11 +94,11 @@ static int __init dummy_probe(struct pcie_device *dev)
if (!slot) if (!slot)
return -ENOMEM; return -ENOMEM;
slot->number = slot_cap >> 19; slot->number = slot_cap >> 19;
list_for_each_entry(tmp, &dummy_slots, slot_list) { list_for_each_entry(tmp, &dummy_slots, list) {
if (tmp->number == slot->number) if (tmp->number == slot->number)
dup_slot_id++; dup_slot_id++;
} }
list_add_tail(&slot->slot_list, &dummy_slots); list_add_tail(&slot->list, &dummy_slots);
handle = DEVICE_ACPI_HANDLE(&pdev->dev); handle = DEVICE_ACPI_HANDLE(&pdev->dev);
if (!acpi_slot_detected && acpi_pci_detect_ejectable(handle)) if (!acpi_slot_detected && acpi_pci_detect_ejectable(handle))
acpi_slot_detected = 1; acpi_slot_detected = 1;
...@@ -109,11 +114,11 @@ static struct pcie_port_service_driver __initdata dummy_driver = { ...@@ -109,11 +114,11 @@ static struct pcie_port_service_driver __initdata dummy_driver = {
static int __init select_detection_mode(void) static int __init select_detection_mode(void)
{ {
struct slot *slot, *tmp; struct dummy_slot *slot, *tmp;
pcie_port_service_register(&dummy_driver); pcie_port_service_register(&dummy_driver);
pcie_port_service_unregister(&dummy_driver); pcie_port_service_unregister(&dummy_driver);
list_for_each_entry_safe(slot, tmp, &dummy_slots, slot_list) { list_for_each_entry_safe(slot, tmp, &dummy_slots, list) {
list_del(&slot->slot_list); list_del(&slot->list);
kfree(slot); kfree(slot);
} }
if (acpi_slot_detected && dup_slot_id) if (acpi_slot_detected && dup_slot_id)
......
...@@ -99,65 +99,55 @@ static void release_slot(struct hotplug_slot *hotplug_slot) ...@@ -99,65 +99,55 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
kfree(hotplug_slot); kfree(hotplug_slot);
} }
static int init_slots(struct controller *ctrl) static int init_slot(struct controller *ctrl)
{ {
struct slot *slot; struct slot *slot = ctrl->slot;
struct hotplug_slot *hotplug_slot; struct hotplug_slot *hotplug = NULL;
struct hotplug_slot_info *info; struct hotplug_slot_info *info = NULL;
char name[SLOT_NAME_SIZE]; char name[SLOT_NAME_SIZE];
int retval = -ENOMEM; int retval = -ENOMEM;
list_for_each_entry(slot, &ctrl->slot_list, slot_list) { hotplug = kzalloc(sizeof(*hotplug), GFP_KERNEL);
hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL); if (!hotplug)
if (!hotplug_slot) goto out;
goto error;
info = kzalloc(sizeof(*info), GFP_KERNEL); info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
goto error_hpslot; goto out;
/* register this slot with the hotplug pci core */ /* register this slot with the hotplug pci core */
hotplug_slot->info = info; hotplug->info = info;
hotplug_slot->private = slot; hotplug->private = slot;
hotplug_slot->release = &release_slot; hotplug->release = &release_slot;
hotplug_slot->ops = &pciehp_hotplug_slot_ops; hotplug->ops = &pciehp_hotplug_slot_ops;
slot->hotplug_slot = hotplug_slot; slot->hotplug_slot = hotplug;
snprintf(name, SLOT_NAME_SIZE, "%u", slot->number); snprintf(name, SLOT_NAME_SIZE, "%u", PSN(ctrl));
ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x " ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:00 sun=%x\n",
"hp_slot=%x sun=%x slot_device_offset=%x\n", pci_domain_nr(ctrl->pcie->port->subordinate),
pci_domain_nr(ctrl->pci_dev->subordinate), ctrl->pcie->port->subordinate->number, PSN(ctrl));
slot->bus, slot->device, slot->hp_slot, slot->number, retval = pci_hp_register(hotplug,
ctrl->slot_device_offset); ctrl->pcie->port->subordinate, 0, name);
retval = pci_hp_register(hotplug_slot,
ctrl->pci_dev->subordinate,
slot->device,
name);
if (retval) { if (retval) {
ctrl_err(ctrl, "pci_hp_register failed with error %d\n", ctrl_err(ctrl,
retval); "pci_hp_register failed with error %d\n", retval);
goto error_info; goto out;
}
get_power_status(hotplug_slot, &info->power_status);
get_attention_status(hotplug_slot, &info->attention_status);
get_latch_status(hotplug_slot, &info->latch_status);
get_adapter_status(hotplug_slot, &info->adapter_status);
} }
get_power_status(hotplug, &info->power_status);
return 0; get_attention_status(hotplug, &info->attention_status);
error_info: get_latch_status(hotplug, &info->latch_status);
get_adapter_status(hotplug, &info->adapter_status);
out:
if (retval) {
kfree(info); kfree(info);
error_hpslot: kfree(hotplug);
kfree(hotplug_slot); }
error:
return retval; return retval;
} }
static void cleanup_slots(struct controller *ctrl) static void cleanup_slot(struct controller *ctrl)
{ {
struct slot *slot; pci_hp_deregister(ctrl->slot->hotplug_slot);
list_for_each_entry(slot, &ctrl->slot_list, slot_list)
pci_hp_deregister(slot->hotplug_slot);
} }
/* /*
...@@ -173,7 +163,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) ...@@ -173,7 +163,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
hotplug_slot->info->attention_status = status; hotplug_slot->info->attention_status = status;
if (ATTN_LED(slot->ctrl)) if (ATTN_LED(slot->ctrl))
slot->hpc_ops->set_attention_status(slot, status); pciehp_set_attention_status(slot, status);
return 0; return 0;
} }
...@@ -208,7 +198,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -208,7 +198,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
retval = slot->hpc_ops->get_power_status(slot, value); retval = pciehp_get_power_status(slot, value);
if (retval < 0) if (retval < 0)
*value = hotplug_slot->info->power_status; *value = hotplug_slot->info->power_status;
...@@ -223,7 +213,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -223,7 +213,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
retval = slot->hpc_ops->get_attention_status(slot, value); retval = pciehp_get_attention_status(slot, value);
if (retval < 0) if (retval < 0)
*value = hotplug_slot->info->attention_status; *value = hotplug_slot->info->attention_status;
...@@ -238,7 +228,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -238,7 +228,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
retval = slot->hpc_ops->get_latch_status(slot, value); retval = pciehp_get_latch_status(slot, value);
if (retval < 0) if (retval < 0)
*value = hotplug_slot->info->latch_status; *value = hotplug_slot->info->latch_status;
...@@ -253,7 +243,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -253,7 +243,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
retval = slot->hpc_ops->get_adapter_status(slot, value); retval = pciehp_get_adapter_status(slot, value);
if (retval < 0) if (retval < 0)
*value = hotplug_slot->info->adapter_status; *value = hotplug_slot->info->adapter_status;
...@@ -269,7 +259,7 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, ...@@ -269,7 +259,7 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot,
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
retval = slot->hpc_ops->get_max_bus_speed(slot, value); retval = pciehp_get_max_link_speed(slot, value);
if (retval < 0) if (retval < 0)
*value = PCI_SPEED_UNKNOWN; *value = PCI_SPEED_UNKNOWN;
...@@ -284,7 +274,7 @@ static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe ...@@ -284,7 +274,7 @@ static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
retval = slot->hpc_ops->get_cur_bus_speed(slot, value); retval = pciehp_get_cur_link_speed(slot, value);
if (retval < 0) if (retval < 0)
*value = PCI_SPEED_UNKNOWN; *value = PCI_SPEED_UNKNOWN;
...@@ -295,7 +285,7 @@ static int pciehp_probe(struct pcie_device *dev) ...@@ -295,7 +285,7 @@ static int pciehp_probe(struct pcie_device *dev)
{ {
int rc; int rc;
struct controller *ctrl; struct controller *ctrl;
struct slot *t_slot; struct slot *slot;
u8 value; u8 value;
struct pci_dev *pdev = dev->port; struct pci_dev *pdev = dev->port;
...@@ -314,7 +304,7 @@ static int pciehp_probe(struct pcie_device *dev) ...@@ -314,7 +304,7 @@ static int pciehp_probe(struct pcie_device *dev)
set_service_data(dev, ctrl); set_service_data(dev, ctrl);
/* Setup the slot information structures */ /* Setup the slot information structures */
rc = init_slots(ctrl); rc = init_slot(ctrl);
if (rc) { if (rc) {
if (rc == -EBUSY) if (rc == -EBUSY)
ctrl_warn(ctrl, "Slot already registered by another " ctrl_warn(ctrl, "Slot already registered by another "
...@@ -332,15 +322,15 @@ static int pciehp_probe(struct pcie_device *dev) ...@@ -332,15 +322,15 @@ static int pciehp_probe(struct pcie_device *dev)
} }
/* Check if slot is occupied */ /* Check if slot is occupied */
t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); slot = ctrl->slot;
t_slot->hpc_ops->get_adapter_status(t_slot, &value); pciehp_get_adapter_status(slot, &value);
if (value) { if (value) {
if (pciehp_force) if (pciehp_force)
pciehp_enable_slot(t_slot); pciehp_enable_slot(slot);
} else { } else {
/* Power off slot if not occupied */ /* Power off slot if not occupied */
if (POWER_CTRL(ctrl)) { if (POWER_CTRL(ctrl)) {
rc = t_slot->hpc_ops->power_off_slot(t_slot); rc = pciehp_power_off_slot(slot);
if (rc) if (rc)
goto err_out_free_ctrl_slot; goto err_out_free_ctrl_slot;
} }
...@@ -349,19 +339,19 @@ static int pciehp_probe(struct pcie_device *dev) ...@@ -349,19 +339,19 @@ static int pciehp_probe(struct pcie_device *dev)
return 0; return 0;
err_out_free_ctrl_slot: err_out_free_ctrl_slot:
cleanup_slots(ctrl); cleanup_slot(ctrl);
err_out_release_ctlr: err_out_release_ctlr:
ctrl->hpc_ops->release_ctlr(ctrl); pciehp_release_ctrl(ctrl);
err_out_none: err_out_none:
return -ENODEV; return -ENODEV;
} }
static void pciehp_remove (struct pcie_device *dev) static void pciehp_remove(struct pcie_device *dev)
{ {
struct controller *ctrl = get_service_data(dev); struct controller *ctrl = get_service_data(dev);
cleanup_slots(ctrl); cleanup_slot(ctrl);
ctrl->hpc_ops->release_ctlr(ctrl); pciehp_release_ctrl(ctrl);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -376,20 +366,20 @@ static int pciehp_resume (struct pcie_device *dev) ...@@ -376,20 +366,20 @@ static int pciehp_resume (struct pcie_device *dev)
dev_info(&dev->device, "%s ENTRY\n", __func__); dev_info(&dev->device, "%s ENTRY\n", __func__);
if (pciehp_force) { if (pciehp_force) {
struct controller *ctrl = get_service_data(dev); struct controller *ctrl = get_service_data(dev);
struct slot *t_slot; struct slot *slot;
u8 status; u8 status;
/* reinitialize the chipset's event detection logic */ /* reinitialize the chipset's event detection logic */
pcie_enable_notification(ctrl); pcie_enable_notification(ctrl);
t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); slot = ctrl->slot;
/* Check if slot is occupied */ /* Check if slot is occupied */
t_slot->hpc_ops->get_adapter_status(t_slot, &status); pciehp_get_adapter_status(slot, &status);
if (status) if (status)
pciehp_enable_slot(t_slot); pciehp_enable_slot(slot);
else else
pciehp_disable_slot(t_slot); pciehp_disable_slot(slot);
} }
return 0; return 0;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -63,27 +63,27 @@ static int __ref pciehp_add_bridge(struct pci_dev *dev) ...@@ -63,27 +63,27 @@ static int __ref pciehp_add_bridge(struct pci_dev *dev)
int pciehp_configure_device(struct slot *p_slot) int pciehp_configure_device(struct slot *p_slot)
{ {
struct pci_dev *dev; struct pci_dev *dev;
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate;
int num, fn; int num, fn;
struct controller *ctrl = p_slot->ctrl; struct controller *ctrl = p_slot->ctrl;
dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); dev = pci_get_slot(parent, PCI_DEVFN(0, 0));
if (dev) { if (dev) {
ctrl_err(ctrl, "Device %s already exists " ctrl_err(ctrl, "Device %s already exists "
"at %04x:%02x:%02x, cannot hot-add\n", pci_name(dev), "at %04x:%02x:00, cannot hot-add\n", pci_name(dev),
pci_domain_nr(parent), p_slot->bus, p_slot->device); pci_domain_nr(parent), parent->number);
pci_dev_put(dev); pci_dev_put(dev);
return -EINVAL; return -EINVAL;
} }
num = pci_scan_slot(parent, PCI_DEVFN(p_slot->device, 0)); num = pci_scan_slot(parent, PCI_DEVFN(0, 0));
if (num == 0) { if (num == 0) {
ctrl_err(ctrl, "No new device found\n"); ctrl_err(ctrl, "No new device found\n");
return -ENODEV; return -ENODEV;
} }
for (fn = 0; fn < 8; fn++) { for (fn = 0; fn < 8; fn++) {
dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, fn)); dev = pci_get_slot(parent, PCI_DEVFN(0, fn));
if (!dev) if (!dev)
continue; continue;
if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) { if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
...@@ -111,19 +111,18 @@ int pciehp_unconfigure_device(struct slot *p_slot) ...@@ -111,19 +111,18 @@ int pciehp_unconfigure_device(struct slot *p_slot)
int j; int j;
u8 bctl = 0; u8 bctl = 0;
u8 presence = 0; u8 presence = 0;
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; struct pci_bus *parent = p_slot->ctrl->pcie->port->subordinate;
u16 command; u16 command;
struct controller *ctrl = p_slot->ctrl; struct controller *ctrl = p_slot->ctrl;
ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:%02x\n", ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:00\n",
__func__, pci_domain_nr(parent), p_slot->bus, p_slot->device); __func__, pci_domain_nr(parent), parent->number);
ret = p_slot->hpc_ops->get_adapter_status(p_slot, &presence); ret = pciehp_get_adapter_status(p_slot, &presence);
if (ret) if (ret)
presence = 0; presence = 0;
for (j = 0; j < 8; j++) { for (j = 0; j < 8; j++) {
struct pci_dev* temp = pci_get_slot(parent, struct pci_dev* temp = pci_get_slot(parent, PCI_DEVFN(0, j));
(p_slot->device << 3) | j);
if (!temp) if (!temp)
continue; continue;
if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
......
...@@ -318,6 +318,8 @@ static int __init aer_service_init(void) ...@@ -318,6 +318,8 @@ static int __init aer_service_init(void)
{ {
if (pcie_aer_disable) if (pcie_aer_disable)
return -ENXIO; return -ENXIO;
if (!pci_msi_enabled())
return -ENXIO;
return pcie_port_service_register(&aerdriver); return pcie_port_service_register(&aerdriver);
} }
......
...@@ -303,9 +303,6 @@ static void pcie_get_aspm_reg(struct pci_dev *pdev, ...@@ -303,9 +303,6 @@ static void pcie_get_aspm_reg(struct pci_dev *pdev,
pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, &reg32); pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, &reg32);
info->support = (reg32 & PCI_EXP_LNKCAP_ASPMS) >> 10; info->support = (reg32 & PCI_EXP_LNKCAP_ASPMS) >> 10;
/* 00b and 10b are defined as "Reserved". */
if (info->support == PCIE_LINK_STATE_L1)
info->support = 0;
info->latency_encoding_l0s = (reg32 & PCI_EXP_LNKCAP_L0SEL) >> 12; info->latency_encoding_l0s = (reg32 & PCI_EXP_LNKCAP_L0SEL) >> 12;
info->latency_encoding_l1 = (reg32 & PCI_EXP_LNKCAP_L1EL) >> 15; info->latency_encoding_l1 = (reg32 & PCI_EXP_LNKCAP_L1EL) >> 15;
pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16); pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
......
/* /*
* vgaarb.c * The VGA aribiter manages VGA space routing and VGA resource decode to
* allow multiple VGA devices to be used in a system in a safe way.
* *
* (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
* (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com>
......
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