Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316497
b: refs/heads/master
c: 2a76c45
h: refs/heads/master
i:
  316495: 0aaaa71
v: v3
  • Loading branch information
Jiang Liu authored and Bjorn Helgaas committed Jun 22, 2012
1 parent bb9b9e5 commit 140a7d6
Show file tree
Hide file tree
Showing 30 changed files with 237 additions and 529 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f6662a49bf1b5a163ed4e6321c382d2390c817b
refs/heads/master: 2a76c450bd0377f715caf313ded530290d7dc7d7
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5195,7 +5195,7 @@ PCI SUBSYSTEM
M: Bjorn Helgaas <bhelgaas@google.com>
L: linux-pci@vger.kernel.org
Q: http://patchwork.ozlabs.org/project/linux-pci/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/linux.git
S: Supported
F: Documentation/PCI/
F: drivers/pci/
Expand Down
9 changes: 6 additions & 3 deletions trunk/arch/alpha/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ struct pci_controller *pci_isa_hose;
* Quirks.
*/

static void __devinit quirk_isa_bridge(struct pci_dev *dev)
static void __init
quirk_isa_bridge(struct pci_dev *dev)
{
dev->class = PCI_CLASS_BRIDGE_ISA << 8;
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge);

static void __devinit quirk_cypress(struct pci_dev *dev)
static void __init
quirk_cypress(struct pci_dev *dev)
{
/* The Notorious Cy82C693 chip. */

Expand Down Expand Up @@ -104,7 +106,8 @@ static void __devinit quirk_cypress(struct pci_dev *dev)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress);

/* Called for each device after PCI setup is done. */
static void __devinit pcibios_fixup_final(struct pci_dev *dev)
static void __init
pcibios_fixup_final(struct pci_dev *dev)
{
unsigned int class = dev->class >> 8;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/bios32.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static void __devinit pci_fixup_cy82c693(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, pci_fixup_cy82c693);

static void __devinit pci_fixup_it8152(struct pci_dev *dev)
static void __init pci_fixup_it8152(struct pci_dev *dev)
{
int i;
/* fixup for ITE 8152 devices */
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static void __init pci_fixup_umc_ide(struct pci_dev *d)
d->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
}

static void __devinit pci_fixup_ide_bases(struct pci_dev *d)
static void __init pci_fixup_ide_bases(struct pci_dev *d)
{
int i;

Expand All @@ -287,7 +287,7 @@ static void __devinit pci_fixup_ide_bases(struct pci_dev *d)
}
}

static void __devinit pci_fixup_ide_trash(struct pci_dev *d)
static void __init pci_fixup_ide_trash(struct pci_dev *d)
{
int i;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/85xx/tqm85xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static void tqm85xx_show_cpuinfo(struct seq_file *m)
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
}

static void __devinit tqm85xx_ti1520_fixup(struct pci_dev *pdev)
static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
{
unsigned int val;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/86xx/gef_ppc9a.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");
}

static void __devinit gef_ppc9a_nec_fixup(struct pci_dev *pdev)
static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev)
{
unsigned int val;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/86xx/gef_sbc310.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void gef_sbc310_show_cpuinfo(struct seq_file *m)

}

static void __devinit gef_sbc310_nec_fixup(struct pci_dev *pdev)
static void __init gef_sbc310_nec_fixup(struct pci_dev *pdev)
{
unsigned int val;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/86xx/gef_sbc610.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
}

