From linux-kernel@vger.kernel.org Sun Dec 28 14:37:12 2003 Date: Sun, 28 Dec 2003 20:09:56 +0000 From: Linux Kernel Mailing List To: bk-commits-24@vger.kernel.org Subject: Daniel Lux: Fix IDE busy-wait race ChangeSet 1.1344, 2003/12/28 18:09:56-02:00, marcelo@logos.cnet Daniel Lux: Fix IDE busy-wait race # This patch includes the following deltas: # ChangeSet 1.1343 -> 1.1344 # drivers/ide/ide-iops.c 1.7 -> 1.8 # ide-iops.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff -Nru a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c --- a/drivers/ide/ide-iops.c Sun Dec 28 13:01:41 2003 +++ b/drivers/ide/ide-iops.c Sun Dec 28 13:01:41 2003 @@ -664,11 +664,19 @@ if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { local_irq_set(flags); timeout += jiffies; - while ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { + stat = hwif->INB(IDE_STATUS_REG); + while (stat & BUSY_STAT) { if (time_after(jiffies, timeout)) { - local_irq_restore(flags); - *startstop = DRIVER(drive)->error(drive, "status timeout", stat); - return 1; + /* + * do one more status read in case we were interrupted between last + * stat = hwif->INB(IDE_STATUS_REG) and time_after(jiffies, timeout) + * in wich case the timeout might have been shorter than specified. + */ + if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { + local_irq_restore(flags); + *startstop = DRIVER(drive)->error(drive, "status timeout", stat); + return 1; + } } } local_irq_restore(flags); - To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From linux-kernel@vger.kernel.org Sun Dec 28 14:37:46 2003 Date: Sun, 28 Dec 2003 20:14:56 +0000 From: Linux Kernel Mailing List To: bk-commits-24@vger.kernel.org Subject: Fix IDE busywait merge ChangeSet 1.1345, 2003/12/28 18:14:56-02:00, marcelo@logos.cnet Fix IDE busywait merge # This patch includes the following deltas: # ChangeSet 1.1344 -> 1.1345 # drivers/ide/ide-iops.c 1.8 -> 1.9 # ide-iops.c | 2 ++ 1 files changed, 2 insertions(+) diff -Nru a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c --- a/drivers/ide/ide-iops.c Sun Dec 28 13:01:43 2003 +++ b/drivers/ide/ide-iops.c Sun Dec 28 13:01:43 2003 @@ -678,6 +678,8 @@ return 1; } } + else + stat = hwif->INB(IDE_STATUS_REG); } local_irq_restore(flags); } - To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html