public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards)
@ 2001-06-26 20:20 Gunther Mayer
  2001-06-27  7:29 ` Andre Hedrick
  0 siblings, 1 reply; 17+ messages in thread
From: Gunther Mayer @ 2001-06-26 20:20 UTC (permalink / raw)
  To: linux-kernel, dhinds; +Cc: andre

Hi,

this patch fixes the hard hang (no SYSRQ) on inserting
any PCMCIA ATA/IDE card (e.g. CompactFlash, Clik40 etc)
to a PCI-Cardbus bridge add-in card.

Thanks David for his valuable explanation about what happens:
ide-probe registers it's irq handler too late! After it
triggers the interrupt during the probe the (shared) irq
loops forever, effectively wedging the machine completely.

Regards, Gunther



--- linux245.orig/drivers/ide/ide-cs.c  Fri Feb  9 20:40:02 2001
+++ linux/drivers/ide/ide-cs.c  Tue Jun 26 21:22:19 2001
@@ -324,6 +324,9 @@
     if (link->io.NumPorts2)
        release_region(link->io.BasePort2, link->io.NumPorts2);
 
+    outb(0x02, ctl_base); // Set nIEN = disable device interrupts
+                         // else it hangs on PCI-Cardbus add-in cards, wedging irq
+
     /* retry registration in case device is still spinning up */
     for (i = 0; i < 10; i++) {
        hd = ide_register(io_base, ctl_base, link->irq.AssignedIRQ);
--- linux245.orig/drivers/ide/ide-probe.c       Sun Mar 18 18:25:02 2001
+++ linux/drivers/ide/ide-probe.c       Tue Jun 26 21:25:07 2001
@@ -685,6 +685,8 @@
 #else /* !CONFIG_IDEPCI_SHARE_IRQ */
                int sa = (hwif->chipset == ide_pci) ? SA_INTERRUPT|SA_SHIRQ : SA_INTERRUPT;
 #endif /* CONFIG_IDEPCI_SHARE_IRQ */
+
+               outb(0x00, hwif->io_ports[IDE_CONTROL_OFFSET]); // clear nIEN == enable irqs
                if (ide_request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwgroup)) {
                        if (!match)
                                kfree(hwgroup);

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards)V3
@ 2001-06-29 20:40 Andries.Brouwer
  2001-06-30  8:18 ` Andre Hedrick
  0 siblings, 1 reply; 17+ messages in thread
From: Andries.Brouwer @ 2001-06-29 20:40 UTC (permalink / raw)
  To: Gunther.Mayer, andre; +Cc: linux-kernel

    Andre Hedrick wrote:

    > That is a legacy bit from ATA-2 but it is one of those things you cannot
    > get rid of :-(

    in ANSI X3.279-1996, "AT Attachment Interface with Extensions (ATA-2)",
    Approved September 11, 1996 , control register bit 3-7 are reserved.

    However ANSI X3.221-1994, "AT Attachment Interface for Disk Drives",
    Approved May 12, 1994, bit3 is "1" and bits 4-7 are "x".
    No further explanation.

    How far back must we go, to get the sense ?

    >   struct {
    >           unsigned bit0           : 1;
    >           unsigned nIEN           : 1;    /* device INTRQ to host */
    >           unsigned SRST           : 1;    /* host soft reset bit */
    >           unsigned bit3           : 1;    /* ATA-2 thingy */
    >           unsigned reserved456    : 3;
    >           unsigned HOB            : 1;    /* 48-bit address ordering */
    >   } control_t;
    > 
    > once I add-in the real def of bit3 then I will not
    > need to look it up again.

bit3: 0: drive has 1-8 heads
      1: drive has more than 8 heads

(From old MFM/RLL times. In ATA-1 bit3 is set to 1.
See also
	http://www.win.tue.nl/~aeb/linux/hdtypes/hdtypes-2.html
.)

Andries

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

end of thread, other threads:[~2001-06-30  8:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-26 20:20 Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards) Gunther Mayer
2001-06-27  7:29 ` Andre Hedrick
2001-06-27 11:25   ` Alan Cox
2001-06-27 16:54     ` Andre Hedrick
2001-06-27 17:21       ` Alan Cox
2001-06-27 20:01         ` Andre Hedrick
2001-06-27 20:51           ` Gunther Mayer
2001-06-27 21:55             ` Andre Hedrick
2001-06-28 17:21               ` Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards) V3 Gunther Mayer
2001-06-29  5:38                 ` Andre Hedrick
2001-06-29 18:09                   ` Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards)V3 Gunther Mayer
2001-06-30  8:14                     ` Andre Hedrick
2001-06-27 16:03   ` Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards) David Hinds
2001-06-27 16:56     ` Andre Hedrick
2001-06-27 16:23   ` Gunther Mayer
  -- strict thread matches above, loose matches on Subject: below --
2001-06-29 20:40 Patch(2.4.5): Fix PCMCIA ATA/IDE freeze (w/ PCI add-in cards)V3 Andries.Brouwer
2001-06-30  8:18 ` Andre Hedrick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox