mirror of
https://github.com/t2linux/kernel.git
synced 2026-04-30 13:48:59 -07:00
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Accessing PCI device resources through sysfs
|
||||
--------------------------------------------
|
||||
|
||||
sysfs, usually mounted at /sys, provides access to PCI resources on platforms
|
||||
that support it. For example, a given bus might look like this:
|
||||
@@ -47,14 +48,21 @@ files, each with their own function.
|
||||
binary - file contains binary data
|
||||
cpumask - file contains a cpumask type
|
||||
|
||||
The read only files are informational, writes to them will be ignored.
|
||||
Writable files can be used to perform actions on the device (e.g. changing
|
||||
config space, detaching a device). mmapable files are available via an
|
||||
mmap of the file at offset 0 and can be used to do actual device programming
|
||||
from userspace. Note that some platforms don't support mmapping of certain
|
||||
resources, so be sure to check the return value from any attempted mmap.
|
||||
The read only files are informational, writes to them will be ignored, with
|
||||
the exception of the 'rom' file. Writable files can be used to perform
|
||||
actions on the device (e.g. changing config space, detaching a device).
|
||||
mmapable files are available via an mmap of the file at offset 0 and can be
|
||||
used to do actual device programming from userspace. Note that some platforms
|
||||
don't support mmapping of certain resources, so be sure to check the return
|
||||
value from any attempted mmap.
|
||||
|
||||
The 'rom' file is special in that it provides read-only access to the device's
|
||||
ROM file, if available. It's disabled by default, however, so applications
|
||||
should write the string "1" to the file to enable it before attempting a read
|
||||
call, and disable it following the access by writing "0" to the file.
|
||||
|
||||
Accessing legacy resources through sysfs
|
||||
----------------------------------------
|
||||
|
||||
Legacy I/O port and ISA memory resources are also provided in sysfs if the
|
||||
underlying platform supports them. They're located in the PCI class heirarchy,
|
||||
@@ -75,6 +83,7 @@ simply dereference the returned pointer (after checking for errors of course)
|
||||
to access legacy memory space.
|
||||
|
||||
Supporting PCI access on new platforms
|
||||
--------------------------------------
|
||||
|
||||
In order to support PCI resource mapping as described above, Linux platform
|
||||
code must define HAVE_PCI_MMAP and provide a pci_mmap_page_range function.
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
|
||||
PCI Error Recovery
|
||||
------------------
|
||||
May 31, 2005
|
||||
|
||||
Current document maintainer:
|
||||
Linas Vepstas <linas@austin.ibm.com>
|
||||
|
||||
|
||||
Some PCI bus controllers are able to detect certain "hard" PCI errors
|
||||
on the bus, such as parity errors on the data and address busses, as
|
||||
well as SERR and PERR errors. These chipsets are then able to disable
|
||||
I/O to/from the affected device, so that, for example, a bad DMA
|
||||
address doesn't end up corrupting system memory. These same chipsets
|
||||
are also able to reset the affected PCI device, and return it to
|
||||
working condition. This document describes a generic API form
|
||||
performing error recovery.
|
||||
|
||||
The core idea is that after a PCI error has been detected, there must
|
||||
be a way for the kernel to coordinate with all affected device drivers
|
||||
so that the pci card can be made operational again, possibly after
|
||||
performing a full electrical #RST of the PCI card. The API below
|
||||
provides a generic API for device drivers to be notified of PCI
|
||||
errors, and to be notified of, and respond to, a reset sequence.
|
||||
|
||||
Preliminary sketch of API, cut-n-pasted-n-modified email from
|
||||
Ben Herrenschmidt, circa 5 april 2005
|
||||
|
||||
The error recovery API support is exposed to the driver in the form of
|
||||
a structure of function pointers pointed to by a new field in struct
|
||||
pci_driver. The absence of this pointer in pci_driver denotes an
|
||||
"non-aware" driver, behaviour on these is platform dependant.
|
||||
Platforms like ppc64 can try to simulate pci hotplug remove/add.
|
||||
|
||||
The definition of "pci_error_token" is not covered here. It is based on
|
||||
Seto's work on the synchronous error detection. We still need to define
|
||||
functions for extracting infos out of an opaque error token. This is
|
||||
separate from this API.
|
||||
|
||||
This structure has the form:
|
||||
|
||||
struct pci_error_handlers
|
||||
{
|
||||
int (*error_detected)(struct pci_dev *dev, pci_error_token error);
|
||||
int (*mmio_enabled)(struct pci_dev *dev);
|
||||
int (*resume)(struct pci_dev *dev);
|
||||
int (*link_reset)(struct pci_dev *dev);
|
||||
int (*slot_reset)(struct pci_dev *dev);
|
||||
};
|
||||
|
||||
A driver doesn't have to implement all of these callbacks. The
|
||||
only mandatory one is error_detected(). If a callback is not
|
||||
implemented, the corresponding feature is considered unsupported.
|
||||
For example, if mmio_enabled() and resume() aren't there, then the
|
||||
driver is assumed as not doing any direct recovery and requires
|
||||
a reset. If link_reset() is not implemented, the card is assumed as
|
||||
not caring about link resets, in which case, if recover is supported,
|
||||
the core can try recover (but not slot_reset() unless it really did
|
||||
reset the slot). If slot_reset() is not supported, link_reset() can
|
||||
be called instead on a slot reset.
|
||||
|
||||
At first, the call will always be :
|
||||
|
||||
1) error_detected()
|
||||
|
||||
Error detected. This is sent once after an error has been detected. At
|
||||
this point, the device might not be accessible anymore depending on the
|
||||
platform (the slot will be isolated on ppc64). The driver may already
|
||||
have "noticed" the error because of a failing IO, but this is the proper
|
||||
"synchronisation point", that is, it gives a chance to the driver to
|
||||
cleanup, waiting for pending stuff (timers, whatever, etc...) to
|
||||
complete; it can take semaphores, schedule, etc... everything but touch
|
||||
the device. Within this function and after it returns, the driver
|
||||
shouldn't do any new IOs. Called in task context. This is sort of a
|
||||
"quiesce" point. See note about interrupts at the end of this doc.
|
||||
|
||||
Result codes:
|
||||
- PCIERR_RESULT_CAN_RECOVER:
|
||||
Driever returns this if it thinks it might be able to recover
|
||||
the HW by just banging IOs or if it wants to be given
|
||||
a chance to extract some diagnostic informations (see
|
||||
below).
|
||||
- PCIERR_RESULT_NEED_RESET:
|
||||
Driver returns this if it thinks it can't recover unless the
|
||||
slot is reset.
|
||||
- PCIERR_RESULT_DISCONNECT:
|
||||
Return this if driver thinks it won't recover at all,
|
||||
(this will detach the driver ? or just leave it
|
||||
dangling ? to be decided)
|
||||
|
||||
So at this point, we have called error_detected() for all drivers
|
||||
on the segment that had the error. On ppc64, the slot is isolated. What
|
||||
happens now typically depends on the result from the drivers. If all
|
||||
drivers on the segment/slot return PCIERR_RESULT_CAN_RECOVER, we would
|
||||
re-enable IOs on the slot (or do nothing special if the platform doesn't
|
||||
isolate slots) and call 2). If not and we can reset slots, we go to 4),
|
||||
if neither, we have a dead slot. If it's an hotplug slot, we might
|
||||
"simulate" reset by triggering HW unplug/replug though.
|
||||
|
||||
>>> Current ppc64 implementation assumes that a device driver will
|
||||
>>> *not* schedule or semaphore in this routine; the current ppc64
|
||||
>>> implementation uses one kernel thread to notify all devices;
|
||||
>>> thus, of one device sleeps/schedules, all devices are affected.
|
||||
>>> Doing better requires complex multi-threaded logic in the error
|
||||
>>> recovery implementation (e.g. waiting for all notification threads
|
||||
>>> to "join" before proceeding with recovery.) This seems excessively
|
||||
>>> complex and not worth implementing.
|
||||
|
||||
>>> The current ppc64 implementation doesn't much care if the device
|
||||
>>> attempts i/o at this point, or not. I/O's will fail, returning
|
||||
>>> a value of 0xff on read, and writes will be dropped. If the device
|
||||
>>> driver attempts more than 10K I/O's to a frozen adapter, it will
|
||||
>>> assume that the device driver has gone into an infinite loop, and
|
||||
>>> it will panic the the kernel.
|
||||
|
||||
2) mmio_enabled()
|
||||
|
||||
This is the "early recovery" call. IOs are allowed again, but DMA is
|
||||
not (hrm... to be discussed, I prefer not), with some restrictions. This
|
||||
is NOT a callback for the driver to start operations again, only to
|
||||
peek/poke at the device, extract diagnostic information, if any, and
|
||||
eventually do things like trigger a device local reset or some such,
|
||||
but not restart operations. This is sent if all drivers on a segment
|
||||
agree that they can try to recover and no automatic link reset was
|
||||
performed by the HW. If the platform can't just re-enable IOs without
|
||||
a slot reset or a link reset, it doesn't call this callback and goes
|
||||
directly to 3) or 4). All IOs should be done _synchronously_ from
|
||||
within this callback, errors triggered by them will be returned via
|
||||
the normal pci_check_whatever() api, no new error_detected() callback
|
||||
will be issued due to an error happening here. However, such an error
|
||||
might cause IOs to be re-blocked for the whole segment, and thus
|
||||
invalidate the recovery that other devices on the same segment might
|
||||
have done, forcing the whole segment into one of the next states,
|
||||
that is link reset or slot reset.
|
||||
|
||||
Result codes:
|
||||
- PCIERR_RESULT_RECOVERED
|
||||
Driver returns this if it thinks the device is fully
|
||||
functionnal and thinks it is ready to start
|
||||
normal driver operations again. There is no
|
||||
guarantee that the driver will actually be
|
||||
allowed to proceed, as another driver on the
|
||||
same segment might have failed and thus triggered a
|
||||
slot reset on platforms that support it.
|
||||
|
||||
- PCIERR_RESULT_NEED_RESET
|
||||
Driver returns this if it thinks the device is not
|
||||
recoverable in it's current state and it needs a slot
|
||||
reset to proceed.
|
||||
|
||||
- PCIERR_RESULT_DISCONNECT
|
||||
Same as above. Total failure, no recovery even after
|
||||
reset driver dead. (To be defined more precisely)
|
||||
|
||||
>>> The current ppc64 implementation does not implement this callback.
|
||||
|
||||
3) link_reset()
|
||||
|
||||
This is called after the link has been reset. This is typically
|
||||
a PCI Express specific state at this point and is done whenever a
|
||||
non-fatal error has been detected that can be "solved" by resetting
|
||||
the link. This call informs the driver of the reset and the driver
|
||||
should check if the device appears to be in working condition.
|
||||
This function acts a bit like 2) mmio_enabled(), in that the driver
|
||||
is not supposed to restart normal driver I/O operations right away.
|
||||
Instead, it should just "probe" the device to check it's recoverability
|
||||
status. If all is right, then the core will call resume() once all
|
||||
drivers have ack'd link_reset().
|
||||
|
||||
Result codes:
|
||||
(identical to mmio_enabled)
|
||||
|
||||
>>> The current ppc64 implementation does not implement this callback.
|
||||
|
||||
4) slot_reset()
|
||||
|
||||
This is called after the slot has been soft or hard reset by the
|
||||
platform. A soft reset consists of asserting the adapter #RST line
|
||||
and then restoring the PCI BARs and PCI configuration header. If the
|
||||
platform supports PCI hotplug, then it might instead perform a hard
|
||||
reset by toggling power on the slot off/on. This call gives drivers
|
||||
the chance to re-initialize the hardware (re-download firmware, etc.),
|
||||
but drivers shouldn't restart normal I/O processing operations at
|
||||
this point. (See note about interrupts; interrupts aren't guaranteed
|
||||
to be delivered until the resume() callback has been called). If all
|
||||
device drivers report success on this callback, the patform will call
|
||||
resume() to complete the error handling and let the driver restart
|
||||
normal I/O processing.
|
||||
|
||||
A driver can still return a critical failure for this function if
|
||||
it can't get the device operational after reset. If the platform
|
||||
previously tried a soft reset, it migh now try a hard reset (power
|
||||
cycle) and then call slot_reset() again. It the device still can't
|
||||
be recovered, there is nothing more that can be done; the platform
|
||||
will typically report a "permanent failure" in such a case. The
|
||||
device will be considered "dead" in this case.
|
||||
|
||||
Result codes:
|
||||
- PCIERR_RESULT_DISCONNECT
|
||||
Same as above.
|
||||
|
||||
>>> The current ppc64 implementation does not try a power-cycle reset
|
||||
>>> if the driver returned PCIERR_RESULT_DISCONNECT. However, it should.
|
||||
|
||||
5) resume()
|
||||
|
||||
This is called if all drivers on the segment have returned
|
||||
PCIERR_RESULT_RECOVERED from one of the 3 prevous callbacks.
|
||||
That basically tells the driver to restart activity, tht everything
|
||||
is back and running. No result code is taken into account here. If
|
||||
a new error happens, it will restart a new error handling process.
|
||||
|
||||
That's it. I think this covers all the possibilities. The way those
|
||||
callbacks are called is platform policy. A platform with no slot reset
|
||||
capability for example may want to just "ignore" drivers that can't
|
||||
recover (disconnect them) and try to let other cards on the same segment
|
||||
recover. Keep in mind that in most real life cases, though, there will
|
||||
be only one driver per segment.
|
||||
|
||||
Now, there is a note about interrupts. If you get an interrupt and your
|
||||
device is dead or has been isolated, there is a problem :)
|
||||
|
||||
After much thinking, I decided to leave that to the platform. That is,
|
||||
the recovery API only precies that:
|
||||
|
||||
- There is no guarantee that interrupt delivery can proceed from any
|
||||
device on the segment starting from the error detection and until the
|
||||
restart callback is sent, at which point interrupts are expected to be
|
||||
fully operational.
|
||||
|
||||
- There is no guarantee that interrupt delivery is stopped, that is, ad
|
||||
river that gets an interrupts after detecting an error, or that detects
|
||||
and error within the interrupt handler such that it prevents proper
|
||||
ack'ing of the interrupt (and thus removal of the source) should just
|
||||
return IRQ_NOTHANDLED. It's up to the platform to deal with taht
|
||||
condition, typically by masking the irq source during the duration of
|
||||
the error handling. It is expected that the platform "knows" which
|
||||
interrupts are routed to error-management capable slots and can deal
|
||||
with temporarily disabling that irq number during error processing (this
|
||||
isn't terribly complex). That means some IRQ latency for other devices
|
||||
sharing the interrupt, but there is simply no other way. High end
|
||||
platforms aren't supposed to share interrupts between many devices
|
||||
anyway :)
|
||||
|
||||
|
||||
Revised: 31 May 2005 Linas Vepstas <linas@austin.ibm.com>
|
||||
@@ -1987,6 +1987,13 @@ M: hch@infradead.org
|
||||
L: linux-abi-devel@lists.sourceforge.net
|
||||
S: Maintained
|
||||
|
||||
PCI ERROR RECOVERY
|
||||
P: Linas Vepstas
|
||||
M: linas@austin.ibm.com
|
||||
L: linux-kernel@vger.kernel.org
|
||||
L: linux-pci@atrey.karlin.mff.cuni.cz
|
||||
S: Supported
|
||||
|
||||
PCI SOUND DRIVERS (ES1370, ES1371 and SONICVIBES)
|
||||
P: Thomas Sailer
|
||||
M: sailer@ife.ee.ethz.ch
|
||||
|
||||
@@ -254,7 +254,7 @@ alcor_init_pci(void)
|
||||
* motherboard, by looking for a 21040 TULIP in slot 6, which is
|
||||
* built into XLT and BRET/MAVERICK, but not available on ALCOR.
|
||||
*/
|
||||
dev = pci_find_device(PCI_VENDOR_ID_DEC,
|
||||
dev = pci_get_device(PCI_VENDOR_ID_DEC,
|
||||
PCI_DEVICE_ID_DEC_TULIP,
|
||||
NULL);
|
||||
if (dev && dev->devfn == PCI_DEVFN(6,0)) {
|
||||
@@ -262,6 +262,7 @@ alcor_init_pci(void)
|
||||
printk(KERN_INFO "%s: Detected AS500 or XLT motherboard.\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
pci_dev_put(dev);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ sio_collect_irq_levels(void)
|
||||
struct pci_dev *dev = NULL;
|
||||
|
||||
/* Iterate through the devices, collecting IRQ levels. */
|
||||
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
||||
for_each_pci_dev(dev) {
|
||||
if ((dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) &&
|
||||
(dev->class >> 8 != PCI_CLASS_BRIDGE_PCMCIA))
|
||||
continue;
|
||||
@@ -229,8 +229,8 @@ alphabook1_init_pci(void)
|
||||
*/
|
||||
|
||||
dev = NULL;
|
||||
while ((dev = pci_find_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
|
||||
if (dev->device == PCI_DEVICE_ID_NCR_53C810
|
||||
while ((dev = pci_get_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
|
||||
if (dev->device == PCI_DEVICE_ID_NCR_53C810
|
||||
|| dev->device == PCI_DEVICE_ID_NCR_53C815
|
||||
|| dev->device == PCI_DEVICE_ID_NCR_53C820
|
||||
|| dev->device == PCI_DEVICE_ID_NCR_53C825) {
|
||||
|
||||
@@ -142,9 +142,7 @@ static void __init pcibios_allocate_resources(int pass)
|
||||
u16 command;
|
||||
struct resource *r, *pr;
|
||||
|
||||
while (dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev),
|
||||
dev != NULL
|
||||
) {
|
||||
for_each_pci_dev(dev) {
|
||||
pci_read_config_word(dev, PCI_COMMAND, &command);
|
||||
for(idx = 0; idx < 6; idx++) {
|
||||
r = &dev->resource[idx];
|
||||
@@ -188,9 +186,7 @@ static void __init pcibios_assign_resources(void)
|
||||
int idx;
|
||||
struct resource *r;
|
||||
|
||||
while (dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev),
|
||||
dev != NULL
|
||||
) {
|
||||
for_each_pci_dev(dev) {
|
||||
int class = dev->class >> 8;
|
||||
|
||||
/* Don't touch classless devices and host bridges */
|
||||
|
||||
@@ -48,9 +48,7 @@ void __init pcibios_fixup_irqs(void)
|
||||
struct pci_dev *dev = NULL;
|
||||
uint8_t line, pin;
|
||||
|
||||
while (dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev),
|
||||
dev != NULL
|
||||
) {
|
||||
for_each_pci_dev(dev) {
|
||||
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
|
||||
if (pin) {
|
||||
dev->irq = pci_bus0_irq_routing[PCI_SLOT(dev->devfn)][pin - 1];
|
||||
|
||||
@@ -143,7 +143,7 @@ static int __init scx200_init(void)
|
||||
{
|
||||
printk(KERN_INFO NAME ": NatSemi SCx200 Driver\n");
|
||||
|
||||
return pci_module_init(&scx200_pci_driver);
|
||||
return pci_register_driver(&scx200_pci_driver);
|
||||
}
|
||||
|
||||
static void __exit scx200_cleanup(void)
|
||||
|
||||
@@ -53,7 +53,7 @@ static int __init pci_acpi_init(void)
|
||||
* don't use pci_enable_device().
|
||||
*/
|
||||
printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
|
||||
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
|
||||
for_each_pci_dev(dev)
|
||||
acpi_pci_irq_enable(dev);
|
||||
} else
|
||||
printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n");
|
||||
|
||||
@@ -413,6 +413,13 @@ static struct dmi_system_id __devinitdata toshiba_ohci1394_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Toshiba A40 based laptop",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "PSA40U"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
+23
-19
@@ -78,7 +78,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr)
|
||||
for (i=0; i < rt->size; i++)
|
||||
sum += addr[i];
|
||||
if (!sum) {
|
||||
DBG("PCI: Interrupt Routing Table found at 0x%p\n", rt);
|
||||
DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt);
|
||||
return rt;
|
||||
}
|
||||
return NULL;
|
||||
@@ -128,7 +128,7 @@ static void __init pirq_peer_trick(void)
|
||||
#ifdef DEBUG
|
||||
{
|
||||
int j;
|
||||
DBG("%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot);
|
||||
DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot);
|
||||
for(j=0; j<4; j++)
|
||||
DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap);
|
||||
DBG("\n");
|
||||
@@ -160,10 +160,10 @@ void eisa_set_level_irq(unsigned int irq)
|
||||
return;
|
||||
|
||||
eisa_irq_mask |= (1 << irq);
|
||||
printk("PCI: setting IRQ %u as level-triggered\n", irq);
|
||||
printk(KERN_DEBUG "PCI: setting IRQ %u as level-triggered\n", irq);
|
||||
val = inb(port);
|
||||
if (!(val & mask)) {
|
||||
DBG(" -> edge");
|
||||
DBG(KERN_DEBUG " -> edge");
|
||||
outb(val | mask, port);
|
||||
}
|
||||
}
|
||||
@@ -677,11 +677,11 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router,
|
||||
{
|
||||
case PCI_DEVICE_ID_AL_M1533:
|
||||
case PCI_DEVICE_ID_AL_M1563:
|
||||
printk("PCI: Using ALI IRQ Router\n");
|
||||
r->name = "ALI";
|
||||
r->get = pirq_ali_get;
|
||||
r->set = pirq_ali_set;
|
||||
return 1;
|
||||
printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n");
|
||||
r->name = "ALI";
|
||||
r->get = pirq_ali_get;
|
||||
r->set = pirq_ali_set;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -749,12 +749,13 @@ static void __init pirq_find_router(struct irq_router *r)
|
||||
r->get = NULL;
|
||||
r->set = NULL;
|
||||
|
||||
DBG("PCI: Attempting to find IRQ router for %04x:%04x\n",
|
||||
DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n",
|
||||
rt->rtr_vendor, rt->rtr_device);
|
||||
|
||||
pirq_router_dev = pci_find_slot(rt->rtr_bus, rt->rtr_devfn);
|
||||
if (!pirq_router_dev) {
|
||||
DBG("PCI: Interrupt router not found at %02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
|
||||
DBG(KERN_DEBUG "PCI: Interrupt router not found at "
|
||||
"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -799,7 +800,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
|
||||
/* Find IRQ pin */
|
||||
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
|
||||
if (!pin) {
|
||||
DBG(" -> no interrupt pin\n");
|
||||
DBG(KERN_DEBUG " -> no interrupt pin\n");
|
||||
return 0;
|
||||
}
|
||||
pin = pin - 1;
|
||||
@@ -809,16 +810,16 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
|
||||
if (!pirq_table)
|
||||
return 0;
|
||||
|
||||
DBG("IRQ for %s[%c]", pci_name(dev), 'A' + pin);
|
||||
DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin);
|
||||
info = pirq_get_info(dev);
|
||||
if (!info) {
|
||||
DBG(" -> not found in routing table\n");
|
||||
DBG(" -> not found in routing table\n" KERN_DEBUG);
|
||||
return 0;
|
||||
}
|
||||
pirq = info->irq[pin].link;
|
||||
mask = info->irq[pin].bitmap;
|
||||
if (!pirq) {
|
||||
DBG(" -> not routed\n");
|
||||
DBG(" -> not routed\n" KERN_DEBUG);
|
||||
return 0;
|
||||
}
|
||||
DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, pirq_table->exclusive_irqs);
|
||||
@@ -848,7 +849,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
|
||||
newirq = dev->irq;
|
||||
if (newirq && !((1 << newirq) & mask)) {
|
||||
if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0;
|
||||
else printk(KERN_WARNING "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n", newirq, pci_name(dev));
|
||||
else printk("\n" KERN_WARNING
|
||||
"PCI: IRQ %i for device %s doesn't match PIRQ mask "
|
||||
"- try pci=usepirqmask\n" KERN_DEBUG, newirq,
|
||||
pci_name(dev));
|
||||
}
|
||||
if (!newirq && assign) {
|
||||
for (i = 0; i < 16; i++) {
|
||||
@@ -923,14 +927,14 @@ static void __init pcibios_fixup_irqs(void)
|
||||
struct pci_dev *dev = NULL;
|
||||
u8 pin;
|
||||
|
||||
DBG("PCI: IRQ fixup\n");
|
||||
DBG(KERN_DEBUG "PCI: IRQ fixup\n");
|
||||
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
||||
/*
|
||||
* If the BIOS has set an out of range IRQ number, just ignore it.
|
||||
* Also keep track of which IRQ's are already in use.
|
||||
*/
|
||||
if (dev->irq >= 16) {
|
||||
DBG("%s: ignoring bogus IRQ %d\n", pci_name(dev), dev->irq);
|
||||
DBG(KERN_DEBUG "%s: ignoring bogus IRQ %d\n", pci_name(dev), dev->irq);
|
||||
dev->irq = 0;
|
||||
}
|
||||
/* If the IRQ is already assigned to a PCI device, ignore its ISA use penalty */
|
||||
@@ -1039,7 +1043,7 @@ static struct dmi_system_id __initdata pciirq_dmi_table[] = {
|
||||
|
||||
static int __init pcibios_irq_init(void)
|
||||
{
|
||||
DBG("PCI: IRQ init\n");
|
||||
DBG(KERN_DEBUG "PCI: IRQ init\n");
|
||||
|
||||
if (pcibios_enable_irq || raw_pci_ops == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -561,7 +561,7 @@ static int __devinit vrc4173_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = pci_module_init(&vrc4173_driver);
|
||||
err = pci_register_driver(&vrc4173_driver);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
||||
+11
-10
@@ -503,7 +503,7 @@ pcibios_allocate_resources(int pass)
|
||||
u16 command;
|
||||
struct resource *r;
|
||||
|
||||
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
||||
for_each_pci_dev(dev) {
|
||||
pci_read_config_word(dev, PCI_COMMAND, &command);
|
||||
for (idx = 0; idx < 6; idx++) {
|
||||
r = &dev->resource[idx];
|
||||
@@ -540,7 +540,7 @@ pcibios_assign_resources(void)
|
||||
int idx;
|
||||
struct resource *r;
|
||||
|
||||
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
||||
for_each_pci_dev(dev) {
|
||||
int class = dev->class >> 8;
|
||||
|
||||
/* Don't touch classless devices and host bridges */
|
||||
@@ -867,14 +867,15 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
|
||||
*/
|
||||
if (!pci_to_OF_bus_map)
|
||||
return 0;
|
||||
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
|
||||
if (pci_to_OF_bus_map[dev->bus->number] != *bus)
|
||||
continue;
|
||||
if (dev->devfn != *devfn)
|
||||
continue;
|
||||
*bus = dev->bus->number;
|
||||
return 0;
|
||||
}
|
||||
|
||||
for_each_pci_dev(dev)
|
||||
if (pci_to_OF_bus_map[dev->bus->number] == *bus &&
|
||||
dev->devfn == *devfn) {
|
||||
*bus = dev->bus->number;
|
||||
pci_dev_put(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
EXPORT_SYMBOL(pci_device_from_OF_node);
|
||||
|
||||
@@ -351,10 +351,10 @@ mpc85xx_cds_fixup_via(struct pci_controller *hose)
|
||||
void __init
|
||||
mpc85xx_cds_pcibios_fixup(void)
|
||||
{
|
||||
struct pci_dev *dev = NULL;
|
||||
struct pci_dev *dev;
|
||||
u_char c;
|
||||
|
||||
if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
|
||||
if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
|
||||
PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
|
||||
/*
|
||||
* U-Boot does not set the enable bits
|
||||
@@ -371,21 +371,24 @@ mpc85xx_cds_pcibios_fixup(void)
|
||||
*/
|
||||
dev->irq = 14;
|
||||
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
|
||||
pci_dev_put(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
* Force legacy USB interrupt routing
|
||||
*/
|
||||
if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
|
||||
if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
|
||||
PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
|
||||
dev->irq = 10;
|
||||
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
|
||||
pci_dev_put(dev);
|
||||
}
|
||||
|
||||
if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
|
||||
if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
|
||||
PCI_DEVICE_ID_VIA_82C586_2, dev))) {
|
||||
dev->irq = 11;
|
||||
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
|
||||
pci_dev_put(dev);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
@@ -527,18 +527,12 @@ static struct pci_dev *find_next_ebus(struct pci_dev *start, int *is_rio_p)
|
||||
{
|
||||
struct pci_dev *pdev = start;
|
||||
|
||||
do {
|
||||
pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev);
|
||||
if (pdev &&
|
||||
(pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
|
||||
pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS))
|
||||
while ((pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev)))
|
||||
if (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
|
||||
pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)
|
||||
break;
|
||||
} while (pdev != NULL);
|
||||
|
||||
if (pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS))
|
||||
*is_rio_p = 1;
|
||||
else
|
||||
*is_rio_p = 0;
|
||||
*is_rio_p = !!(pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS));
|
||||
|
||||
return pdev;
|
||||
}
|
||||
@@ -637,6 +631,7 @@ void __init ebus_init(void)
|
||||
ebus->is_rio = is_rio;
|
||||
++num_ebus;
|
||||
}
|
||||
pci_dev_put(pdev); /* XXX for the case, when ebusnd is 0, is it OK? */
|
||||
|
||||
#ifdef CONFIG_SUN_AUXIO
|
||||
auxio_probe();
|
||||
|
||||
@@ -361,8 +361,7 @@ acpi_pci_irq_derive(struct pci_dev *dev,
|
||||
|
||||
if ((bridge->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) {
|
||||
/* PC card has the same IRQ as its cardbridge */
|
||||
pci_read_config_byte(bridge, PCI_INTERRUPT_PIN,
|
||||
&bridge_pin);
|
||||
bridge_pin = bridge->pin;
|
||||
if (!bridge_pin) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"No interrupt pin configured for device %s\n",
|
||||
@@ -412,7 +411,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
||||
if (!dev)
|
||||
return_VALUE(-EINVAL);
|
||||
|
||||
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
|
||||
pin = dev->pin;
|
||||
if (!pin) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"No interrupt pin configured for device %s\n",
|
||||
@@ -503,7 +502,7 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
|
||||
if (!dev || !dev->bus)
|
||||
return_VOID;
|
||||
|
||||
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
|
||||
pin = dev->pin;
|
||||
if (!pin)
|
||||
return_VOID;
|
||||
pin--;
|
||||
|
||||
@@ -7179,7 +7179,7 @@ static int DAC960_init_module(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = pci_module_init(&DAC960_pci_driver);
|
||||
ret = pci_register_driver(&DAC960_pci_driver);
|
||||
#ifdef DAC960_GAM_MINOR
|
||||
if (!ret)
|
||||
DAC960_gam_init();
|
||||
|
||||
@@ -3360,7 +3360,7 @@ static int __init cciss_init(void)
|
||||
printk(KERN_INFO DRIVER_NAME "\n");
|
||||
|
||||
/* Register for our PCI devices */
|
||||
return pci_module_init(&cciss_pci_driver);
|
||||
return pci_register_driver(&cciss_pci_driver);
|
||||
}
|
||||
|
||||
static void __exit cciss_cleanup(void)
|
||||
|
||||
+1
-1
@@ -1755,7 +1755,7 @@ static void carm_remove_one (struct pci_dev *pdev)
|
||||
|
||||
static int __init carm_init(void)
|
||||
{
|
||||
return pci_module_init(&carm_driver);
|
||||
return pci_register_driver(&carm_driver);
|
||||
}
|
||||
|
||||
static void __exit carm_exit(void)
|
||||
|
||||
@@ -1174,7 +1174,7 @@ static int __init mm_init(void)
|
||||
|
||||
printk(KERN_INFO DRIVER_VERSION " : " DRIVER_DESC "\n");
|
||||
|
||||
retval = pci_module_init(&mm_pci_driver);
|
||||
retval = pci_register_driver(&mm_pci_driver);
|
||||
if (retval)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user