Skip to content

Commit 1e62000

Browse files
committed
Merge branch 'pci/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into connectivity-ti-linux-3.12.y_12_nov
2 parents b42c3d4 + 0394cb1 commit 1e62000

File tree

24 files changed

+124
-180
lines changed

24 files changed

+124
-180
lines changed

Documentation/PCI/pci.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,9 @@ corresponding register block for you.
525525
6. Other interesting functions
526526
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
527527

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

583584
pci_find_device() Superseded by pci_get_device()
584585
pci_find_subsys() Superseded by pci_get_subsys()
585-
pci_find_slot() Superseded by pci_get_slot()
586+
pci_find_slot() Superseded by pci_get_domain_bus_and_slot()
587+
pci_get_slot() Superseded by pci_get_domain_bus_and_slot()
586588

587589

588590
The alternative is the traditional PCI device driver that walks PCI

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6393,6 +6393,7 @@ S: Supported
63936393
F: Documentation/PCI/
63946394
F: drivers/pci/
63956395
F: include/linux/pci*
6396+
F: arch/x86/pci/
63966397

63976398
PCI DRIVER FOR NVIDIA TEGRA
63986399
M: Thierry Reding <[email protected]>

arch/cris/include/asm/pci.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#define pcibios_assign_all_busses(void) 1
1313

14-
extern unsigned long pci_mem_start;
1514
#define PCIBIOS_MIN_IO 0x1000
1615
#define PCIBIOS_MIN_MEM 0x10000000
1716

arch/frv/mb93090-mb00/pci-frv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ void pcibios_resource_survey(void);
3030

3131
/* pci-vdk.c */
3232

33-
extern int __nongpreldata pcibios_last_bus;
3433
extern struct pci_ops *__nongpreldata pci_root_ops;
3534

3635
/* pci-irq.c */

arch/frv/mb93090-mb00/pci-vdk.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
unsigned int __nongpreldata pci_probe = 1;
2727

28-
int __nongpreldata pcibios_last_bus = -1;
2928
struct pci_ops *__nongpreldata pci_root_ops;
3029

3130
/*
@@ -219,37 +218,6 @@ static struct pci_ops * __init pci_check_direct(void)
219218
return NULL;
220219
}
221220

222-
/*
223-
* Discover remaining PCI buses in case there are peer host bridges.
224-
* We use the number of last PCI bus provided by the PCI BIOS.
225-
*/
226-
static void __init pcibios_fixup_peer_bridges(void)
227-
{
228-
struct pci_bus bus;
229-
struct pci_dev dev;
230-
int n;
231-
u16 l;
232-
233-
if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff)
234-
return;
235-
printk("PCI: Peer bridge fixup\n");
236-
for (n=0; n <= pcibios_last_bus; n++) {
237-
if (pci_find_bus(0, n))
238-
continue;
239-
bus.number = n;
240-
bus.ops = pci_root_ops;
241-
dev.bus = &bus;
242-
for(dev.devfn=0; dev.devfn<256; dev.devfn += 8)
243-
if (!pci_read_config_word(&dev, PCI_VENDOR_ID, &l) &&
244-
l != 0x0000 && l != 0xffff) {
245-
printk("Found device at %02x:%02x [%04x]\n", n, dev.devfn, l);
246-
printk("PCI: Discovered peer bus %02x\n", n);
247-
pci_scan_bus(n, pci_root_ops, NULL);
248-
break;
249-
}
250-
}
251-
}
252-
253221
/*
254222
* Exceptions for specific devices. Usually work-arounds for fatal design flaws.
255223
*/
@@ -418,7 +386,6 @@ int __init pcibios_init(void)
418386
pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources);
419387

420388
pcibios_irq_init();
421-
pcibios_fixup_peer_bridges();
422389
pcibios_fixup_irqs();
423390
pcibios_resource_survey();
424391

@@ -432,9 +399,6 @@ char * __init pcibios_setup(char *str)
432399
if (!strcmp(str, "off")) {
433400
pci_probe = 0;
434401
return NULL;
435-
} else if (!strncmp(str, "lastbus=", 8)) {
436-
pcibios_last_bus = simple_strtol(str+8, NULL, 0);
437-
return NULL;
438402
}
439403
return str;
440404
}

arch/mn10300/include/asm/pci.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ extern void unit_pci_init(void);
4444
#define pcibios_assign_all_busses() 0
4545
#endif
4646

47-
extern unsigned long pci_mem_start;
4847
#define PCIBIOS_MIN_IO 0xBE000004
4948
#define PCIBIOS_MIN_MEM 0xB8000000
5049

arch/mn10300/kernel/setup.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535

3636
struct mn10300_cpuinfo boot_cpu_data;
3737

38-
/* For PCI or other memory-mapped resources */
39-
unsigned long pci_mem_start = 0x18000000;
40-
4138
static char __initdata cmd_line[COMMAND_LINE_SIZE];
4239
char redboot_command_line[COMMAND_LINE_SIZE] =
4340
"console=ttyS0,115200 root=/dev/mtdblock3 rw";

arch/mn10300/unit-asb2305/pci-asb2305.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ extern void pcibios_resource_survey(void);
3535

3636
/* pci.c */
3737

38-
extern int pcibios_last_bus;
3938
extern struct pci_ops *pci_root_ops;
4039

4140
extern struct irq_routing_table *pcibios_get_irq_routing_table(void);

