From: Linas Vepstas <linas@austin.ibm.com>
To: linux-kernel@vger.kernel.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
long <tlnguyen@snoqualmie.dp.intel.com>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
Greg KH <greg@kroah.com>,
ak@muc.de, Paul Mackerras <paulus@samba.org>,
linuxppc64-dev <linuxppc64-dev@ozlabs.org>,
linux-pci@atrey.karlin.mff.cuni.cz, johnrose@us.ibm.com
Subject: [PATCH 1/13]: PCI Err: pci.h header file changes
Date: Tue, 28 Jun 2005 18:58:17 -0500 [thread overview]
Message-ID: <20050628235817.GA6324@austin.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 259 bytes --]
pci-err-1-pci.h.patch
This patch adds PCI error recovery callbacks, error state and
error return codes to include/linux/pci.h. These are closely
described in the next patch, a documentation file.
Signed-off-by: Linas Vepstas <linas@linas.org>
[-- Attachment #2: pci-err-1-pci.h.patch --]
[-- Type: text/plain, Size: 2196 bytes --]
--- linux-2.6.12-git10/include/linux/pci.h.linas-orig 2005-06-17 14:48:29.000000000 -0500
+++ linux-2.6.12-git10/include/linux/pci.h 2005-06-24 14:44:59.000000000 -0500
@@ -660,6 +660,37 @@ struct pci_dynids {
unsigned int use_driver_data:1; /* pci_driver->driver_data is used */
};
+/* ---------------------------------------------------------------- */
+/** PCI error recovery infrastructure. If a PCI device driver provides
+ * a set fof callbacks in struct pci_error_handlers, then that device driver
+ * will be notified of PCI bus errors, and can be driven to recovery.
+ */
+
+enum pci_channel_state {
+ pci_channel_io_normal = 0, /* I/O channel is in normal state */
+ pci_channel_io_frozen = 1, /* I/O to channel is blocked */
+ pci_channel_io_perm_failure, /* pci card is dead */
+};
+
+enum pcierr_result {
+ PCIERR_RESULT_NONE=0, /* no result/none/not supported in device driver */
+ PCIERR_RESULT_CAN_RECOVER=1, /* Device driver can recover without slot reset */
+ PCIERR_RESULT_NEED_RESET, /* Device driver wants slot to be reset. */
+ PCIERR_RESULT_DISCONNECT, /* Device has completely failed, is unrecoverable */
+ PCIERR_RESULT_RECOVERED, /* Device driver is fully recovered and operational */
+};
+
+/* PCI bus error event callbacks */
+struct pci_error_handlers
+{
+ enum pci_channel_state error_state; /* current error state */
+ int (*error_detected)(struct pci_dev *dev, enum pci_channel_state error);
+ int (*mmio_enabled)(struct pci_dev *dev); /* MMIO has been reanbled, but not DMA */
+ int (*link_reset)(struct pci_dev *dev); /* PCI Express link has been reset */
+ int (*slot_reset)(struct pci_dev *dev); /* PCI slot has been reset */
+ void (*resume)(struct pci_dev *dev); /* Device driver may resume normal operations */
+};
+
struct module;
struct pci_driver {
struct list_head node;
@@ -673,6 +704,7 @@ struct pci_driver {
int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
void (*shutdown) (struct pci_dev *dev);
+ struct pci_error_handlers err_handler;
struct device_driver driver;
struct pci_dynids dynids;
};
next reply other threads:[~2005-06-29 0:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 23:58 Linas Vepstas [this message]
2005-06-29 0:29 ` [PATCH 1/13]: PCI Err: pci.h header file changes Greg KH
2005-06-29 3:04 ` Andi Kleen
2005-06-29 1:43 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050628235817.GA6324@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=ak@muc.de \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=johnrose@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=linuxppc64-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=seto.hidetoshi@jp.fujitsu.com \
--cc=tlnguyen@snoqualmie.dp.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.