All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/13]: PCI Err: pci.h header file changes
@ 2005-06-28 23:58 Linas Vepstas
  2005-06-29  0:29 ` Greg KH
  2005-06-29  1:43 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 4+ messages in thread
From: Linas Vepstas @ 2005-06-28 23:58 UTC (permalink / raw)
  To: linux-kernel, Benjamin Herrenschmidt, long
  Cc: Hidetoshi Seto, Greg KH, ak, Paul Mackerras, linuxppc64-dev,
	linux-pci, johnrose

[-- 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;
 };

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-06-29  3:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-28 23:58 [PATCH 1/13]: PCI Err: pci.h header file changes Linas Vepstas
2005-06-29  0:29 ` Greg KH
2005-06-29  3:04   ` Andi Kleen
2005-06-29  1:43 ` Benjamin Herrenschmidt

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.