linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] libata: implement BROKEN_HPA horkage and apply it to HDS724040KLSA80
@ 2007-08-08 16:50 Quel Qun
  2007-08-08 16:54 ` Luiz Fernando N. Capitulino
  0 siblings, 1 reply; 21+ messages in thread
From: Quel Qun @ 2007-08-08 16:50 UTC (permalink / raw)
  To: Tejun Heo, Luiz Fernando N. Capitulino
  Cc: Alan Cox, Jeff Garzik, linux-ide, stable

 -------------- Original message ----------------------
From: Tejun Heo <htejun@gmail.com>
> Luiz Fernando N. Capitulino wrote:
> > Em Wed, 08 Aug 2007 11:21:08 +0900
> > Tejun Heo <htejun@gmail.com> escreveu:
> > 
> > | Alan Cox wrote:
> > | >>> I'd rather know what is going on here. A drive can legitimately
> > | >>> support LBA48 and HPA and refuse READ_NATIVE_MAX_EXT.
> > | >> READ_NATIVE_MAX_EXT is mandatory if HPA && LBA48, no
> > | > 
> > | > Ok the report in that thread is different. The offending Maxtor simply
> > | > aborts the read_native_max_ext
> > | 
> > | I'll resend sans ata_id_has_hpa() change.  Does that sound okay?  I
> > | don't really think we can do anything other than blacklisting it.
> > 
> >  Does that make your patch invalid or is it still ok?
> 
> You controller being ICH ahci, I don't think the chance of the
> controller messing things up is pretty slim but, just in case, do you
> have another SATA controller to cross check?  If not, can you put the
> controller into IDE mode so that ata_piix can drive it and test whether
> the problem persists?
>
Hi, 
Unfortunately, I do not have any machine with a different controller. Whichever 
I pick in the BIOS between ATA and AHCI, it seems that the drive is always 
handled by the ahci module, and the boot process goes the exact same way.
Is there a way to force the IDE mode?
--
kk1


^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCH] libata: implement BROKEN_HPA horkage and apply it to HDS724040KLSA80
@ 2007-08-07  5:42 Tejun Heo
  2007-08-07 14:51 ` Luiz Fernando N. Capitulino
  2007-08-07 15:25 ` Alan Cox
  0 siblings, 2 replies; 21+ messages in thread
From: Tejun Heo @ 2007-08-07  5:42 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide, stable, kelk1, lcapitulino

HDS724040KLSA80 reports that it supports HPA && LBA48 but craps itself
on READ_NATIVE_MAX_EXT.  Implement BROKEN_HPA horkage and apply it to
the drive.  If the horkage is set, all HPA operations are skipped.

While at it, make HPA test a bit more reliable by also checking
ata_id_has_hpa().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Quel Qun <kelk1@comcast.net>
Cc: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
---
The drive worked fine before HPA support was added and thus this is a
regression fix.  Please consider for -stable.

Thanks.

 drivers/ata/libata-core.c |    4 +++-
 include/linux/libata.h    |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 60e78be..7158a06 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1911,7 +1911,8 @@ int ata_dev_configure(struct ata_device *dev)
 					dev->flags |= ATA_DFLAG_FLUSH_EXT;
 			}
 
-			if (ata_id_hpa_enabled(dev->id))
+			if (!(dev->horkage & ATA_HORKAGE_BROKEN_HPA) &&
+			    ata_id_has_hpa(id) && ata_id_hpa_enabled(dev->id))
 				dev->n_sectors = ata_hpa_resize(dev);
 
 			/* config NCQ */
@@ -3789,6 +3790,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 	{ "FUJITSU MHV2080BH",	"00840028",	ATA_HORKAGE_NONCQ, },
 	{ "ST9160821AS",	"3.CLF",	ATA_HORKAGE_NONCQ, },
 	{ "SAMSUNG HD401LJ",	"ZZ100-15",	ATA_HORKAGE_NONCQ, },
+	{ "HDS724040KLSA80",	"KFAOA20N",	ATA_HORKAGE_BROKEN_HPA, },
 
 	/* Devices with NCQ limits */
 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 41978a5..a67bb90 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -303,6 +303,7 @@ enum {
 	ATA_HORKAGE_NODMA	= (1 << 1),	/* DMA problems */
 	ATA_HORKAGE_NONCQ	= (1 << 2),	/* Don't use NCQ */
 	ATA_HORKAGE_MAX_SEC_128	= (1 << 3),	/* Limit max sects to 128 */
+	ATA_HORKAGE_BROKEN_HPA	= (1 << 4),	/* Broken HPA */
 };
 
 enum hsm_task_states {

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

end of thread, other threads:[~2007-08-08 16:54 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-08 16:50 [PATCH] libata: implement BROKEN_HPA horkage and apply it to HDS724040KLSA80 Quel Qun
2007-08-08 16:54 ` Luiz Fernando N. Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2007-08-07  5:42 Tejun Heo
2007-08-07 14:51 ` Luiz Fernando N. Capitulino
2007-08-07 15:00   ` Tejun Heo
2007-08-07 15:04     ` Luiz Fernando N. Capitulino
2007-08-07 15:25 ` Alan Cox
2007-08-07 15:36   ` Tejun Heo
2007-08-07 15:47     ` Jeff Garzik
2007-08-07 16:57       ` Alan Cox
2007-08-07 16:52         ` Jeff Garzik
2007-08-07 16:53     ` Alan Cox
2007-08-07 16:53       ` Tejun Heo
2007-08-07 16:58     ` Alan Cox
2007-08-08  2:21       ` Tejun Heo
2007-08-08  9:35         ` Alan Cox
2007-08-08 13:23         ` Luiz Fernando N. Capitulino
2007-08-08 13:40           ` Tejun Heo
2007-08-07 18:46     ` Chuck Ebbert
2007-08-07 19:41       ` Alan Cox
2007-08-07 22:12     ` Alan Cox

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).