Skip to content

Commit

Permalink
Merge branch 'pci/misc' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/helgaas/pci into connectivity-ti-linux-3.12.y_12_nov
  • Loading branch information
kishon committed Nov 12, 2013
2 parents b42c3d4 + 0394cb1 commit 1e62000
Show file tree
Hide file tree
Showing 24 changed files with 124 additions and 180 deletions.
8 changes: 5 additions & 3 deletions Documentation/PCI/pci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ corresponding register block for you.
6. Other interesting functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pci_find_slot() Find pci_dev corresponding to given bus and
slot numbers.
pci_get_domain_bus_and_slot() Find pci_dev corresponding to given domain,
bus and slot and number. If the device is
found, its reference count is increased.
pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3)
pci_find_capability() Find specified capability in device's capability
list.
Expand Down Expand Up @@ -582,7 +583,8 @@ having sane locking.

pci_find_device() Superseded by pci_get_device()
pci_find_subsys() Superseded by pci_get_subsys()
pci_find_slot() Superseded by pci_get_slot()
pci_find_slot() Superseded by pci_get_domain_bus_and_slot()
pci_get_slot() Superseded by pci_get_domain_bus_and_slot()


The alternative is the traditional PCI device driver that walks PCI
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6393,6 +6393,7 @@ S: Supported
F: Documentation/PCI/
F: drivers/pci/
F: include/linux/pci*
F: arch/x86/pci/

PCI DRIVER FOR NVIDIA TEGRA
M: Thierry Reding <[email protected]>
Expand Down
1 change: 0 additions & 1 deletion arch/cris/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#define pcibios_assign_all_busses(void) 1

extern unsigned long pci_mem_start;
#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000

Expand Down
1 change: 0 additions & 1 deletion arch/frv/mb93090-mb00/pci-frv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void pcibios_resource_survey(void);

/* pci-vdk.c */

extern int __nongpreldata pcibios_last_bus;
extern struct pci_ops *__nongpreldata pci_root_ops;

/* pci-irq.c */
Expand Down
36 changes: 0 additions & 36 deletions arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

unsigned int __nongpreldata pci_probe = 1;

int __nongpreldata pcibios_last_bus = -1;
struct pci_ops *__nongpreldata pci_root_ops;

/*
Expand Down Expand Up @@ -219,37 +218,6 @@ static struct pci_ops * __init pci_check_direct(void)
return NULL;
}

/*
* Discover remaining PCI buses in case there are peer host bridges.
* We use the number of last PCI bus provided by the PCI BIOS.
*/
static void __init pcibios_fixup_peer_bridges(void)
{
struct pci_bus bus;
struct pci_dev dev;
int n;
u16 l;

if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff)
return;
printk("PCI: Peer bridge fixup\n");
for (n=0; n <= pcibios_last_bus; n++) {
if (pci_find_bus(0, n))
continue;
bus.number = n;
bus.ops = pci_root_ops;
dev.bus = &bus;
for(dev.devfn=0; dev.devfn<256; dev.devfn += 8)
if (!pci_read_config_word(&dev, PCI_VENDOR_ID, &l) &&
l != 0x0000 && l != 0xffff) {
printk("Found device at %02x:%02x [%04x]\n", n, dev.devfn, l);
printk("PCI: Discovered peer bus %02x\n", n);
pci_scan_bus(n, pci_root_ops, NULL);
break;
}
}
}

/*
* Exceptions for specific devices. Usually work-arounds for fatal design flaws.
*/
Expand Down Expand Up @@ -418,7 +386,6 @@ int __init pcibios_init(void)
pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources);

pcibios_irq_init();
pcibios_fixup_peer_bridges();
pcibios_fixup_irqs();
pcibios_resource_survey();

Expand All @@ -432,9 +399,6 @@ char * __init pcibios_setup(char *str)
if (!strcmp(str, "off")) {
pci_probe = 0;
return NULL;
} else if (!strncmp(str, "lastbus=", 8)) {
pcibios_last_bus = simple_strtol(str+8, NULL, 0);
return NULL;
}
return str;
}
Expand Down
1 change: 0 additions & 1 deletion arch/mn10300/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ extern void unit_pci_init(void);
#define pcibios_assign_all_busses() 0
#endif

extern unsigned long pci_mem_start;
#define PCIBIOS_MIN_IO 0xBE000004
#define PCIBIOS_MIN_MEM 0xB8000000

Expand Down
3 changes: 0 additions & 3 deletions arch/mn10300/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@

struct mn10300_cpuinfo boot_cpu_data;

/* For PCI or other memory-mapped resources */
unsigned long pci_mem_start = 0x18000000;

static char __initdata cmd_line[COMMAND_LINE_SIZE];
char redboot_command_line[COMMAND_LINE_SIZE] =
"console=ttyS0,115200 root=/dev/mtdblock3 rw";
Expand Down
1 change: 0 additions & 1 deletion arch/mn10300/unit-asb2305/pci-asb2305.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ extern void pcibios_resource_survey(void);

/* pci.c */

extern int pcibios_last_bus;
extern struct pci_ops *pci_root_ops;

