提交 783a28ec 编写于 作者: B Bjorn Helgaas

Merge branches 'pci/hotplug', 'pci/initdata' and 'pci/misc' into next

* pci/hotplug:
  PCI: pciehp: Stop disabling notifications during init
  PCI: pciehp: Add more Slot Control debug output
  PCI: pciehp: Fix wait time in timeout message

* pci/initdata:
  x86/PCI: Mark PCI BIOS initialization code as such
  x86/PCI: Constify pci_mmcfg_probes[] array
  x86/PCI: Mark constants of pci_mmcfg_nvidia_mcp55() as __initconst
  x86/PCI: Move __init annotation to the correct place
  x86/PCI: Mark DMI tables as initialization data

* pci/misc:
  PCI: Move PCI_VENDOR_ID_VMWARE to pci_ids.h
...@@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = { ...@@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = {
*/ */
DEFINE_RAW_SPINLOCK(pci_config_lock); DEFINE_RAW_SPINLOCK(pci_config_lock);
static int can_skip_ioresource_align(const struct dmi_system_id *d) static int __init can_skip_ioresource_align(const struct dmi_system_id *d)
{ {
pci_probe |= PCI_CAN_SKIP_ISA_ALIGN; pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident); printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
return 0; return 0;
} }
static const struct dmi_system_id can_skip_pciprobe_dmi_table[] = { static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __initconst = {
/* /*
* Systems where PCI IO resource ISA alignment can be skipped * Systems where PCI IO resource ISA alignment can be skipped
* when the ISA enable bit in the bridge control is not set * when the ISA enable bit in the bridge control is not set
...@@ -186,7 +186,7 @@ void pcibios_remove_bus(struct pci_bus *bus) ...@@ -186,7 +186,7 @@ void pcibios_remove_bus(struct pci_bus *bus)
* on the kernel command line (which was parsed earlier). * on the kernel command line (which was parsed earlier).
*/ */
static int set_bf_sort(const struct dmi_system_id *d) static int __init set_bf_sort(const struct dmi_system_id *d)
{ {
if (pci_bf_sort == pci_bf_sort_default) { if (pci_bf_sort == pci_bf_sort_default) {
pci_bf_sort = pci_dmi_bf; pci_bf_sort = pci_dmi_bf;
...@@ -195,8 +195,8 @@ static int set_bf_sort(const struct dmi_system_id *d) ...@@ -195,8 +195,8 @@ static int set_bf_sort(const struct dmi_system_id *d)
return 0; return 0;
} }
static void read_dmi_type_b1(const struct dmi_header *dm, static void __init read_dmi_type_b1(const struct dmi_header *dm,
void *private_data) void *private_data)
{ {
u8 *d = (u8 *)dm + 4; u8 *d = (u8 *)dm + 4;
...@@ -217,7 +217,7 @@ static void read_dmi_type_b1(const struct dmi_header *dm, ...@@ -217,7 +217,7 @@ static void read_dmi_type_b1(const struct dmi_header *dm,
} }
} }
static int find_sort_method(const struct dmi_system_id *d) static int __init find_sort_method(const struct dmi_system_id *d)
{ {
dmi_walk(read_dmi_type_b1, NULL); dmi_walk(read_dmi_type_b1, NULL);
...@@ -232,7 +232,7 @@ static int find_sort_method(const struct dmi_system_id *d) ...@@ -232,7 +232,7 @@ static int find_sort_method(const struct dmi_system_id *d)
* Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
*/ */
#ifdef __i386__ #ifdef __i386__
static int assign_all_busses(const struct dmi_system_id *d) static int __init assign_all_busses(const struct dmi_system_id *d)
{ {
pci_probe |= PCI_ASSIGN_ALL_BUSSES; pci_probe |= PCI_ASSIGN_ALL_BUSSES;
printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
...@@ -241,7 +241,7 @@ static int assign_all_busses(const struct dmi_system_id *d) ...@@ -241,7 +241,7 @@ static int assign_all_busses(const struct dmi_system_id *d)
} }
#endif #endif
static int set_scan_all(const struct dmi_system_id *d) static int __init set_scan_all(const struct dmi_system_id *d)
{ {
printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n", printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n",
d->ident); d->ident);
...@@ -249,7 +249,7 @@ static int set_scan_all(const struct dmi_system_id *d) ...@@ -249,7 +249,7 @@ static int set_scan_all(const struct dmi_system_id *d)
return 0; return 0;
} }
static const struct dmi_system_id pciprobe_dmi_table[] = { static const struct dmi_system_id pciprobe_dmi_table[] __initconst = {
#ifdef __i386__ #ifdef __i386__
/* /*
* Laptops which need pci=assign-busses to see Cardbus cards * Laptops which need pci=assign-busses to see Cardbus cards
...@@ -512,7 +512,7 @@ int __init pcibios_init(void) ...@@ -512,7 +512,7 @@ int __init pcibios_init(void)
return 0; return 0;
} }
char * __init pcibios_setup(char *str) char *__init pcibios_setup(char *str)
{ {
if (!strcmp(str, "off")) { if (!strcmp(str, "off")) {
pci_probe = 0; pci_probe = 0;
......
...@@ -31,7 +31,7 @@ static DEFINE_MUTEX(pci_mmcfg_lock); ...@@ -31,7 +31,7 @@ static DEFINE_MUTEX(pci_mmcfg_lock);
LIST_HEAD(pci_mmcfg_list); LIST_HEAD(pci_mmcfg_list);
static __init void pci_mmconfig_remove(struct pci_mmcfg_region *cfg) static void __init pci_mmconfig_remove(struct pci_mmcfg_region *cfg)
{ {
if (cfg->res.parent) if (cfg->res.parent)
release_resource(&cfg->res); release_resource(&cfg->res);
...@@ -39,7 +39,7 @@ static __init void pci_mmconfig_remove(struct pci_mmcfg_region *cfg) ...@@ -39,7 +39,7 @@ static __init void pci_mmconfig_remove(struct pci_mmcfg_region *cfg)
kfree(cfg); kfree(cfg);
} }
static __init void free_all_mmcfg(void) static void __init free_all_mmcfg(void)
{ {
struct pci_mmcfg_region *cfg, *tmp; struct pci_mmcfg_region *cfg, *tmp;
...@@ -93,7 +93,7 @@ static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start, ...@@ -93,7 +93,7 @@ static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start,
return new; return new;
} }
static __init struct pci_mmcfg_region *pci_mmconfig_add(int segment, int start, static struct pci_mmcfg_region *__init pci_mmconfig_add(int segment, int start,
int end, u64 addr) int end, u64 addr)
{ {
struct pci_mmcfg_region *new; struct pci_mmcfg_region *new;
...@@ -125,7 +125,7 @@ struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus) ...@@ -125,7 +125,7 @@ struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus)
return NULL; return NULL;
} }
static const char __init *pci_mmcfg_e7520(void) static const char *__init pci_mmcfg_e7520(void)
{ {
u32 win; u32 win;
raw_pci_ops->read(0, 0, PCI_DEVFN(0, 0), 0xce, 2, &win); raw_pci_ops->read(0, 0, PCI_DEVFN(0, 0), 0xce, 2, &win);
...@@ -140,7 +140,7 @@ static const char __init *pci_mmcfg_e7520(void) ...@@ -140,7 +140,7 @@ static const char __init *pci_mmcfg_e7520(void)
return "Intel Corporation E7520 Memory Controller Hub"; return "Intel Corporation E7520 Memory Controller Hub";
} }
static const char __init *pci_mmcfg_intel_945(void) static const char *__init pci_mmcfg_intel_945(void)
{ {
u32 pciexbar, mask = 0, len = 0; u32 pciexbar, mask = 0, len = 0;
...@@ -184,7 +184,7 @@ static const char __init *pci_mmcfg_intel_945(void) ...@@ -184,7 +184,7 @@ static const char __init *pci_mmcfg_intel_945(void)
return "Intel Corporation 945G/GZ/P/PL Express Memory Controller Hub"; return "Intel Corporation 945G/GZ/P/PL Express Memory Controller Hub";
} }
static const char __init *pci_mmcfg_amd_fam10h(void) static const char *__init pci_mmcfg_amd_fam10h(void)
{ {
u32 low, high, address; u32 low, high, address;
u64 base, msr; u64 base, msr;
...@@ -235,21 +235,25 @@ static const char __init *pci_mmcfg_amd_fam10h(void) ...@@ -235,21 +235,25 @@ static const char __init *pci_mmcfg_amd_fam10h(void)
} }
static bool __initdata mcp55_checked; static bool __initdata mcp55_checked;
static const char __init *pci_mmcfg_nvidia_mcp55(void) static const char *__init pci_mmcfg_nvidia_mcp55(void)
{ {
int bus; int bus;
int mcp55_mmconf_found = 0; int mcp55_mmconf_found = 0;
static const u32 extcfg_regnum = 0x90; static const u32 extcfg_regnum __initconst = 0x90;
static const u32 extcfg_regsize = 4; static const u32 extcfg_regsize __initconst = 4;
static const u32 extcfg_enable_mask = 1<<31; static const u32 extcfg_enable_mask __initconst = 1 << 31;
static const u32 extcfg_start_mask = 0xff<<16; static const u32 extcfg_start_mask __initconst = 0xff << 16;
static const int extcfg_start_shift = 16; static const int extcfg_start_shift __initconst = 16;
static const u32 extcfg_size_mask = 0x3<<28; static const u32 extcfg_size_mask __initconst = 0x3 << 28;
static const int extcfg_size_shift = 28; static const int extcfg_size_shift __initconst = 28;
static const int extcfg_sizebus[] = {0x100, 0x80, 0x40, 0x20}; static const int extcfg_sizebus[] __initconst = {
static const u32 extcfg_base_mask[] = {0x7ff8, 0x7ffc, 0x7ffe, 0x7fff}; 0x100, 0x80, 0x40, 0x20
static const int extcfg_base_lshift = 25; };
static const u32 extcfg_base_mask[] __initconst = {
0x7ff8, 0x7ffc, 0x7ffe, 0x7fff
};
static const int extcfg_base_lshift __initconst = 25;
/* /*
* do check if amd fam10h already took over * do check if amd fam10h already took over
...@@ -302,7 +306,7 @@ struct pci_mmcfg_hostbridge_probe { ...@@ -302,7 +306,7 @@ struct pci_mmcfg_hostbridge_probe {
const char *(*probe)(void); const char *(*probe)(void);
}; };
static struct pci_mmcfg_hostbridge_probe pci_mmcfg_probes[] __initdata = { static const struct pci_mmcfg_hostbridge_probe pci_mmcfg_probes[] __initconst = {
{ 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID_INTEL, { 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_E7520_MCH, pci_mmcfg_e7520 }, PCI_DEVICE_ID_INTEL_E7520_MCH, pci_mmcfg_e7520 },
{ 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID_INTEL, { 0, PCI_DEVFN(0, 0), PCI_VENDOR_ID_INTEL,
......
...@@ -79,13 +79,13 @@ union bios32 { ...@@ -79,13 +79,13 @@ union bios32 {
static struct { static struct {
unsigned long address; unsigned long address;
unsigned short segment; unsigned short segment;
} bios32_indirect = { 0, __KERNEL_CS }; } bios32_indirect __initdata = { 0, __KERNEL_CS };
/* /*
* Returns the entry point for the given service, NULL on error * Returns the entry point for the given service, NULL on error
*/ */
static unsigned long bios32_service(unsigned long service) static unsigned long __init bios32_service(unsigned long service)
{ {
unsigned char return_code; /* %al */ unsigned char return_code; /* %al */
unsigned long address; /* %ebx */ unsigned long address; /* %ebx */
...@@ -124,7 +124,7 @@ static struct { ...@@ -124,7 +124,7 @@ static struct {
static int pci_bios_present; static int pci_bios_present;
static int check_pcibios(void) static int __init check_pcibios(void)
{ {
u32 signature, eax, ebx, ecx; u32 signature, eax, ebx, ecx;
u8 status, major_ver, minor_ver, hw_mech; u8 status, major_ver, minor_ver, hw_mech;
...@@ -312,7 +312,7 @@ static const struct pci_raw_ops pci_bios_access = { ...@@ -312,7 +312,7 @@ static const struct pci_raw_ops pci_bios_access = {
* Try to find PCI BIOS. * Try to find PCI BIOS.
*/ */
static const struct pci_raw_ops *pci_find_bios(void) static const struct pci_raw_ops *__init pci_find_bios(void)
{ {
union bios32 *check; union bios32 *check;
unsigned char sum; unsigned char sum;
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
/* /*
* PCI device IDs. * PCI device IDs.
*/ */
#define PCI_VENDOR_ID_VMWARE 0x15AD
#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 #define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
/* /*
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "vmci_driver.h" #include "vmci_driver.h"
#include "vmci_event.h" #include "vmci_event.h"
#define PCI_VENDOR_ID_VMWARE 0x15AD
#define PCI_DEVICE_ID_VMWARE_VMCI 0x0740 #define PCI_DEVICE_ID_VMWARE_VMCI 0x0740
#define VMCI_UTIL_NUM_RESOURCES 1 #define VMCI_UTIL_NUM_RESOURCES 1
......
...@@ -117,7 +117,6 @@ enum { ...@@ -117,7 +117,6 @@ enum {
/* /*
* PCI vendor and device IDs. * PCI vendor and device IDs.
*/ */
#define PCI_VENDOR_ID_VMWARE 0x15AD
#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 #define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0
#define MAX_ETHERNET_CARDS 10 #define MAX_ETHERNET_CARDS 10
#define MAX_PCI_PASSTHRU_DEVICE 6 #define MAX_PCI_PASSTHRU_DEVICE 6
......
...@@ -173,7 +173,7 @@ static void pcie_wait_cmd(struct controller *ctrl) ...@@ -173,7 +173,7 @@ static void pcie_wait_cmd(struct controller *ctrl)
if (!rc) if (!rc)
ctrl_info(ctrl, "Timeout on hotplug command %#06x (issued %u msec ago)\n", ctrl_info(ctrl, "Timeout on hotplug command %#06x (issued %u msec ago)\n",
ctrl->slot_ctrl, ctrl->slot_ctrl,
jiffies_to_msecs(now - ctrl->cmd_started)); jiffies_to_msecs(jiffies - ctrl->cmd_started));
} }
/** /**
...@@ -422,9 +422,9 @@ void pciehp_set_attention_status(struct slot *slot, u8 value) ...@@ -422,9 +422,9 @@ void pciehp_set_attention_status(struct slot *slot, u8 value)
default: default:
return; return;
} }
pcie_write_cmd(ctrl, slot_cmd, PCI_EXP_SLTCTL_AIC);
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd); pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd);
pcie_write_cmd(ctrl, slot_cmd, PCI_EXP_SLTCTL_AIC);
} }
void pciehp_green_led_on(struct slot *slot) void pciehp_green_led_on(struct slot *slot)
...@@ -602,6 +602,8 @@ void pcie_enable_notification(struct controller *ctrl) ...@@ -602,6 +602,8 @@ void pcie_enable_notification(struct controller *ctrl)
PCI_EXP_SLTCTL_DLLSCE); PCI_EXP_SLTCTL_DLLSCE);
pcie_write_cmd(ctrl, cmd, mask); pcie_write_cmd(ctrl, cmd, mask);
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, cmd);
} }
static void pcie_disable_notification(struct controller *ctrl) static void pcie_disable_notification(struct controller *ctrl)
...@@ -613,6 +615,8 @@ static void pcie_disable_notification(struct controller *ctrl) ...@@ -613,6 +615,8 @@ static void pcie_disable_notification(struct controller *ctrl)
PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE |
PCI_EXP_SLTCTL_DLLSCE); PCI_EXP_SLTCTL_DLLSCE);
pcie_write_cmd(ctrl, 0, mask); pcie_write_cmd(ctrl, 0, mask);
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, 0);
} }
/* /*
...@@ -640,6 +644,8 @@ int pciehp_reset_slot(struct slot *slot, int probe) ...@@ -640,6 +644,8 @@ int pciehp_reset_slot(struct slot *slot, int probe)
stat_mask |= PCI_EXP_SLTSTA_DLLSC; stat_mask |= PCI_EXP_SLTSTA_DLLSC;
pcie_write_cmd(ctrl, 0, ctrl_mask); pcie_write_cmd(ctrl, 0, ctrl_mask);
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, 0);
if (pciehp_poll_mode) if (pciehp_poll_mode)
del_timer_sync(&ctrl->poll_timer); del_timer_sync(&ctrl->poll_timer);
...@@ -647,6 +653,8 @@ int pciehp_reset_slot(struct slot *slot, int probe) ...@@ -647,6 +653,8 @@ int pciehp_reset_slot(struct slot *slot, int probe)
pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, stat_mask); pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, stat_mask);
pcie_write_cmd(ctrl, ctrl_mask, ctrl_mask); pcie_write_cmd(ctrl, ctrl_mask, ctrl_mask);
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, ctrl_mask);
if (pciehp_poll_mode) if (pciehp_poll_mode)
int_poll_timeout(ctrl->poll_timer.data); int_poll_timeout(ctrl->poll_timer.data);
...@@ -785,9 +793,6 @@ struct controller *pcie_init(struct pcie_device *dev) ...@@ -785,9 +793,6 @@ struct controller *pcie_init(struct pcie_device *dev)
PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_PDC |
PCI_EXP_SLTSTA_CC | PCI_EXP_SLTSTA_DLLSC); PCI_EXP_SLTSTA_CC | PCI_EXP_SLTSTA_DLLSC);
/* Disable software notification */
pcie_disable_notification(ctrl);
ctrl_info(ctrl, "Slot #%d AttnBtn%c AttnInd%c PwrInd%c PwrCtrl%c MRL%c Interlock%c NoCompl%c LLActRep%c\n", ctrl_info(ctrl, "Slot #%d AttnBtn%c AttnInd%c PwrInd%c PwrCtrl%c MRL%c Interlock%c NoCompl%c LLActRep%c\n",
(slot_cap & PCI_EXP_SLTCAP_PSN) >> 19, (slot_cap & PCI_EXP_SLTCAP_PSN) >> 19,
FLAG(slot_cap, PCI_EXP_SLTCAP_ABP), FLAG(slot_cap, PCI_EXP_SLTCAP_ABP),
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define MASK(n) ((1 << (n)) - 1) /* make an n-bit mask */ #define MASK(n) ((1 << (n)) - 1) /* make an n-bit mask */
#define PCI_VENDOR_ID_VMWARE 0x15AD
#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 #define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0
/* /*
......
...@@ -2245,6 +2245,8 @@ ...@@ -2245,6 +2245,8 @@
#define PCI_VENDOR_ID_MORETON 0x15aa #define PCI_VENDOR_ID_MORETON 0x15aa
#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000 #define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
#define PCI_VENDOR_ID_VMWARE 0x15ad
#define PCI_VENDOR_ID_ZOLTRIX 0x15b0 #define PCI_VENDOR_ID_ZOLTRIX 0x15b0
#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0 #define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册