All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bug fix to restore access to low order LBA
@ 2004-07-22 23:30 Brett Russ
  0 siblings, 0 replies; only message in thread
From: Brett Russ @ 2004-07-22 23:30 UTC (permalink / raw)
  To: linux-ide; +Cc: B.Zolnierkiewicz

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

I discovered this after running a custom kernel with support for ATA 
read verify command, when I encountered sector errors and saw them 
reported in syslog and on an ATA analyzer but when I tried to read the 
LBA registers I got zero... problem was this one liner, which applies to 
2.6.8-rc2 as well as 2.6.7, and I've also included a 2.4.26 version.

Thanks,
BR

[-- Attachment #2: 2.4.26-ide-restore-low.diff --]
[-- Type: text/plain, Size: 484 bytes --]

--- linux-2.4.26/drivers/ide/ide.c	2004-02-18 08:36:31.000000000 -0500
+++ linux-2.4.26-ide-restore-low/drivers/ide/ide.c	2004-07-22 19:17:23.000000000 -0400
@@ -409,6 +409,9 @@
 					u32 low = read_24(drive);
 					hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
 					high = read_24(drive);
+					/* Restore access to low order LBA */
+					OUT_BYTE(drive->ctl&0x7F,
+						 IDE_CONTROL_REG);
 
 					sectors = ((u64)high << 24) | low;
 					printk(", LBAsect=%llu, high=%d, low=%d",

[-- Attachment #3: 2.6.7-ide-restore-low.diff --]
[-- Type: text/plain, Size: 495 bytes --]

--- linux-2.6.7/drivers/ide/ide.c	2004-06-16 01:19:03.000000000 -0400
+++ linux-2.6.7-ide-restore-low/drivers/ide/ide.c	2004-07-22 19:20:59.000000000 -0400
@@ -409,6 +409,9 @@
 					u32 low = ide_read_24(drive);
 					hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
 					high = ide_read_24(drive);
+					/* Restore access to low order LBA */
+					hwif->OUTB(drive->ctl&0x7F, 
+						   IDE_CONTROL_REG);
 
 					sectors = ((u64)high << 24) | low;
 					printk(", LBAsect=%llu, high=%d, low=%d",

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-22 23:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-22 23:30 [PATCH] bug fix to restore access to low order LBA Brett Russ

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.