static void __devinit gef_sbc610_nec_fixup(struct pci_dev *pdev)
static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
{
unsigned int val;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/sysdev/fsl_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

static int fsl_pcie_bus_fixup, is_mpc83xx_pci;

static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev)
static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
{
u8 progif;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/sysdev/mv64x60_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ subsys_initcall(mv64x60_sysfs_init);

#endif /* CONFIG_SYSFS */

static void __devinit mv64x60_pci_fixup_early(struct pci_dev *dev)
static void __init mv64x60_pci_fixup_early(struct pci_dev *dev)
{
/*
* Set the host bridge hdr_type to an invalid value so that
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/drivers/pci/fixups-dreamcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <asm/irq.h>
#include <mach/pci.h>

static void __devinit gapspci_fixup_resources(struct pci_dev *dev)
static void __init gapspci_fixup_resources(struct pci_dev *dev)
{
struct pci_channel *p = dev->sysdata;

Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/sparc/kernel/pcic.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,11 @@ void __init sun4m_pci_init_IRQ(void)
sparc_config.load_profile_irq = pcic_load_profile_irq;
}

int pcibios_assign_resource(struct pci_dev *pdev, int resource)
{
return -ENXIO;
}

/*
* This probably belongs here rather than ioport.c because
* we do not want this crud linked into SBus kernels.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,

#if defined(CONFIG_PCI) && defined(CONFIG_NUMA)
/* Set correct numa_node information for AMD NB functions */
static void __devinit quirk_amd_nb_node(struct pci_dev *dev)
static void __init quirk_amd_nb_node(struct pci_dev *dev)
{
struct pci_dev *nb_ht;
unsigned int devfn;
Expand Down
51 changes: 25 additions & 26 deletions trunk/arch/x86/pci/mmconfig-shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,39 +474,38 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved,
return valid;
}

static int __devinit pci_mmcfg_check_reserved(struct pci_mmcfg_region *cfg,
int early)
{
if (!early && !acpi_disabled) {
if (is_mmconf_reserved(is_acpi_reserved, cfg, 0))
return 1;
else
printk(KERN_ERR FW_BUG PREFIX
"MMCONFIG at %pR not reserved in "
"ACPI motherboard resources\n",
&cfg->res);
}

/* Don't try to do this check unless configuration
type 1 is available. how about type 2 ?*/
if (raw_pci_ops)
return is_mmconf_reserved(e820_all_mapped, cfg, 1);

return 0;
}

static void __init pci_mmcfg_reject_broken(int early)
{
struct pci_mmcfg_region *cfg;

list_for_each_entry(cfg, &pci_mmcfg_list, list) {
int valid = 0;

if (!early && !acpi_disabled) {
valid = is_mmconf_reserved(is_acpi_reserved, cfg, 0);

if (valid)
continue;
else
printk(KERN_ERR FW_BUG PREFIX
"MMCONFIG at %pR not reserved in "
"ACPI motherboard resources\n",
&cfg->res);
if (pci_mmcfg_check_reserved(cfg, early) == 0) {
printk(KERN_INFO PREFIX "not using MMCONFIG\n");
free_all_mmcfg();
return;
}

/* Don't try to do this check unless configuration
type 1 is available. how about type 2 ?*/
if (raw_pci_ops)
valid = is_mmconf_reserved(e820_all_mapped, cfg, 1);

if (!valid)
goto reject;
}

return;

reject:
printk(KERN_INFO PREFIX "not using MMCONFIG\n");
free_all_mmcfg();
}

static int __initdata known_bridge;
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/pci/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ int pci_user_read_config_##size \
if (ret > 0) \
ret = -EINVAL; \
return ret; \
} \
EXPORT_SYMBOL_GPL(pci_user_read_config_##size);
}

/* Returns 0 on success, negative values indicate error. */
#define PCI_USER_WRITE_CONFIG(size,type) \
Expand All @@ -182,8 +181,7 @@ int pci_user_write_config_##size \
if (ret > 0) \
ret = -EINVAL; \
return ret; \
} \
EXPORT_SYMBOL_GPL(pci_user_write_config_##size);
}

PCI_USER_READ_CONFIG(byte, u8)
PCI_USER_READ_CONFIG(word, u16)
Expand Down
56 changes: 14 additions & 42 deletions trunk/drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,6 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle))
return AE_OK;

status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
if (ACPI_FAILURE(status)) {
warn("can't evaluate _ADR (%#x)\n", status);
return AE_OK;
}

device = (adr >> 16) & 0xffff;
function = adr & 0xffff;

pdev = pbus->self;
if (pdev && pci_is_pcie(pdev)) {
tmp = acpi_find_root_bridge_handle(pdev);
Expand All @@ -153,6 +144,10 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
}
}

acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
device = (adr >> 16) & 0xffff;
function = adr & 0xffff;

newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL);
if (!newfunc)
return AE_NO_MEMORY;
Expand Down Expand Up @@ -883,24 +878,6 @@ static void disable_bridges(struct pci_bus *bus)
}
}

/* return first device in slot, acquiring a reference on it */
static struct pci_dev *dev_in_slot(struct acpiphp_slot *slot)
{
struct pci_bus *bus = slot->bridge->pci_bus;
struct pci_dev *dev;
struct pci_dev *ret = NULL;

down_read(&pci_bus_sem);
list_for_each_entry(dev, &bus->devices, bus_list)
if (PCI_SLOT(dev->devfn) == slot->device) {
ret = pci_dev_get(dev);
break;
}
up_read(&pci_bus_sem);

return ret;
}

/**
* disable_device - disable a slot
* @slot: ACPI PHP slot
Expand All @@ -916,7 +893,6 @@ static int disable_device(struct acpiphp_slot *slot)
pdev = pci_get_slot(bus, PCI_DEVFN(slot->device, 0));
if (!pdev)
goto err_exit;
pci_dev_put(pdev);

list_for_each_entry(func, &slot->funcs, sibling) {
if (func->bridge) {
Expand All @@ -925,22 +901,18 @@ static int disable_device(struct acpiphp_slot *slot)
(u32)1, NULL, NULL);
func->bridge = NULL;
}
}

/*
* enable_device() enumerates all functions in this device via
* pci_scan_slot(), whether they have associated ACPI hotplug
* methods (_EJ0, etc.) or not. Therefore, we remove all functions
* here.
*/
while ((pdev = dev_in_slot(slot))) {
pci_stop_bus_device(pdev);
if (pdev->subordinate) {
disable_bridges(pdev->subordinate);
pci_disable_device(pdev);
pdev = pci_get_slot(slot->bridge->pci_bus,
PCI_DEVFN(slot->device, func->function));
if (pdev) {
pci_stop_bus_device(pdev);
if (pdev->subordinate) {
disable_bridges(pdev->subordinate);
pci_disable_device(pdev);
}
__pci_remove_bus_device(pdev);
pci_dev_put(pdev);
}
__pci_remove_bus_device(pdev);
pci_dev_put(pdev);
}

list_for_each_entry(func, &slot->funcs, sibling) {
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/pci/hotplug/shpchp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ static int board_added(struct slot *p_slot)
}

if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) {
if (slots_not_empty)
return WRONG_BUS_FREQUENCY;

if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) {
ctrl_err(ctrl, "%s: Issue of set bus speed mode command"
" failed\n", __func__);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/pci-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ static struct bin_attribute pcie_config_attr = {
.write = pci_write_config,
};

int __weak pcibios_add_platform_entries(struct pci_dev *dev)
int __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev)
{
return 0;
}
Expand Down
Loading

0 comments on commit 140a7d6

Please sign in to comment.