All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH] libata and bogus LBA48 drives
@ 2007-10-29 20:21 Geert Uytterhoeven
  2007-10-29 20:28 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2007-10-29 20:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Ben Collins, Olivier Demarto, linux-ide, Geert Uytterhoeven

	Hi Jeff,

A colleague noticed recent versions of Ubuntu no longer detect his 80 GB
ST380020ACE drive. This drive is special in that it advertises LBA48 support,
but has the lba_capacity_2 field set to zero (cfr.
http://lkml.org/lkml/2004/3/30/163).

Upon closer look, libata indeed doesn't seem to handle this case yet.
Below is an (untested) fix.

---
Subject: libata: Ignore bogus lba48 drives

Some drives (e.g. the 80 GB ST380020ACE) advertise they support LBA48, but have
lba_capacity_2 field set to zero. This causes the drive not being detected by
the libata driver.

Add a check for this to ata_id_has_lba48(), cfr. what is done in
idedisk_supports_lba48().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
NOTE: Untested due to the lack of hardware

 include/linux/ata.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -402,6 +402,8 @@ static inline int ata_id_has_lba48(const
 {
 	if ((id[83] & 0xC000) != 0x4000)
 		return 0;
+	if (!ata_id_u64(id, 100))
+		return 0;
 	return id[83] & (1 << 10);
 }
 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

end of thread, other threads:[~2007-10-29 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 20:21 [RFC/PATCH] libata and bogus LBA48 drives Geert Uytterhoeven
2007-10-29 20:28 ` Jeff Garzik
2007-10-29 21:14   ` Geert Uytterhoeven

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.