[Fwd: Linux IDE driver ide.c version 6.20 (possible) bug report]

Rob van Riel (robvr@bigfoot.com)
Wed, 15 Dec 1999 20:24:15 +0100


This is a multi-part message in MIME format.

--------------47C70C53AB7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The address I originally sent this to seems to have died. I hope someone
else out there knows what to do with this.

Rob

--------------47C70C53AB7
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <38577D54.2E5@bigfoot.com>
Date: Wed, 15 Dec 1999 12:36:52 +0100
From: Rob van Riel <robvr@bigfoot.com>
Reply-To: robvr@bigfoot.com
X-Mailer: Mozilla 3.04Gold (Win95; I)
MIME-Version: 1.0
To: hedrick@astro.dyer.vanderbilt.edu
Subject: Linux IDE driver ide.c version 6.20 (possible) bug report
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I recently bought the SuSE 6.3 distribution of LINUX, which contained
the file mentioned. When I tried to build a new kernel with it, I was
ambushed by a bunch of errors. To my shame, I managed to lose the error
log, but as I have the arrogance to consider myself a reasonable C
programmer, I printed the source file and dug in at the point where the
errors were encountered (I did write that down).
Below are the identifying lines of the source code, and the offending
part:

* linux/drivers/block/ide.c Version 6.20 July 10, 1999
*

(this is lines 1515 through 1562)

void ide_intr (int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long flags;
ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id;
ide_hwif_t *hwif;
ide_drive_t *drive;
ide_handler_t *handler;
ide_startstop_t startstop;

spin_lock_irqsave(&io_request_lock, flags);
hwif = hwgroup->hwif;

if (!ide_ack_intr(hwif)) {
spin_unlock_irqrestore(&io_request_lock, flags);
return;
}

if ((handler = hwgroup->handler) == NULL || hwgroup->poll_timeout != 0)
{
/*
* Not expecting an interrupt from this drive.
* That means this could be:
* (1) an interrupt from another PCI device
* sharing the same PCI INT# as us.
* or (2) a drive just entered sleep or standby mode,
* and is interrupting to let us know.
* or (3) a spurious interrupt of unknown origin.
*
* For PCI, we cannot tell the difference,
* so in that case we just ignore it and hope it goes away.
*/
#ifdef CONFIG_BLK_DEV_IDEPCI
if (IDE_PCI_DEVID_EQ(hwif->pci_devid, IDE_PCI_DEVID_NULL))
#endif /* CONFIG_BLK_DEV_IDEPCI */
{
/*
* Probably not a shared PCI interrupt,
* so we can safely try to do something about it:
*/
unexpected_intr(irq, hwgroup);
} else {
/*
* Whack the status register, just in case we have a leftover pending
IRQ.
*/
(void)IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]);
}
spin_unlock_irqrestore(&io_request_lock, flags);
return;
}

It seems to me the problem is in the "if" statement which is bracketed
by the "#ifdef....#endif" pair. If CONFIG_BLK_DEV_IDEPCI is not defined,
the corresponding "else" clause is orphaned, and the compiler gets
confused. At a guess I would say this can be solved by placing the
entire "else" block between a similar "#ifdef....#endif" pair. I have no
idea if this generates the desired functionality though.

Hope this helps.

Rob

--------------47C70C53AB7--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/