From: David Meybohm <dmeybohm@bellsouth.net>
To: linux-kernel@vger.kernel.org
Cc: Santiago Garcia Mantinan <manty@manty.net>,
Ted Kaminski <mouschi@wi.rr.com>,
David Meybohm <dmeybohm@bellsouth.net>
Subject: [PATCH] Fix SB16 PnP IDE controller in 2.4
Date: Fri, 8 Nov 2002 06:10:20 -0500 [thread overview]
Message-ID: <20021108061020.A14168@localhost> (raw)
This patch fixes the SB16 PnP IDE controller in 2.4 and is
against 2.4.20-rc1. It changes the IDE code to use "active"
status probing on the SB16 instead of passive. An
alternative workaround is disabling CONFIG_IDEPCI_SHARE_IRQ.
I restart the search for controllers in pnpide_init() (the
"dev = NULL" part) in order to avoid possibly skipping a
second or third controller due to mismatch between device
list order and IDE PnP devices order. Is this correct?
Two additional people, Santiago Mantinan and Ted Kaminski,
have tested versions of this patch. They both said it
worked for them. Santiago tested it on a box with an
additional, different ISAPnP controller and he said it
worked. This version of the patch is identical to the patch
that Santiago tested except that I removed some
non-essential changes to the pnp_dev_t struct.
Since this is the first kernel patch I've made for general
consumption, I was wondering if there were any problems with
it. So here goes..
Thanks,
David
drivers/ide/ide-pnp.c | 28 +++++++++++++++++++++++++++-
drivers/ide/ide.c | 3 ++-
include/linux/ide.h | 1 +
3 files changed, 30 insertions, 2 deletions
--- v2.4.20-rc1/drivers/ide/ide.c~sb16pnpide Fri Nov 8 04:39:26 2002
+++ v2.4.20-rc1-hipnod/drivers/ide/ide.c Fri Nov 8 04:39:26 2002
@@ -543,7 +543,7 @@ int drive_is_ready (ide_drive_t *drive)
* an interrupt with another pci card/device. We make no assumptions
* about possible isa-pnp and pci-pnp issues yet.
*/
- if (IDE_CONTROL_REG)
+ if (IDE_CONTROL_REG && !HWIF(drive)->hw.no_passive)
stat = GET_ALTSTAT();
else
#endif /* CONFIG_IDEPCI_SHARE_IRQ */
@@ -2419,6 +2419,7 @@ void ide_setup_ports ( hw_regs_t *hw,
}
hw->irq = irq;
hw->dma = NO_DMA;
+ hw->no_passive = 0;
hw->ack_intr = ack_intr;
}
--- v2.4.20-rc1/drivers/ide/ide-pnp.c~sb16pnpide Fri Nov 8 04:39:26 2002
+++ v2.4.20-rc1-hipnod/drivers/ide/ide-pnp.c Fri Nov 8 04:39:26 2002
@@ -54,7 +54,8 @@ struct pnp_dev_t {
};
/* Generic initialisation function for ISA PnP IDE interface */
-static int __init pnpide_generic_init(struct pci_dev *dev, int enable)
+static int __init pnpide_do_generic_init(struct pci_dev *dev, int enable,
+ int no_passive)
{
hw_regs_t hw;
int index;
@@ -69,6 +70,8 @@ static int __init pnpide_generic_init(st
generic_ide_offsets, (ide_ioreg_t) DEV_IO(dev, 1),
0, NULL, DEV_IRQ(dev, 0));
+ hw.no_passive = no_passive;
+
index = ide_register_hw(&hw, NULL);
if (index != -1) {
@@ -79,8 +82,30 @@ static int __init pnpide_generic_init(st
return 1;
}
+static int __init pnpide_generic_init(struct pci_dev *dev, int enable)
+{
+ return pnpide_do_generic_init(dev, enable, 0);
+}
+
+/* Initialisation function for SB16 ISA PnP IDE interface */
+static int __init pnpide_sb16_init(struct pci_dev *dev, int enable)
+{
+ int no_passive;
+
+ /*
+ * Disable passive status testing on the SB16 PnP controller.
+ */
+ no_passive = 1;
+
+ return pnpide_do_generic_init(dev, enable, no_passive);
+}
+
/* Add your devices here :)) */
struct pnp_dev_t idepnp_devices[] __initdata = {
+ /* SB16 PnP IDE controller */
+ { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
+ ISAPNP_VENDOR('C', 'T', 'L'), ISAPNP_DEVICE(0x2011),
+ pnpide_sb16_init },
/* Generic ESDI/IDE/ATA compatible hard disk controller */
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_DEVICE(0x0600),
@@ -123,6 +148,7 @@ void __init pnpide_init(int enable)
}
#endif
for (dev_type = idepnp_devices; dev_type->vendor; dev_type++) {
+ dev = NULL;
while ((dev = isapnp_find_dev(NULL, dev_type->vendor,
dev_type->device, dev))) {
--- v2.4.20-rc1/include/linux/ide.h~sb16pnpide Fri Nov 8 04:39:26 2002
+++ v2.4.20-rc1-hipnod/include/linux/ide.h Fri Nov 8 04:39:26 2002
@@ -277,6 +277,7 @@ typedef struct hw_regs_s {
ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
int irq; /* our irq number */
int dma; /* our dma entry */
+ int no_passive; /* no passive status tests */
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
void *priv; /* interface specific data */
hwif_chipset_t chipset;
[patch ends]
next reply other threads:[~2002-11-08 11:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-08 11:10 David Meybohm [this message]
2002-11-12 21:01 ` [PATCH] Fix SB16 PnP IDE controller in 2.4 Santiago Garcia Mantinan
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=20021108061020.A14168@localhost \
--to=dmeybohm@bellsouth.net \
--cc=linux-kernel@vger.kernel.org \
--cc=manty@manty.net \
--cc=mouschi@wi.rr.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox