Red Hat Bugzilla – Bug 159739
[Stratus RHEL4U2] csb5 functions are tagged with __init. This causes a crash in a hot-plug environment
Last modified: 2007-11-30 17:07:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Description of problem:
We have a hardware platform with a csb5 chip below a PCI hot-plug slot. The kernel has the csb5 quirk functions (drivers/pci/quirks.c) tagged with __init section marker, so these are discarded after system boot. Unfortunately, in a hot-plog environment, we need these to be persistent functions, so __devinit is a better tag. I have already submitted this request to the PCI Hotplug maintainer, Greg Kroah. He has accepted my patch, and it is present in linux 2.6.12-rc5. So in effect, this report is simply a request for a back-port of that patch.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Bring down Stratus platform hotplug slot 4.
2. Bring up Stratus platform hotplog slot 4 (kernel oops)
Any other machine with a csb5 below a hotplug slot will suffer the same fate as well.
Actual Results: Kernel oops.
Expected Results: Successful PCI enumeration and chipset init.
This is the acceptance letter from the PCI Hotplug maintainer, Greg Kroah:
ChangeSet 1.2181.16.6, 2005/03/17 10:23:26-08:00, firstname.lastname@example.org
[PATCH] PCI: Patch for Serverworks chips in hotplug environment
From: Kimball Murray <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
drivers/ide/pci/serverworks.c | 8 ++++----
drivers/pci/quirks.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff -Nru a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
--- a/drivers/ide/pci/serverworks.c 2005-04-01 15:38:06 -08:00
+++ b/drivers/ide/pci/serverworks.c 2005-04-01 15:38:06 -08:00
@@ -341,7 +341,7 @@
-static unsigned int __init init_chipset_svwks (struct pci_dev *dev, const char *name)
+static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name)
unsigned int reg;
@@ -508,7 +508,7 @@
-static void __init init_hwif_svwks (ide_hwif_t *hwif)
+static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
u8 dma_stat = 0;
@@ -556,7 +556,7 @@
* We allow the BM-DMA driver to only work on enabled interfaces.
-static void __init init_dma_svwks (ide_hwif_t *hwif, unsigned long dmabase)
+static void __devinit init_dma_svwks (ide_hwif_t *hwif, unsigned long dmabase)
struct pci_dev *dev = hwif->pci_dev;
@@ -568,7 +568,7 @@
ide_setup_dma(hwif, dmabase, 8);
-static int __init init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d)
+static int __devinit init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d)
return ide_setup_pci_device(dev, d);
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
--- a/drivers/pci/quirks.c 2005-04-01 15:38:06 -08:00
+++ b/drivers/pci/quirks.c 2005-04-01 15:38:06 -08:00
@@ -700,7 +700,7 @@
* Serverworks CSB5 IDE does not fully support native mode
-static void __init quirk_svwks_csb5ide(struct pci_dev *pdev)
+static void __devinit quirk_svwks_csb5ide(struct pci_dev *pdev)
pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
Alan will work this one w/ the Stratus guys when the hardware is here and
online. Then he can provide them a test kernel which includes this patch, or
Comment #44 is the fix and its also now in 2.6.12rc -ac kernel tree. Have pushed
it to Bartlomiej upstream.
I do need to review the other ide pci drivers for the same bug.
This is contingent on successful, prompt testing results from Stratus. Testing
based on a recent (ie at least U1 kernel) plus this fix. Merely referencing
upstream is insuficient.
Review of the IDE PCI layer shows lots of other drivers have the same bug, but
nobody is hitting it yet. The right fix for this is an ABI change but the easy
fix for RHEL4 is to turn them all into __devinit.
Thanks Alan, so is it OK to address individual drivers that need it immediately
(as in this case) in RHEL4 and then make the "right" change for RHEL5? Is this
patch still "safe" for inclusion in RHEL4U2?
Andrius, this patch is correct and safe for RHEL4 - it just needs to have a few
more instances of __init in the same file replaced by __devinit. A patch
should hit rhkernel-list soon.
Reassigning to on-site Stratus engineer. Note that I will be helping Kimball
with the process side of submitting patches.
Upstream maintainer agrees and will fix all the IDE misusers of __init in the
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.