arch/mn10300/unit-asb2305/pci.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
unsigned int pci_probe = 1;
2626

27-
int pcibios_last_bus = -1;
2827
struct pci_ops *pci_root_ops;
2928

3029
/*
@@ -392,10 +391,6 @@ char *__init pcibios_setup(char *str)
392391
if (!strcmp(str, "off")) {
393392
pci_probe = 0;
394393
return NULL;
395-
396-
} else if (!strncmp(str, "lastbus=", 8)) {
397-
pcibios_last_bus = simple_strtol(str+8, NULL, 0);
398-
return NULL;
399394
}
400395

401396
return str;

arch/x86/pci/acpi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ static void coalesce_windows(struct pci_root_info *info, unsigned long type)
354354
* the kernel resource tree doesn't allow overlaps.
355355
*/
356356
if (resource_overlaps(res1, res2)) {
357-
res1->start = min(res1->start, res2->start);
358-
res1->end = max(res1->end, res2->end);
357+
res2->start = min(res1->start, res2->start);
358+
res2->end = max(res1->end, res2->end);
359359
dev_info(&info->bridge->dev,
360360
"host bridge window expanded to %pR; %pR ignored\n",
361-
res1, res2);
362-
res2->flags = 0;
361+
res2, res1);
362+
res1->flags = 0;
363363
}
364364
}
365365
}

drivers/pci/hotplug/acpiphp.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@
3939
#include <linux/mutex.h>
4040
#include <linux/pci_hotplug.h>
4141

42-
#define dbg(format, arg...) \
43-
do { \
44-
if (acpiphp_debug) \
45-
printk(KERN_DEBUG "%s: " format, \
46-
MY_NAME , ## arg); \
47-
} while (0)
48-
#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
49-
#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
50-
#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
51-
5242
struct acpiphp_context;
5343
struct acpiphp_bridge;
5444
struct acpiphp_slot;

drivers/pci/hotplug/acpiphp_core.c

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*
3232
*/
3333

34+
#define pr_fmt(fmt) "acpiphp: " fmt
35+
3436
#include <linux/init.h>
3537
#include <linux/module.h>
3638
#include <linux/moduleparam.h>
@@ -43,12 +45,9 @@
4345
#include <linux/smp.h>
4446
#include "acpiphp.h"
4547

46-
#define MY_NAME "acpiphp"
47-
4848
/* name size which is used for entries in pcihpfs */
4949
#define SLOT_NAME_SIZE 21 /* {_SUN} */
5050

51-
bool acpiphp_debug;
5251
bool acpiphp_disabled;
5352

5453
/* local variables */
@@ -61,9 +60,7 @@ static struct acpiphp_attention_info *attention_info;
6160
MODULE_AUTHOR(DRIVER_AUTHOR);
6261
MODULE_DESCRIPTION(DRIVER_DESC);
6362
MODULE_LICENSE("GPL");
64-
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
6563
MODULE_PARM_DESC(disable, "disable acpiphp driver");
66-
module_param_named(debug, acpiphp_debug, bool, 0644);
6764
module_param_named(disable, acpiphp_disabled, bool, 0444);
6865

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

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

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

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

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

179-
dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));
180-
176+
pr_debug("%s - physical_slot = %s\n", __func__,
177+
hotplug_slot_name(hotplug_slot));
178+
181179
if (attention_info && try_module_get(attention_info->owner)) {
182180
retval = attention_info->set_attn(hotplug_slot, status);
183181
module_put(attention_info->owner);
@@ -199,7 +197,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
199197
{
200198
struct slot *slot = hotplug_slot->private;
201199

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

204202
*value = acpiphp_get_power_status(slot->acpi_slot);
205203

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

224-
dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));
222+
pr_debug("%s - physical_slot = %s\n", __func__,
223+
hotplug_slot_name(hotplug_slot));
225224

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

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

249248
*value = acpiphp_get_latch_status(slot->acpi_slot);
250249

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

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

269268
*value = acpiphp_get_adapter_status(slot->acpi_slot);
270269

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

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

284283
kfree(slot->hotplug_slot);
285284
kfree(slot);
@@ -322,11 +321,11 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot,
322321
if (retval == -EBUSY)
323322
goto error_hpslot;
324323
if (retval) {
325-
err("pci_hp_register failed with error %d\n", retval);
324+
pr_err("pci_hp_register failed with error %d\n", retval);
326325
goto error_hpslot;
327326
}
328327

329-
info("Slot [%s] registered\n", slot_name(slot));
328+
pr_info("Slot [%s] registered\n", slot_name(slot));
330329

331330
return 0;
332331
error_hpslot:
@@ -343,17 +342,17 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
343342
struct slot *slot = acpiphp_slot->slot;
344343
int retval = 0;
345344

346-
info("Slot [%s] unregistered\n", slot_name(slot));
345+
pr_info("Slot [%s] unregistered\n", slot_name(slot));
347346

348347
retval = pci_hp_deregister(slot->hotplug_slot);
349348
if (retval)
350-
err("pci_hp_deregister failed with error %d\n", retval);
349+
pr_err("pci_hp_deregister failed with error %d\n", retval);
351350
}
352351

353352

354353
void __init acpiphp_init(void)
355354
{
356-
info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n",
355+
pr_info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n",
357356
acpiphp_disabled ? ", disabled by user; please report a bug"
358357
: "");
359358
}

0 commit comments

Comments
 (0)