extern struct irq_routing_table *pcibios_get_irq_routing_table(void);
Expand Down
5 changes: 0 additions & 5 deletions arch/mn10300/unit-asb2305/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

unsigned int pci_probe = 1;

int pcibios_last_bus = -1;
struct pci_ops *pci_root_ops;

/*
Expand Down Expand Up @@ -392,10 +391,6 @@ char *__init pcibios_setup(char *str)
if (!strcmp(str, "off")) {
pci_probe = 0;
return NULL;

} else if (!strncmp(str, "lastbus=", 8)) {
pcibios_last_bus = simple_strtol(str+8, NULL, 0);
return NULL;
}

return str;
Expand Down
8 changes: 4 additions & 4 deletions arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ static void coalesce_windows(struct pci_root_info *info, unsigned long type)
* the kernel resource tree doesn't allow overlaps.
*/
if (resource_overlaps(res1, res2)) {
res1->start = min(res1->start, res2->start);
res1->end = max(res1->end, res2->end);
res2->start = min(res1->start, res2->start);
res2->end = max(res1->end, res2->end);
dev_info(&info->bridge->dev,
"host bridge window expanded to %pR; %pR ignored\n",
res1, res2);
res2->flags = 0;
res2, res1);
res1->flags = 0;
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions drivers/pci/hotplug/acpiphp.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@
#include <linux/mutex.h>
#include <linux/pci_hotplug.h>

#define dbg(format, arg...) \
do { \
if (acpiphp_debug) \
printk(KERN_DEBUG "%s: " format, \
MY_NAME , ## arg); \
} while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
#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 acpiphp_context;
struct acpiphp_bridge;
struct acpiphp_slot;
Expand Down
37 changes: 18 additions & 19 deletions drivers/pci/hotplug/acpiphp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*
*/

#define pr_fmt(fmt) "acpiphp: " fmt

#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
Expand All @@ -43,12 +45,9 @@
#include <linux/smp.h>
#include "acpiphp.h"

#define MY_NAME "acpiphp"

/* name size which is used for entries in pcihpfs */
#define SLOT_NAME_SIZE 21 /* {_SUN} */

bool acpiphp_debug;
bool acpiphp_disabled;

/* local variables */
Expand All @@ -61,9 +60,7 @@ static struct acpiphp_attention_info *attention_info;
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
MODULE_PARM_DESC(disable, "disable acpiphp driver");
module_param_named(debug, acpiphp_debug, bool, 0644);
module_param_named(disable, acpiphp_disabled, bool, 0444);

/* export the attention callback registration methods */
Expand Down Expand Up @@ -139,7 +136,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));

/* enable the specified slot */
return acpiphp_enable_slot(slot->acpi_slot);
Expand All @@ -156,7 +153,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));

/* disable the specified slot */
return acpiphp_disable_and_eject_slot(slot->acpi_slot);
Expand All @@ -176,8 +173,9 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
{
int retval = -ENODEV;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));

pr_debug("%s - physical_slot = %s\n", __func__,
hotplug_slot_name(hotplug_slot));

if (attention_info && try_module_get(attention_info->owner)) {
retval = attention_info->set_attn(hotplug_slot, status);
module_put(attention_info->owner);
Expand All @@ -199,7 +197,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));

*value = acpiphp_get_power_status(slot->acpi_slot);

Expand All @@ -221,7 +219,8 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
int retval = -EINVAL;

dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));
pr_debug("%s - physical_slot = %s\n", __func__,
hotplug_slot_name(hotplug_slot));

if (attention_info && try_module_get(attention_info->owner)) {
retval = attention_info->get_attn(hotplug_slot, value);
Expand All @@ -244,7 +243,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));

*value = acpiphp_get_latch_status(slot->acpi_slot);

Expand All @@ -264,7 +263,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));

*value = acpiphp_get_adapter_status(slot->acpi_slot);

Expand All @@ -279,7 +278,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
{
struct slot *slot = hotplug_slot->private;

dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));

kfree(slot->hotplug_slot);
kfree(slot);
Expand Down Expand Up @@ -322,11 +321,11 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot,
if (retval == -EBUSY)
goto error_hpslot;
if (retval) {
err("pci_hp_register failed with error %d\n", retval);
pr_err("pci_hp_register failed with error %d\n", retval);
goto error_hpslot;
}

info("Slot [%s] registered\n", slot_name(slot));
pr_info("Slot [%s] registered\n", slot_name(slot));

return 0;
error_hpslot:
Expand All @@ -343,17 +342,17 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
struct slot *slot = acpiphp_slot->slot;
int retval = 0;

info("Slot [%s] unregistered\n", slot_name(slot));
pr_info("Slot [%s] unregistered\n", slot_name(slot));

retval = pci_hp_deregister(slot->hotplug_slot);
if (retval)
err("pci_hp_deregister failed with error %d\n", retval);
pr_err("pci_hp_deregister failed with error %d\n", retval);
}


void __init acpiphp_init(void)
{
info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n",
pr_info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n",
acpiphp_disabled ? ", disabled by user; please report a bug"
: "");
}
Loading

0 comments on commit 1e62000

Please sign in to comment.