From: linas <linas@austin.ibm.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org,
bluesmoke-devel@lists.sourceforge.net,
Paul Mackerras <paulus@samba.org>,
linuxppc64-dev@ozlabs.org, linux-pci@atrey.karlin.mff.cuni.cz
Subject: [PATCH 7/7]: Revised [PATCH 32/42]: RFC: Add compile-time config options
Date: Mon, 7 Nov 2005 15:39:54 -0600 [thread overview]
Message-ID: <20051107213954.GN19593@austin.ibm.com> (raw)
In-Reply-To: <20051107195727.GF19593@austin.ibm.com>
On Mon, Nov 07, 2005 at 01:57:27PM -0600, linas was heard to remark:
> On Mon, Nov 07, 2005 at 10:27:27AM -0800, Greg KH was heard to remark:
> > 3) realy strong typing that sparse can detect.
This OPTIONAL/RFC patch adds ifdef's around the PCI error recovery code in the
various device drivers. This patch is "optional" in that its a little bit
messy, but it does solve a little problem.
-- The good news: this gives some users (e.g. embeddd systems) the option
of not compiling in this code, thus making thier device drivers a tiny
bit smaller.
-- The bad news: This also clutters up the drivers with extraneous markup
and the config process with yet another config.
Please apply if you agree with the need for this patch :)
Signed-off-by: Linas Vepstas <linas@linas.org>
Index: linux-2.6.14-mm1/drivers/scsi/ipr.c
===================================================================
--- linux-2.6.14-mm1.orig/drivers/scsi/ipr.c 2005-11-07 15:02:00.639392946 -0600
+++ linux-2.6.14-mm1/drivers/scsi/ipr.c 2005-11-07 15:02:20.029668601 -0600
@@ -5329,6 +5329,8 @@
}
/* --------------- PCI Error Recovery infrastructure ----------- */
+#ifdef CONFIG_PCI_ERR_RECOVERY
+
/** If the PCI slot is frozen, hold off all i/o
* activity; then, as soon as the slot is available again,
* initiate an adapter reset.
@@ -5414,6 +5416,7 @@
return PERS_RESULT_NEED_RESET;
}
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/* ------------- end of PCI Error Recovery suport ----------- */
/**
@@ -6153,10 +6156,12 @@
};
MODULE_DEVICE_TABLE(pci, ipr_pci_table);
+#ifdef CONFIG_PCI_ERR_RECOVERY
static struct pci_error_handlers ipr_err_handler = {
.error_detected = ipr_eeh_error_detected,
.slot_reset = ipr_eeh_slot_reset,
};
+#endif /* CONFIG_PCI_ERR_RECOVERY */
static struct pci_driver ipr_driver = {
.name = IPR_NAME,
@@ -6164,7 +6169,9 @@
.probe = ipr_probe,
.remove = ipr_remove,
.shutdown = ipr_shutdown,
+#ifdef CONFIG_PCI_ERR_RECOVERY
.err_handler = &ipr_err_handler,
+#endif /* CONFIG_PCI_ERR_RECOVERY */
};
/**
Index: linux-2.6.14-mm1/drivers/pci/Kconfig
===================================================================
--- linux-2.6.14-mm1.orig/drivers/pci/Kconfig 2005-11-07 13:55:23.869498177 -0600
+++ linux-2.6.14-mm1/drivers/pci/Kconfig 2005-11-07 15:02:20.030668460 -0600
@@ -13,6 +13,21 @@
If you don't know what to do here, say N.
+config PCI_ERR_RECOVERY
+ bool "PCI Error Recovery support"
+ depends on PCI
+ depends on PPC_PSERIES
+ default y
+ help
+ PCI Error Recovery is a mechanism by which crashed/hung
+ PCI adapters are automatically detected and rebooted without
+ otherwise disturbing the operation of the system. Support
+ for this recovery requires special PCI bridge chips (some
+ PCI-E chips may have this support) as well as support in
+ the device drivers (not all device drivers can handle this).
+
+ When in doubt, say Y.
+
config PCI_LEGACY_PROC
bool "Legacy /proc/pci interface"
depends on PCI
Index: linux-2.6.14-mm1/drivers/scsi/sym53c8xx_2/sym_glue.c
===================================================================
--- linux-2.6.14-mm1.orig/drivers/scsi/sym53c8xx_2/sym_glue.c 2005-11-07 15:02:08.152337375 -0600
+++ linux-2.6.14-mm1/drivers/scsi/sym53c8xx_2/sym_glue.c 2005-11-07 15:02:20.034667898 -0600
@@ -763,6 +763,7 @@
*/
static void sym_eh_timeout(u_long p) { __sym_eh_done((struct scsi_cmnd *)p, 1); }
+#ifdef CONFIG_PCI_ERR_RECOVERY
static void sym_eeh_timeout(u_long p)
{
struct sym_eh_wait *ep = (struct sym_eh_wait *) p;
@@ -781,6 +782,7 @@
complete(&ep->done);
}
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/*
* Generic method for our eh processing.
@@ -823,6 +825,7 @@
/* Try to proceed the operation we have been asked for */
sts = -1;
+#ifdef CONFIG_PCI_ERR_RECOVERY
/* We may be in an error condition because the PCI bus
* went down. In this case, we need to wait until the
* PCI bus is reset, the card is reset, and only then
@@ -850,6 +853,7 @@
}
np->s.io_reset_wait = NULL;
}
+#endif /* CONFIG_PCI_ERR_RECOVERY */
switch(op) {
case SYM_EH_ABORT:
@@ -1971,6 +1975,7 @@
}
/* ------------- PCI Error Recovery infrastructure -------------- */
+#ifdef CONFIG_PCI_ERR_RECOVERY
/** sym2_io_error_detected() is called when PCI error is detected */
static pers_result_t sym2_io_error_detected (struct pci_dev *pdev, pci_channel_state_t state)
{
@@ -2021,6 +2026,7 @@
np->s.io_state = pci_channel_io_normal;
sym_eeh_done (np->s.io_reset_wait);
}
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/*
* Driver host template.
@@ -2275,18 +2281,22 @@
MODULE_DEVICE_TABLE(pci, sym2_id_table);
+#ifdef CONFIG_PCI_ERR_RECOVERY
static struct pci_error_handlers sym2_err_handler = {
.error_detected = sym2_io_error_detected,
.slot_reset = sym2_io_slot_reset,
.resume = sym2_io_resume,
};
+#endif /* CONFIG_PCI_ERR_RECOVERY */
static struct pci_driver sym2_driver = {
.name = NAME53C8XX,
.id_table = sym2_id_table,
.probe = sym2_probe,
.remove = __devexit_p(sym2_remove),
+#ifdef CONFIG_PCI_ERR_RECOVERY
.err_handler = &sym2_err_handler,
+#endif /* CONFIG_PCI_ERR_RECOVERY */
};
static int __init sym2_init(void)
Index: linux-2.6.14-mm1/drivers/net/e100.c
===================================================================
--- linux-2.6.14-mm1.orig/drivers/net/e100.c 2005-11-07 15:02:11.120920287 -0600
+++ linux-2.6.14-mm1/drivers/net/e100.c 2005-11-07 15:02:20.038667336 -0600
@@ -2466,6 +2466,7 @@
/* ------------------ PCI Error Recovery infrastructure -------------- */
+#ifdef CONFIG_PCI_ERR_RECOVERY
/** e100_io_error_detected() is called when PCI error is detected */
static pers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
{
@@ -2532,6 +2533,7 @@
.slot_reset = e100_io_slot_reset,
.resume = e100_io_resume,
};
+#endif /* CONFIG_PCI_ERR_RECOVERY */
static struct pci_driver e100_driver = {
@@ -2544,7 +2546,9 @@
.resume = e100_resume,
#endif
.shutdown = e100_shutdown,
+#ifdef CONFIG_PCI_ERR_RECOVERY
.err_handler = &e100_err_handler,
+#endif /* CONFIG_PCI_ERR_RECOVERY */
};
static int __init e100_init_module(void)
Index: linux-2.6.14-mm1/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.14-mm1.orig/drivers/net/e1000/e1000_main.c 2005-11-07 15:02:12.811682734 -0600
+++ linux-2.6.14-mm1/drivers/net/e1000/e1000_main.c 2005-11-07 15:02:20.071662701 -0600
@@ -206,6 +206,7 @@
void e1000_rx_schedule(void *data);
#endif
+#ifdef CONFIG_PCI_ERR_RECOVERY
static pers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state);
static pers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
static void e1000_io_resume(struct pci_dev *pdev);
@@ -215,6 +216,7 @@
.slot_reset = e1000_io_slot_reset,
.resume = e1000_io_resume,
};
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/* Exported from other modules */
@@ -230,7 +232,9 @@
.suspend = e1000_suspend,
.resume = e1000_resume,
#endif
+#ifdef CONFIG_PCI_ERR_RECOVERY
.err_handler = &e1000_err_handler,
+#endif /* CONFIG_PCI_ERR_RECOVERY */
};
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
@@ -4375,6 +4379,7 @@
#endif
/* --------------- PCI Error Recovery infrastructure ------------ */
+#ifdef CONFIG_PCI_ERR_RECOVERY
/** e1000_io_error_detected() is called when PCI error is detected */
static pers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
{
@@ -4457,5 +4462,6 @@
if(netif_running(netdev))
mod_timer(&adapter->watchdog_timer, jiffies);
}
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/* e1000_main.c */
Index: linux-2.6.14-mm1/drivers/net/ixgb/ixgb_main.c
===================================================================
--- linux-2.6.14-mm1.orig/drivers/net/ixgb/ixgb_main.c 2005-11-07 15:02:14.779406268 -0600
+++ linux-2.6.14-mm1/drivers/net/ixgb/ixgb_main.c 2005-11-07 15:02:20.075662139 -0600
@@ -132,6 +132,7 @@
static void ixgb_netpoll(struct net_device *dev);
#endif
+#ifdef CONFIG_PCI_ERR_RECOVERY
static pers_result_t ixgb_io_error_detected (struct pci_dev *pdev, pci_channel_state_t state);
static pers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
static void ixgb_io_resume (struct pci_dev *pdev);
@@ -141,6 +142,7 @@
.slot_reset = ixgb_io_slot_reset,
.resume = ixgb_io_resume,
};
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/* Exported from other modules */
@@ -151,8 +153,9 @@
.id_table = ixgb_pci_tbl,
.probe = ixgb_probe,
.remove = __devexit_p(ixgb_remove),
+#ifdef CONFIG_PCI_ERR_RECOVERY
.err_handler = &ixgb_err_handler,
-
+#endif /* CONFIG_PCI_ERR_RECOVERY */
};
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
@@ -2146,6 +2149,7 @@
#endif
/* -------------- PCI Error Recovery infrastructure ---------------- */
+#ifdef CONFIG_PCI_ERR_RECOVERY
/** ixgb_io_error_detected() is called when PCI error is detected */
static pers_result_t ixgb_io_error_detected (struct pci_dev *pdev, pci_channel_state_t state)
{
@@ -2210,5 +2214,6 @@
memset(&adapter->stats, 0, sizeof(struct ixgb_hw_stats));
ixgb_update_stats(adapter);
}
+#endif /* CONFIG_PCI_ERR_RECOVERY */
/* ixgb_main.c */
next prev parent reply other threads:[~2005-11-07 21:39 UTC|newest]
Thread overview: 131+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-03 23:59 [PATCH 0/42] PCI Error Recovery for PPC64 and misc device drivers Linas Vepstas
2005-11-04 0:42 ` [PATCH 1/42] ppc64: uniform usage of bus unit id interfaces linas
2005-11-04 0:47 ` [PATCH 2/42]: ppc64: misc minor cleanup Linas Vepstas
2005-11-04 0:48 ` [PATCH 3/42]: ppc64: PCI address cache minor fixes Linas Vepstas
2005-11-04 0:48 ` [PATCH 4/42]: ppc64: PCI error rate statistics Linas Vepstas
2005-11-04 0:49 ` [PATCH 5/42]: ppc64: RTAS error reporting restructuring Linas Vepstas
2005-11-04 0:49 ` [PATCH 6/42]: ppc64: avoid PCI error reporting for empty slots Linas Vepstas
2005-11-04 0:49 ` [PATCH 7/42]: ppc64: serialize reports of PCI errors Linas Vepstas
2005-11-04 0:49 ` [PATCH 8/42]: ppc64: escape hatch for spinning interrupt deadlocks Linas Vepstas
2005-11-04 0:49 ` [PATCH 9/42]: ppc64: bugfix: crash on PCI hotplug Linas Vepstas
2005-11-04 0:49 ` [PATCH 10/42]: ppc64: bugfix: don't silently gnore PCI errors Linas Vepstas
2005-11-04 0:49 ` [PATCH 11/42]: ppc64: move code to powerpc directory from ppc64 Linas Vepstas
2005-11-04 0:50 ` [PATCH 12/42]: ppc64: PCI error event dispatcher Linas Vepstas
2005-11-04 0:50 ` [PATCH 13/42]: ppc64: PCI reset support routines Linas Vepstas
2005-11-04 0:50 ` [PATCH 14/42]: ppc64: Save & restore of PCI device BARS Linas Vepstas
2005-11-04 0:50 ` [PATCH 15/42]: Documentation: PCI Error Recovery Linas Vepstas
2005-11-04 0:50 ` [PATCH 16/42]: PCI: PCI Error reporting callbacks Linas Vepstas
2005-11-05 6:11 ` Greg KH
2005-11-06 23:25 ` Paul Mackerras
2005-11-07 17:55 ` linas
2005-11-07 18:27 ` Greg KH
2005-11-07 18:56 ` typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks] linas
2005-11-07 19:02 ` Greg KH
2005-11-07 19:36 ` linas
2005-11-07 20:02 ` Greg KH
2005-11-07 20:41 ` linas
2005-11-07 20:46 ` Greg KH
2005-11-08 1:11 ` Steven Rostedt
2005-11-08 1:18 ` Neil Brown
2005-11-08 23:36 ` typedefs and structs linas
2005-12-16 13:09 ` typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks] Denis Vlasenko
2005-12-16 13:22 ` Matthew Wilcox
2005-11-08 23:23 ` typedefs and structs linas
2005-11-08 23:33 ` Steven Rostedt
2005-11-09 9:22 ` Bernd Petrovitsch
2005-11-08 23:57 ` Kyle Moffett
2005-11-09 0:30 ` linas
2005-11-09 0:37 ` Douglas McNaught
2005-11-09 0:48 ` linas
2005-11-09 0:59 ` Douglas McNaught
2005-11-09 2:14 ` Dmitry Torokhov
2005-11-09 1:51 ` Kyle Moffett
2005-11-09 10:16 ` J.A. Magallon
2005-11-09 16:22 ` Vadim Lobanov
2005-11-09 19:20 ` linas
2005-11-09 19:36 ` thockin
2005-11-09 19:38 ` linas
2005-11-09 20:39 ` thockin
2005-11-09 21:53 ` Andreas Schwab
2005-11-09 22:00 ` Bernd Petrovitsch
2005-11-09 20:55 ` Matthew Wilcox
2005-11-09 20:26 ` linux-os (Dick Johnson)
2005-11-09 22:12 ` Vadim Lobanov
2005-11-09 22:37 ` linux-os (Dick Johnson)
2005-11-09 22:47 ` Vadim Lobanov
2005-11-09 22:54 ` typedefs and structs - trim request doug thompson
2005-11-09 23:29 ` typedefs and structs Andreas Schwab
2005-11-09 23:40 ` Vadim Lobanov
2005-11-10 3:39 ` Steven Rostedt
2005-11-10 3:49 ` Vadim Lobanov
2005-11-10 8:15 ` J.A. Magallon
2005-11-10 13:27 ` Nikita Danilov
2005-11-10 14:18 ` linux-os (Dick Johnson)
2005-11-10 19:21 ` Kyle Moffett
2005-11-10 19:28 ` Vadim Lobanov
2005-11-10 20:53 ` J.A. Magallon
2005-11-09 23:29 ` linas
2005-11-09 21:43 ` Vadim Lobanov
2005-11-10 0:27 ` linas
2005-11-08 23:57 ` David Gibson
2005-11-09 0:13 ` Zan Lynx
2005-11-09 0:42 ` linas
2005-11-09 9:25 ` Bernd Petrovitsch
2005-11-07 19:04 ` typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks] Randy.Dunlap
2005-11-07 19:57 ` [PATCH 1/7]: PCI revised [PATCH 16/42]: PCI: PCI Error reporting callbacks linas
2005-11-07 19:59 ` Christoph Hellwig
2005-11-07 20:03 ` Greg KH
2005-11-07 21:21 ` [PATCH 1/7]: PCI revised (2) " linas
2005-11-07 21:37 ` Greg KH
2005-11-07 21:54 ` Linus Torvalds
2005-11-07 22:54 ` Greg KH
2005-11-07 22:43 ` [PATCH 1/7]: PCI revised (3) " linas
2005-11-07 22:53 ` Greg KH
2005-11-07 23:19 ` linas
2005-11-08 2:43 ` Greg KH
2005-11-07 21:30 ` [PATCH 2/7]: Revised [PATCH 27/42]: SCSI: add PCI error recovery to IPR dev driver linas
2005-11-07 21:40 ` Brian King
2005-11-07 22:03 ` linas
2005-11-07 21:31 ` [PATCH 3/7]: Revised [PATCH 28/42]: SCSI: add PCI error recovery to Symbios " linas
2005-11-07 21:34 ` [PATCH 4/7]: Revised [PATCH 29/42]: ethernet: add PCI error recovery to e100 " linas
2005-11-07 21:36 ` [PATCH: 5/7]: Revised: [PATCH 30/42]: ethernet: add PCI error recovery to e1000 " linas
2005-11-07 21:37 ` [PATCH 6/7]: Revised [PATCH 31/42]: ethernet: add PCI error recovery to ixgb " linas
2005-11-07 21:39 ` linas [this message]
2005-11-04 0:50 ` [PATCH 17/42]: ppc64: mark failed devices Linas Vepstas
2005-11-04 0:51 ` [PATCH 18/42]: ppc64: bugfix: crash on dlpar slot add, remove Linas Vepstas
2005-11-04 0:51 ` [PATCH 19/42]: ppc64: bugfix: crash on PHB add Linas Vepstas
2005-11-04 16:20 ` John Rose
2005-11-04 16:35 ` linas
2005-11-04 0:51 ` [PATCH 20/42]: ppc64: PCI hotplug common code elimination Linas Vepstas
2005-11-04 0:51 ` [PATCH 21/42]: PCI: cleanup/simplify ppc64 PCI hotplug code Linas Vepstas
2005-11-04 0:52 ` [PATCH 22/42]: PCI: remove duplicted pci " Linas Vepstas
2005-11-04 21:54 ` John Rose
2005-11-04 0:52 ` [PATCH 23/42]: ppc64: migrate common PCI " Linas Vepstas
2005-11-04 0:52 ` [PATCH 24/42]: ppc64: PCI Error Recovery: PPC64 core recovery routines Linas Vepstas
2005-11-04 0:53 ` [PATCH 25/42]: ppc64: Split out PCI address cache to its own file Linas Vepstas
2005-11-04 0:53 ` [PATCH 26/42]: ppc64: Add "partion endpoint" support Linas Vepstas
2005-11-04 0:53 ` [PATCH 27/42]: SCSI: add PCI error recovery to IPR dev driver Linas Vepstas
2005-11-04 0:53 ` [PATCH 28/42]: SCSI: add PCI error recovery to Symbios " Linas Vepstas
2005-11-04 0:53 ` [PATCH 29/42]: ethernet: add PCI error recovery to e100 " Linas Vepstas
2005-11-04 1:34 ` Jesse Brandeburg
2005-11-04 1:51 ` Jesse Brandeburg
2005-11-04 0:54 ` [PATCH 30/42]: ethernet: add PCI error recovery to e1000 " Linas Vepstas
2005-11-04 0:54 ` [PATCH 31/42]: ethernet: add PCI error recovery to ixgb " Linas Vepstas
2005-11-04 0:54 ` [PATCH 32/42]: RFC: Add compile-time config options Linas Vepstas
2005-11-04 0:54 ` [PATCH 33/42]: ppc64: remove bogus printk Linas Vepstas
2005-11-04 0:54 ` [PATCH 34/42]: ppc64: Remove duplicate code Linas Vepstas
2005-11-04 0:54 ` [PATCH 35/42]: ppc64: bugfix: fill in un-initialzed field Linas Vepstas
2005-11-04 0:54 ` [PATCH 36/42]: ppc64: Use PE configuration address consistently Linas Vepstas
2005-11-04 0:54 ` [PATCH 37/42]: ppc64: set up the RTAS token just like the rest of them Linas Vepstas
2005-11-04 0:54 ` [PATCH 38/42]: ppc64: Don't continue with PCI Error recovery if slot reset failed Linas Vepstas
2005-11-04 0:55 ` [PATCH 39/42]: ppc64: handle multifunction PCI devices properly Linas Vepstas
2005-11-04 0:55 ` [PATCH 40/42]: ppc64: IOMMU: don't ioremap null pointers Linas Vepstas
2005-11-04 0:55 ` [PATCH 41/42]: ppc64: Save device BARS much earlier in the boot sequence Linas Vepstas
2005-11-04 22:14 ` linas
2005-11-04 0:55 ` [PATCH 42/42]: ppc64: get rid of per_cpu counters Linas Vepstas
2005-11-04 0:57 ` [PATCH 11/42]: ppc64: move code to powerpc directory from ppc64 Linas Vepstas
2005-11-04 22:14 ` [PATCH 0/42] PCI Error Recovery for PPC64 and misc device drivers Greg KH
2005-11-05 0:08 ` Paul Mackerras
2005-11-05 0:28 ` Greg KH
2005-11-05 0:46 ` Paul Mackerras
2005-11-05 1:28 ` Greg KH
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=20051107213954.GN19593@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=bluesmoke-devel@lists.sourceforge.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=linuxppc64-dev@ozlabs.org \
--cc=paulus@samba.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®