* [PATCH 1/2] sgiioc4: sgiioc4_read_status drive busy check fix
@ 2008-09-28 19:48 Sergei Shtylylov
2008-10-03 16:49 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylylov @ 2008-09-28 19:48 UTC (permalink / raw)
To: bzolnier; +Cc: linux-ide, jeremy
Fix the drive non-busy criterion used by sgiioc4_read_status(): neither of the
bits it expects to be set guarantees that the drive is not busy (and might be
interrupting), only the BSY bit itself being zero gurantees that.
While at it, use ATA_BUSY instead of hardcoded value everywhere...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
The patch is against the recent Linus' tree.
drivers/ide/pci/sgiioc4.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/ide/pci/sgiioc4.c
===================================================================
--- linux-2.6.orig/drivers/ide/pci/sgiioc4.c
+++ linux-2.6/drivers/ide/pci/sgiioc4.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003-2006 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (C) 2008 MontaVista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License
@@ -151,7 +152,7 @@ sgiioc4_clearirq(ide_drive_t * drive)
int count = 0;
stat = sgiioc4_read_status(hwif);
- while ((stat & 0x80) && (count++ < 100)) {
+ while ((stat & ATA_BUSY) && (count++ < 100)) {
udelay(1);
stat = sgiioc4_read_status(hwif);
}
@@ -311,7 +312,7 @@ static u8 sgiioc4_read_status(ide_hwif_t
u8 reg = (u8) readb((void __iomem *) port);
if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */
- if (reg & 0x51) { /* Not busy...check for interrupt */
+ if (!(reg & ATA_BUSY)) { /* Not busy... check for interrupt */
unsigned long other_ir = port - 0x110;
unsigned int intr_reg = (u32) readl((void __iomem *) other_ir);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] sgiioc4: sgiioc4_read_status drive busy check fix
2008-09-28 19:48 [PATCH 1/2] sgiioc4: sgiioc4_read_status drive busy check fix Sergei Shtylylov
@ 2008-10-03 16:49 ` Bartlomiej Zolnierkiewicz
2008-11-20 9:43 ` Jeremy Higdon
0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-10-03 16:49 UTC (permalink / raw)
To: Sergei Shtylylov; +Cc: linux-ide, jeremy
On Sunday 28 September 2008, Sergei Shtylylov wrote:
> Fix the drive non-busy criterion used by sgiioc4_read_status(): neither of the
> bits it expects to be set guarantees that the drive is not busy (and might be
> interrupting), only the BSY bit itself being zero gurantees that.
> While at it, use ATA_BUSY instead of hardcoded value everywhere...
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
applied patches #1-2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] sgiioc4: sgiioc4_read_status drive busy check fix
2008-10-03 16:49 ` Bartlomiej Zolnierkiewicz
@ 2008-11-20 9:43 ` Jeremy Higdon
0 siblings, 0 replies; 3+ messages in thread
From: Jeremy Higdon @ 2008-11-20 9:43 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Sergei Shtylylov, linux-ide
On Fri, Oct 03, 2008 at 06:49:10PM +0200, Bartlomiej Zolnierkiewicz wrote:
> On Sunday 28 September 2008, Sergei Shtylylov wrote:
> > Fix the drive non-busy criterion used by sgiioc4_read_status(): neither of the
> > bits it expects to be set guarantees that the drive is not busy (and might be
> > interrupting), only the BSY bit itself being zero gurantees that.
> > While at it, use ATA_BUSY instead of hardcoded value everywhere...
> >
> > Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> applied patches #1-2
I finally got around to trying these patches, and they work fine. Thanks
for the cleanups, Sergei!
Acked-by: Jeremy Higdon <jeremy@sgi.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-20 9:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-28 19:48 [PATCH 1/2] sgiioc4: sgiioc4_read_status drive busy check fix Sergei Shtylylov
2008-10-03 16:49 ` Bartlomiej Zolnierkiewicz
2008-11-20 9:43 ` Jeremy Higdon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).