linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: HPA support
@ 2007-04-10 23:23 Alan Cox
  2007-04-10 23:36 ` Jeff Garzik
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Alan Cox @ 2007-04-10 23:23 UTC (permalink / raw)
  To: jgarzik, linux-ide

Signed-off-by: Alan Cox <alan@redhat.com>

Add support for ignoring the BIOS HPA result (off by default) and setting
the disk to the full available size unless already frozen.

Tested with various platforms/disks and confirmed to work with the
Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
readback that Tejun fixed).

For normal users this brings us, I believe, to feature parity with old IDE
(and of course more featured in some areas too).

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 735f0b0..e4fc33e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -89,6 +89,10 @@ int libata_fua = 0;
 module_param_named(fua, libata_fua, int, 0444);
 MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
 
+static int ata_ignore_hpa = 0;
+module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644);
+MODULE_PARM_DESC(ignore_hpa, "Ignore HPA (0=keep BIOS setting 1=ignore it)");
+
 static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
 module_param(ata_probe_timeout, int, 0444);
 MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
@@ -808,6 +812,202 @@ void ata_id_c_string(const u16 *id, unsi
 	*p = '\0';
 }
 
+static u64 ata_tf_to_lba48(struct ata_taskfile *tf)
+{
+	u64 sectors = 0;
+
+	sectors |= ((u64)(tf->hob_lbah & 0xff)) << 40;
+	sectors |= ((u64)(tf->hob_lbam & 0xff)) << 32;
+	sectors |= (tf->hob_lbal & 0xff) << 24;
+	sectors |= (tf->lbah & 0xff) << 16;
+	sectors |= (tf->lbam & 0xff) << 8;
+	sectors |= (tf->lbal & 0xff);
+
+	return ++sectors;
+}
+
+static u64 ata_tf_to_lba(struct ata_taskfile *tf)
+{
+	u64 sectors = 0;
+
+	sectors |= (tf->device & 0x0f) << 24;
+	sectors |= (tf->lbah & 0xff) << 16;
+	sectors |= (tf->lbam & 0xff) << 8;
+	sectors |= (tf->lbal & 0xff);
+
+	return ++sectors;
+}
+
+/**
+ *	ata_read_native_max_address_ext	-	LBA48 native max query
+ *	@dev: Device to query
+ *
+ *	Perform an LBA48 size query upon the device in question. Return the
+ *	actual LBA48 size or zero if the command fails.
+ */
+
+static u64 ata_read_native_max_address_ext(struct ata_device *dev)
+{
+	unsigned int err;
+	struct ata_taskfile tf;
+
+	ata_tf_init(dev, &tf);
+
+	tf.command = ATA_CMD_READ_NATIVE_MAX_EXT;
+	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 | ATA_TFLAG_ISADDR;
+	tf.protocol |= ATA_PROT_NODATA;
+	tf.device |= 0x40;
+
+	err = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
+	if (err)
+		return 0;
+
+	return ata_tf_to_lba48(&tf);
+}
+
+/**
+ *	ata_read_native_max_address	-	LBA28 native max query
+ *	@dev: Device to query
+ *
+ *	Performa an LBA28 size query upon the device in question. Return the
+ *	actual LBA28 size or zero if the command fails.
+ */
+
+static u64 ata_read_native_max_address(struct ata_device *dev)
+{
+	unsigned int err;
+	struct ata_taskfile tf;
+
+	ata_tf_init(dev, &tf);
+
+	tf.command = ATA_CMD_READ_NATIVE_MAX;
+	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR;
+	tf.protocol |= ATA_PROT_NODATA;
+	tf.device |= 0x40;
+
+	err = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
+	if (err)
+		return 0;
+
+	return ata_tf_to_lba(&tf);
+}
+
+/**
+ *	ata_set_native_max_address_ext	-	LBA48 native max set
+ *	@dev: Device to query
+ *
+ *	Perform an LBA48 size set max upon the device in question. Return the
+ *	actual LBA48 size or zero if the command fails.
+ */
+
+static u64 ata_set_native_max_address_ext(struct ata_device *dev, u64 new_sectors)
+{
+	unsigned int err;
+	struct ata_taskfile tf;
+
+	new_sectors--;
+
+	ata_tf_init(dev, &tf);
+
+	tf.command = ATA_CMD_SET_MAX_EXT;
+	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48 | ATA_TFLAG_ISADDR;
+	tf.protocol |= ATA_PROT_NODATA;
+	tf.device |= 0x40;
+
+	tf.lbal = (new_sectors >> 0) & 0xff;
+	tf.lbam = (new_sectors >> 8) & 0xff;
+	tf.lbah = (new_sectors >> 16) & 0xff;
+
+	tf.hob_lbal = (new_sectors >> 24) & 0xff;
+	tf.hob_lbam = (new_sectors >> 32) & 0xff;
+	tf.hob_lbah = (new_sectors >> 40) & 0xff;
+
+	err = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
+	if (err)
+		return 0;
+
+	return ata_tf_to_lba48(&tf);
+}
+
+/**
+ *	ata_set_native_max_address	-	LBA28 native max set
+ *	@dev: Device to query
+ *
+ *	Perform an LBA28 size set max upon the device in question. Return the
+ *	actual LBA28 size or zero if the command fails.
+ */
+
+static u64 ata_set_native_max_address(struct ata_device *dev, u64 new_sectors)
+{
+	unsigned int err;
+	struct ata_taskfile tf;
+
+	new_sectors--;
+
+	ata_tf_init(dev, &tf);
+
+	tf.command = ATA_CMD_SET_MAX;
+	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR;
+	tf.protocol |= ATA_PROT_NODATA;
+
+	tf.lbal = (new_sectors >> 0) & 0xff;
+	tf.lbam = (new_sectors >> 8) & 0xff;
+	tf.lbah = (new_sectors >> 16) & 0xff;
+	tf.device |= ((new_sectors >> 24) & 0x0f) | 0x40;
+
+	err = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
+	if (err)
+		return 0;
+
+	return ata_tf_to_lba(&tf);
+}
+
+/**
+ *	ata_hpa_resize		-	Resize a device with an HPA set
+ *	@dev: Device to resize
+ *
+ *	Read the size of an LBA28 or LBA48 disk with HPA features and resize
+ *	it if required to the full size of the media. The caller must check
+ *	the drive has the HPA feature set enabled.
+ */
+
+static u64 ata_hpa_resize(struct ata_device *dev)
+{
+	u64 sectors = dev->n_sectors;
+	u64 hpa_sectors;
+	
+	if (ata_id_has_lba48(dev->id))
+		hpa_sectors = ata_read_native_max_address_ext(dev);
+	else
+		hpa_sectors = ata_read_native_max_address(dev);
+
+	/* if no hpa, both should be equal */
+	ata_dev_printk(dev, KERN_INFO, "%s 1: sectors = %lld, hpa_sectors = %lld\n",
+		__FUNCTION__, sectors, hpa_sectors);
+
+	if (hpa_sectors > sectors) {
+		ata_dev_printk(dev, KERN_INFO,
+			"Host Protected Area detected:\n"
+			"\tcurrent size: %lld sectors\n"
+			"\tnative size: %lld sectors\n",
+			sectors, hpa_sectors);
+
+		if (ata_ignore_hpa) {
+			if (ata_id_has_lba48(dev->id))
+				hpa_sectors = ata_set_native_max_address_ext(dev, hpa_sectors);
+			else
+				hpa_sectors = ata_set_native_max_address(dev, hpa_sectors);
+
+			if (hpa_sectors) {
+				ata_dev_printk(dev, KERN_INFO,
+					"native size increased to %lld sectors\n", hpa_sectors);
+				return hpa_sectors;
+			}
+		}
+	}
+	return sectors;
+}
+
 static u64 ata_id_n_sectors(const u16 *id)
 {
 	if (ata_id_has_lba(id)) {
@@ -1658,6 +1858,7 @@ int ata_dev_configure(struct ata_device 
 			snprintf(revbuf, 7, "ATA-%d",  ata_id_major_version(id));
 
 		dev->n_sectors = ata_id_n_sectors(id);
+		dev->n_sectors_boot = dev->n_sectors;
 
 		/* SCSI only uses 4-char revisions, dump full 8 chars from ATA */
 		ata_id_c_string(dev->id, fwrevbuf, ATA_ID_FW_REV,
@@ -1684,6 +1885,9 @@ int ata_dev_configure(struct ata_device 
 					dev->flags |= ATA_DFLAG_FLUSH_EXT;
 			}
 
+			if (ata_id_hpa_enabled(dev->id))
+				dev->n_sectors = ata_hpa_resize(dev);
+
 			/* config NCQ */
 			ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc));
 
@@ -3341,6 +3545,11 @@ static int ata_dev_same_device(struct at
 			       "%llu != %llu\n",
 			       (unsigned long long)dev->n_sectors,
 			       (unsigned long long)new_n_sectors);
+		/* Are we the boot time size - if so we appear to be the
+		   same disk at this point and our HPA got reapplied */
+		if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors 
+		    && ata_id_hpa_enabled(new_id))
+			return 1;
 		return 0;
 	}
 
diff --git a/include/linux/ata.h b/include/linux/ata.h
index ffb6cdc..f4dc8df 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -159,6 +159,8 @@ enum {
 	ATA_CMD_INIT_DEV_PARAMS	= 0x91,
 	ATA_CMD_READ_NATIVE_MAX	= 0xF8,
 	ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
+	ATA_CMD_SET_MAX		= 0xF9,
+	ATA_CMD_SET_MAX_EXT	= 0x37,
 	ATA_CMD_READ_LOG_EXT	= 0x2f,
 
 	/* READ_LOG_EXT pages */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 12237d4..b29850b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -473,6 +473,7 @@ struct ata_device {
 	struct scsi_device	*sdev;		/* attached SCSI device */
 	/* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
 	u64			n_sectors;	/* size of device, if ATA */
+	u64			n_sectors_boot;	/* size of ATA device at startup */
 	unsigned int		class;		/* ATA_DEV_xxx */
 	u16			id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
 	u8			pio_mode;

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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
@ 2007-04-10 23:36 ` Jeff Garzik
  2007-04-11  0:15   ` Alan Cox
  2007-04-10 23:43 ` Kyle McMartin
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 20+ messages in thread
From: Jeff Garzik @ 2007-04-10 23:36 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-ide

Alan Cox wrote:
> Signed-off-by: Alan Cox <alan@redhat.com>
> 
> Add support for ignoring the BIOS HPA result (off by default) and setting
> the disk to the full available size unless already frozen.
> 
> Tested with various platforms/disks and confirmed to work with the
> Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
> readback that Tejun fixed).
> 
> For normal users this brings us, I believe, to feature parity with old IDE
> (and of course more featured in some areas too).

Any additional credit for this patch, or was it all you?

	Jeff




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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
  2007-04-10 23:36 ` Jeff Garzik
@ 2007-04-10 23:43 ` Kyle McMartin
  2007-04-11 16:38 ` Kyle McMartin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 20+ messages in thread
From: Kyle McMartin @ 2007-04-10 23:43 UTC (permalink / raw)
  To: Alan Cox; +Cc: jgarzik, linux-ide

On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
> Add support for ignoring the BIOS HPA result (off by default) and setting
> the disk to the full available size unless already frozen.
> 
> Tested with various platforms/disks and confirmed to work with the
> Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
> readback that Tejun fixed).
> 
> For normal users this brings us, I believe, to feature parity with old IDE
> (and of course more featured in some areas too).
> 

Awesome! Thanks for sheparding this.

Acked-by: Kyle McMartin <kyle@canonical.com>

Cheers,
	Kyle

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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:36 ` Jeff Garzik
@ 2007-04-11  0:15   ` Alan Cox
  0 siblings, 0 replies; 20+ messages in thread
From: Alan Cox @ 2007-04-11  0:15 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide

On Tue, 10 Apr 2007 19:36:18 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:

> Alan Cox wrote:
> > Signed-off-by: Alan Cox <alan@redhat.com>
> > 
> > Add support for ignoring the BIOS HPA result (off by default) and setting
> > the disk to the full available size unless already frozen.
> > 
> > Tested with various platforms/disks and confirmed to work with the
> > Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
> > readback that Tejun fixed).
> > 
> > For normal users this brings us, I believe, to feature parity with old IDE
> > (and of course more featured in some areas too).
> 
> Any additional credit for this patch, or was it all you?

Good point, where did the other Signoffs go.

Original patch: Kyle McMartin <kyle@canonical.com>

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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
  2007-04-10 23:36 ` Jeff Garzik
  2007-04-10 23:43 ` Kyle McMartin
@ 2007-04-11 16:38 ` Kyle McMartin
  2007-04-13 15:33 ` Kyle McMartin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 20+ messages in thread
From: Kyle McMartin @ 2007-04-11 16:38 UTC (permalink / raw)
  To: Alan Cox; +Cc: jgarzik, linux-ide

On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
> @@ -3341,6 +3545,11 @@ static int ata_dev_same_device(struct at
>  			       "%llu != %llu\n",
>  			       (unsigned long long)dev->n_sectors,
>  			       (unsigned long long)new_n_sectors);
> +		/* Are we the boot time size - if so we appear to be the
> +		   same disk at this point and our HPA got reapplied */
> +		if (ata_ignore_hpa && dev->n_sectors_boot == new_n_sectors 
> +		    && ata_id_hpa_enabled(new_id))
> +			return 1;
>  		return 0;

Instead of storing the n_sectors_boot, would it not be sufficient to
attempt ata_hpa_resize, and compare dev->n_sectors with the result?
(Or even just redo the read_native_max command to check it?)

Cheers,
	Kyle M.

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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
                   ` (2 preceding siblings ...)
  2007-04-11 16:38 ` Kyle McMartin
@ 2007-04-13 15:33 ` Kyle McMartin
  2007-04-13 15:44   ` Kyle McMartin
  2007-04-17 16:10 ` Jeff Garzik
  2007-04-17 18:41 ` Dave Jones
  5 siblings, 1 reply; 20+ messages in thread
From: Kyle McMartin @ 2007-04-13 15:33 UTC (permalink / raw)
  To: Alan Cox; +Cc: jgarzik, linux-ide

On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
> Add support for ignoring the BIOS HPA result (off by default) and setting
> the disk to the full available size unless already frozen.
> 
> Tested with various platforms/disks and confirmed to work with the
> Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
> readback that Tejun fixed).
> 
> For normal users this brings us, I believe, to feature parity with old IDE
> (and of course more featured in some areas too).
> 

Argh. I'm seeing a show stopper bug on sata_nv here. ata_exec_internal
is MCE-ing on the READ_NATIVE_MAX_EXT command on both i386 and amd64, with
top of Linus' tree + this patch. :(

Cheers,
	Kyle

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

* Re: [PATCH] libata: HPA support
  2007-04-13 15:33 ` Kyle McMartin
@ 2007-04-13 15:44   ` Kyle McMartin
  2007-04-13 16:24     ` Jeff Garzik
  0 siblings, 1 reply; 20+ messages in thread
From: Kyle McMartin @ 2007-04-13 15:44 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Alan Cox, jgarzik, linux-ide

On Fri, Apr 13, 2007 at 11:33:44AM -0400, Kyle McMartin wrote:
> On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
> > Add support for ignoring the BIOS HPA result (off by default) and setting
> > the disk to the full available size unless already frozen.
> > 
> > Tested with various platforms/disks and confirmed to work with the
> > Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
> > readback that Tejun fixed).
> > 
> > For normal users this brings us, I believe, to feature parity with old IDE
> > (and of course more featured in some areas too).
> > 
> 
> Argh. I'm seeing a show stopper bug on sata_nv here. ata_exec_internal
> is MCE-ing on the READ_NATIVE_MAX_EXT command on both i386 and amd64, with
> top of Linus' tree + this patch. :(
> 

Oddly, the command at least executes and doesn't MCE (but it's not at all
happy either) if I use ATA_PROT_PIO. I wonder if ATA_PROT_NODATA is buggered
on this sata_nv chip (Asus A8N-E).

Weird...
	Kyle

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

* Re: [PATCH] libata: HPA support
  2007-04-13 15:44   ` Kyle McMartin
@ 2007-04-13 16:24     ` Jeff Garzik
  2007-04-13 16:33       ` Kyle McMartin
  0 siblings, 1 reply; 20+ messages in thread
From: Jeff Garzik @ 2007-04-13 16:24 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Alan Cox, linux-ide

Kyle McMartin wrote:
> Oddly, the command at least executes and doesn't MCE (but it's not at all
> happy either) if I use ATA_PROT_PIO. I wonder if ATA_PROT_NODATA is buggered
> on this sata_nv chip (Asus A8N-E).
> 
> Weird...


Try turning off ADMA using the module parameter, and see if 
ATA_PROT_NODATA magically works.

ADMA is an advanced command execution mode, and it may not be 
appropriate for certain non-data commands.

	Jeff



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

* Re: [PATCH] libata: HPA support
  2007-04-13 16:24     ` Jeff Garzik
@ 2007-04-13 16:33       ` Kyle McMartin
  2007-04-13 16:46         ` Jeff Garzik
  2007-04-13 16:47         ` Kyle McMartin
  0 siblings, 2 replies; 20+ messages in thread
From: Kyle McMartin @ 2007-04-13 16:33 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Kyle McMartin, Alan Cox, linux-ide

On Fri, Apr 13, 2007 at 12:24:34PM -0400, Jeff Garzik wrote:
> Kyle McMartin wrote:
> >Oddly, the command at least executes and doesn't MCE (but it's not at all
> >happy either) if I use ATA_PROT_PIO. I wonder if ATA_PROT_NODATA is 
> >buggered
> >on this sata_nv chip (Asus A8N-E).
> >
> >Weird...
> 
> 
> Try turning off ADMA using the module parameter, and see if 
> ATA_PROT_NODATA magically works.
> 
> ADMA is an advanced command execution mode, and it may not be 
> appropriate for certain non-data commands.
> 

Thanks so much, Jeff! This did it. Think we should drop ADMA by default?
Do you know off-hand if there's any other drivers this might bite us on?

Thanks again!

Cheers,
	Kyle

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

* Re: [PATCH] libata: HPA support
  2007-04-13 16:33       ` Kyle McMartin
@ 2007-04-13 16:46         ` Jeff Garzik
  2007-04-13 16:47         ` Kyle McMartin
  1 sibling, 0 replies; 20+ messages in thread
From: Jeff Garzik @ 2007-04-13 16:46 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Alan Cox, linux-ide

Kyle McMartin wrote:
> On Fri, Apr 13, 2007 at 12:24:34PM -0400, Jeff Garzik wrote:
>> Kyle McMartin wrote:
>>> Oddly, the command at least executes and doesn't MCE (but it's not at all
>>> happy either) if I use ATA_PROT_PIO. I wonder if ATA_PROT_NODATA is 
>>> buggered
>>> on this sata_nv chip (Asus A8N-E).
>>>
>>> Weird...
>>
>> Try turning off ADMA using the module parameter, and see if 
>> ATA_PROT_NODATA magically works.
>>
>> ADMA is an advanced command execution mode, and it may not be 
>> appropriate for certain non-data commands.
>>
> 
> Thanks so much, Jeff! This did it. Think we should drop ADMA by default?
> Do you know off-hand if there's any other drivers this might bite us on?

There is a myriad of choices.  A lot of controllers snoop the ATA 
command set, and perform some special internal behavior (like 
autodetecting taskfile protocol, for example).  Similar to how several 
Promise controllers only use DMA for specific SCSI READ/WRITE commands, 
and PIO for everything else, the most optimal choice is generally to use 
the DMA engine for fast path DMA data commands, and other commands.

You don't want to punish the fast path by turning off ADMA, merely due 
to an issue relating to a non-fast-path command.

	Jeff




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

* Re: [PATCH] libata: HPA support
  2007-04-13 16:33       ` Kyle McMartin
  2007-04-13 16:46         ` Jeff Garzik
@ 2007-04-13 16:47         ` Kyle McMartin
  2007-04-13 21:06           ` ROBERT HANCOCK
  1 sibling, 1 reply; 20+ messages in thread
From: Kyle McMartin @ 2007-04-13 16:47 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Jeff Garzik, Alan Cox, linux-ide, Robert Hancock

[Adding Robert to the CC incase he doesn't follow linux-ide]

On Fri, Apr 13, 2007 at 12:33:41PM -0400, Kyle McMartin wrote:
> On Fri, Apr 13, 2007 at 12:24:34PM -0400, Jeff Garzik wrote:
> > Kyle McMartin wrote:
> > >Oddly, the command at least executes and doesn't MCE (but it's not at all
> > >happy either) if I use ATA_PROT_PIO. I wonder if ATA_PROT_NODATA is 
> > >buggered
> > >on this sata_nv chip (Asus A8N-E).
> > >
> > >Weird...
> > 
> > 
> > Try turning off ADMA using the module parameter, and see if 
> > ATA_PROT_NODATA magically works.
> > 
> > ADMA is an advanced command execution mode, and it may not be 
> > appropriate for certain non-data commands.
> > 
> 
> Thanks so much, Jeff! This did it. Think we should drop ADMA by default?
> Do you know off-hand if there's any other drivers this might bite us on?
> 

Seems to have been commit 382a6652e91b34d5480cfc0ed840c196650493d4 that
caused it (submitting NODATA commands using ADMA.)

Reverting that commit (or booting with sata_nv.adma=0) fixes HPA for me
here... Robert, is reverting that commit going to crush my little world, or
is it a safe course of action? I'd rather not disable ADMA (which turns off
NCQ, right?) wholesale, as the whizbang-gentoo crowd will hang me.

Cheers,
	Kyle

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

* Re: [PATCH] libata: HPA support
  2007-04-13 16:47         ` Kyle McMartin
@ 2007-04-13 21:06           ` ROBERT HANCOCK
  0 siblings, 0 replies; 20+ messages in thread
From: ROBERT HANCOCK @ 2007-04-13 21:06 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Jeff Garzik, Alan Cox, linux-ide

----- Original Message -----
From: Kyle McMartin <kyle@canonical.com>
Date: Friday, April 13, 2007 10:47 am
Subject: Re: [PATCH] libata: HPA support

> [Adding Robert to the CC incase he doesn't follow linux-ide]
> 
> On Fri, Apr 13, 2007 at 12:33:41PM -0400, Kyle McMartin wrote:
> > On Fri, Apr 13, 2007 at 12:24:34PM -0400, Jeff Garzik wrote:
> > > Kyle McMartin wrote:
> > > >Oddly, the command at least executes and doesn't MCE (but 
> it's not at all
> > > >happy either) if I use ATA_PROT_PIO. I wonder if 
> ATA_PROT_NODATA is 
> > > >buggered
> > > >on this sata_nv chip (Asus A8N-E).
> > > >
> > > >Weird...
> > > 
> > > 
> > > Try turning off ADMA using the module parameter, and see if 
> > > ATA_PROT_NODATA magically works.
> > > 
> > > ADMA is an advanced command execution mode, and it may not be 
> > > appropriate for certain non-data commands.
> > > 
> > 
> > Thanks so much, Jeff! This did it. Think we should drop ADMA by 
> default?> Do you know off-hand if there's any other drivers this 
> might bite us on?
> > 
> 
> Seems to have been commit 382a6652e91b34d5480cfc0ed840c196650493d4 
> thatcaused it (submitting NODATA commands using ADMA.)
> 
> Reverting that commit (or booting with sata_nv.adma=0) fixes HPA 
> for me
> here... Robert, is reverting that commit going to crush my little 
> world, or
> is it a safe course of action? I'd rather not disable ADMA (which 
> turns off
> NCQ, right?) wholesale, as the whizbang-gentoo crowd will hang me.

There is already a patch in libata-dev that will fix this, assuming those commands are marked as requiring a result taskfile in the command flags, which they should be:

http://git.kernel.org/?p=linux/kernel/git/jgarzik/libata-dev.git;a=commit;h=eb20a5742d230c67b9af4efd71b8b6b680ca3a09

ADMA should only be used for NODATA commands which don't require any result taskfile, such as cache flushes.

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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
                   ` (3 preceding siblings ...)
  2007-04-13 15:33 ` Kyle McMartin
@ 2007-04-17 16:10 ` Jeff Garzik
  2007-04-17 18:41 ` Dave Jones
  5 siblings, 0 replies; 20+ messages in thread
From: Jeff Garzik @ 2007-04-17 16:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-ide

Alan Cox wrote:
> Signed-off-by: Alan Cox <alan@redhat.com>
> 
> Add support for ignoring the BIOS HPA result (off by default) and setting
> the disk to the full available size unless already frozen.
> 
> Tested with various platforms/disks and confirmed to work with the
> Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
> readback that Tejun fixed).
> 
> For normal users this brings us, I believe, to feature parity with old IDE
> (and of course more featured in some areas too).

applied



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

* Re: [PATCH] libata: HPA support
  2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
                   ` (4 preceding siblings ...)
  2007-04-17 16:10 ` Jeff Garzik
@ 2007-04-17 18:41 ` Dave Jones
  2007-04-17 19:15   ` Jeff Garzik
  2007-04-17 21:45   ` Alan Cox
  5 siblings, 2 replies; 20+ messages in thread
From: Dave Jones @ 2007-04-17 18:41 UTC (permalink / raw)
  To: Alan Cox; +Cc: jgarzik, linux-ide, jkeating

On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
 > Signed-off-by: Alan Cox <alan@redhat.com>
 > 
 > Add support for ignoring the BIOS HPA result (off by default) and setting
 > the disk to the full available size unless already frozen.
 > 
 > Tested with various platforms/disks and confirmed to work with the
 > Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
 > readback that Tejun fixed).
 > 
 > For normal users this brings us, I believe, to feature parity with old IDE
 > (and of course more featured in some areas too).

This is broken horribly on nvidia chipsets..

00:00.0 Memory controller: nVidia Corporation CK804 Memory Controller (rev a3)
00:01.0 ISA bridge: nVidia Corporation CK804 ISA Bridge (rev a3)
00:01.1 SMBus: nVidia Corporation CK804 SMBus (rev a2)
00:02.0 USB Controller: nVidia Corporation CK804 USB Controller (rev a2)
00:02.1 USB Controller: nVidia Corporation CK804 USB Controller (rev a3)
00:06.0 IDE interface: nVidia Corporation CK804 IDE (rev f2)
00:07.0 RAID bus controller: nVidia Corporation CK804 Serial ATA Controller (rev f3)
00:08.0 RAID bus controller: nVidia Corporation CK804 Serial ATA Controller (rev f3)
00:09.0 PCI bridge: nVidia Corporation CK804 PCI Bridge (rev a2)
00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)
00:0b.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:0c.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:0d.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:0e.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:07.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
01:0a.0 FireWire (IEEE 1394): Texas Instruments TSB82AA2 IEEE-1394b Link Layer Controller (rev 01)
05:00.0 VGA compatible controller: ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]
05:00.1 Display controller: ATI Technologies Inc RV370 [Radeon X300SE]

During boot it does this..

Linux version 2.6.20-1.3079.fc7 (brewbuilder@hs20-bc2-2.build.redhat.com) (gcc version 4.1.2 20070403 (Red Hat 4.1.2-8)) #1 SMP Mon Apr 16 20:05:15 EDT 2007
Command line: initrd=initrd.img console=ttyS0,115200 console=tty0 BOOT_IMAGE=vmlinuz 
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009d000 (usable)
 BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001fff0000 (usable)
 BIOS-e820: 000000001fff0000 - 000000001fff3000 (ACPI NVS)
 BIOS-e820: 000000001fff3000 - 0000000020000000 (ACPI data)
 BIOS-e820: 00000000d0000000 - 00000000e0000000 (reserved)
 BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
end_pfn_map = 1048576
DMI 2.3 present.
ACPI: RSDP 000F6E80, 0014 (r0 Nvidia)
ACPI: RSDT 1FFF3000, 0030 (r1 Nvidia AWRDACPI 42302E31 AWRD  1010101)
ACPI: FACP 1FFF3040, 0074 (r1 Nvidia AWRDACPI 42302E31 AWRD  1010101)
ACPI: DSDT 1FFF30C0, 4C3F (r1 NVIDIA AWRDACPI     1000 MSFT  100000C)
ACPI: FACS 1FFF0000, 0040
ACPI: MCFG 1FFF7D80, 003C (r1 Nvidia AWRDACPI 42302E31 AWRD  1010101)
ACPI: APIC 1FFF7D00, 007C (r1 Nvidia AWRDACPI 42302E31 AWRD  1010101)
Scanning NUMA topology in Northbridge 24
Number of nodes 1
Node 0 MemBase 0000000000000000 Limit 000000001fff0000
Using node hash shift of 63
Bootmem setup node 0 0000000000000000-000000001fff0000
Zone PFN ranges:
  DMA             0 ->     4096
  DMA32        4096 ->  1048576
  Normal    1048576 ->  1048576
early_node_map[2] active PFN ranges
    0:        0 ->      157
    0:      256 ->   131056
Nvidia board detected. Ignoring ACPI timer override.
If you got timer trouble try acpi_use_timer_override
ACPI: PM-Timer IO Port: 0x1008
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
Processor #0 (Bootup-CPU)
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
Processor #1
ACPI: LAPIC_NMI (acpi_id[0x00] dfl dfl lint[0x1])
ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: BIOS IRQ0 pin2 override ignored.
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 14 high edge)
ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 15 high edge)
Setting APIC routing to physical flat
Using ACPI (MADT) for SMP configuration information
Nosave address range: 000000000009d000 - 00000000000a0000
Nosave address range: 00000000000a0000 - 00000000000f0000
Nosave address range: 00000000000f0000 - 0000000000100000
Allocating PCI resources starting at 30000000 (gap: 20000000:b0000000)
SMP: Allowing 2 CPUs, 0 hotplug CPUs
PERCPU: Allocating 44672 bytes of per cpu data
Built 1 zonelists.  Total pages: 125776
Kernel command line: initrd=initrd.img console=ttyS0,115200 console=tty0 BOOT_IMAGE=vmlinuz 
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 16384 bytes)
time.c: Detected 2211.357 MHz processor.
Console: colour VGA+ 80x25
Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
... MAX_LOCKDEP_SUBCLASSES:    8
... MAX_LOCK_DEPTH:          30
... MAX_LOCKDEP_KEYS:        2048
... CLASSHASH_SIZE:           1024
... MAX_LOCKDEP_ENTRIES:     8192
... MAX_LOCKDEP_CHAINS:      16384
... CHAINHASH_SIZE:          8192
 memory used by lock dependency info: 1648 kB
 per task-struct memory footprint: 1680 bytes
Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
Checking aperture...
CPU 0: aperture @ 260000000 size 32 MB
Aperture too small (32 MB)
No AGP bridge found
Memory: 496444k/524224k available (2465k kernel code, 27384k reserved, 1445k data, 332k init)
Calibrating delay using timer specific routine.. 4424.38 BogoMIPS (lpj=2212194)
Security Framework v1.0.0 initialized
SELinux:  Initializing.
selinux_register_security:  Registering secondary module capability
Capability LSM initialized as secondary
Mount-cache hash table entries: 256
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU 0/0 -> Node 0
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
lockdep: not fixing up alternatives.
ACPI: Core revision 20070126
Using local APIC timer interrupts.
result 12564554
Detected 12.564 MHz APIC timer.
lockdep: not fixing up alternatives.
Booting processor 1/2 APIC 0x1
Initializing CPU#1
Calibrating delay using timer specific routine.. 4421.83 BogoMIPS (lpj=2210919)
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU 1/1 -> Node 0
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 1
AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ stepping 01
Brought up 2 CPUs
migration_cost=369
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: Using configuration type 1
ACPI: Interpreter enabled
ACPI: (supports S0 S1 S4 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
0000:00:06.0: cannot adjust BAR0 (not I/O)
0000:00:06.0: cannot adjust BAR1 (not I/O)
0000:00:06.0: cannot adjust BAR2 (not I/O)
0000:00:06.0: cannot adjust BAR3 (not I/O)
PCI: Transparent bridge - 0000:00:09.0
ACPI: PCI Interrupt Link [LNK1] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK2] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK3] (IRQs 3 4 *5 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNK4] (IRQs 3 4 5 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNK5] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LUBA] (IRQs 3 4 5 7 9 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LUBB] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LMAC] (IRQs 3 4 5 7 9 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LACI] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LMCI] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LSMB] (IRQs 3 4 *5 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LUB2] (IRQs 3 4 5 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LSID] (IRQs 3 4 5 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LFID] (IRQs 3 4 5 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LPCA] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [APC1] (IRQs 16) *0, disabled.
ACPI: PCI Interrupt Link [APC2] (IRQs 17) *0, disabled.
ACPI: PCI Interrupt Link [APC3] (IRQs 18) *0
ACPI: PCI Interrupt Link [APC4] (IRQs 19) *0
ACPI: PCI Interrupt Link [APC5] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APCF] (IRQs 20 21 22 23) *0
ACPI: PCI Interrupt Link [APCG] (IRQs 20 21 22 23) *0, disabled.
ACPI: PCI Interrupt Link [APCH] (IRQs 20 21 22 23) *0
ACPI: PCI Interrupt Link [APCJ] (IRQs 20 21 22 23) *0, disabled.
ACPI: PCI Interrupt Link [APCK] (IRQs 20 21 22 23) *0, disabled.
ACPI: PCI Interrupt Link [APCS] (IRQs 20 21 22 23) *0
ACPI: PCI Interrupt Link [APCL] (IRQs 20 21 22 23) *0
ACPI: PCI Interrupt Link [APCZ] (IRQs 20 21 22 23) *0, disabled.
ACPI: PCI Interrupt Link [APSI] (IRQs 20 21 22 23) *0
ACPI: PCI Interrupt Link [APSJ] (IRQs 20 21 22 23) *0
ACPI: PCI Interrupt Link [APCP] (IRQs 20 21 22 23) *0, disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 13 devices
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
NetLabel: Initializing
NetLabel:  domain hash size = 128
NetLabel:  protocols = UNLABELED CIPSOv4
NetLabel:  unlabeled traffic allowed by default
pnp: 00:01: ioport range 0x1000-0x107f has been reserved
pnp: 00:01: ioport range 0x1080-0x10ff has been reserved
pnp: 00:01: ioport range 0x1400-0x147f has been reserved
pnp: 00:01: ioport range 0x1480-0x14ff has been reserved
pnp: 00:01: ioport range 0x1800-0x187f has been reserved
pnp: 00:01: ioport range 0x1880-0x18ff has been reserved
pnp: 00:0b: iomem range 0xd0000000-0xdfffffff could not be reserved
pnp: 00:0c: iomem range 0xd0000-0xd3fff has been reserved
pnp: 00:0c: iomem range 0xdcc00-0xdffff has been reserved
pnp: 00:0c: iomem range 0xf0000-0xfbfff could not be reserved
pnp: 00:0c: iomem range 0xfc000-0xfffff could not be reserved
PCI: Bridge: 0000:00:09.0
Time: acpi_pm clocksource has been installed.
  IO window: 9000-9fff
  MEM window: ea000000-ea0fffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:0b.0
  IO window: 6000-6fff
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:0c.0
  IO window: 8000-8fff
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:0d.0
  IO window: 7000-7fff
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:0e.0
  IO window: a000-afff
  MEM window: e8000000-e9ffffff
  PREFETCH window: e0000000-e7ffffff
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 3, 32768 bytes)
TCP established hash table entries: 16384 (order: 8, 1048576 bytes)
TCP bind hash table entries: 16384 (order: 7, 917504 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
checking if image is initramfs... it is
Freeing initrd memory: 5657k freed
audit: initializing netlink socket (disabled)
audit(1176816095.338:1): initialized
Total HugeTLB memory allocated, 0
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
ksign: Installing public key data
Loading keyring
- Added public key 1B1335F4D8AAC8F
- User ID: Red Hat, Inc. (Kernel Module GPG key)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
PCI: Found disabled HT MSI Mapping on 0000:00:0b.0
PCI: Found enabled HT MSI Mapping on 0000:00:00.0
PCI: Found disabled HT MSI Mapping on 0000:00:0c.0
PCI: Found enabled HT MSI Mapping on 0000:00:00.0
PCI: Found disabled HT MSI Mapping on 0000:00:0d.0
PCI: Found enabled HT MSI Mapping on 0000:00:00.0
PCI: Found disabled HT MSI Mapping on 0000:00:0e.0
PCI: Found enabled HT MSI Mapping on 0000:00:00.0
assign_interrupt_mode Found MSI capability
assign_interrupt_mode Found MSI capability
assign_interrupt_mode Found MSI capability
assign_interrupt_mode Found MSI capability
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
Real Time Clock Driver v1.12ac
Non-volatile memory driver v1.2
Linux agpgart interface v0.102 (c) Dave Jones
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
ÿserial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 16384K size 4096 blocksize
input: Macintosh mouse button emulation as /class/input/input0
usbcore: registered new interface driver libusual
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
TCP bic registered
Initializing XFRM netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
powernow-k8: Found 2 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ processors (version 2.00.00)
ACPI Exception (processor_perflib-0234): AE_NOT_FOUND, Evaluating _PSS [20070126]
powernow-k8: MP systems not supported by PSB BIOS structure
powernow-k8: MP systems not supported by PSB BIOS structure
Freeing unused kernel memory: 332k freed
Write protecting the kernel read-only data: 1058k

HARDWARE ERROR
CPU 0: Machine Check Exception:                4 Bank 4: b200000000070f0f
TSC 5d45fa1400 
This is not a software problem!
Run through mcelog --ascii to decode and contact your hardware vendor
Kernel panic - not syncing: Machine check
BUG: warning at kernel/panic.c:137/panic() (Tainted: G   M  )

Call Trace:
 <#MC>  [<ffffffff8028ce05>] panic+0x202/0x213
 [<ffffffff802647db>] oops_begin+0x29/0x78
 [<ffffffff80270947>] print_mce+0xe8/0xed
 [<ffffffff802709d9>] mce_log+0x0/0xa1
 [<ffffffff80270de2>] do_machine_check+0x316/0x3a8
 [<ffffffff8025d2ef>] machine_check+0x7f/0x90
 [<ffffffff8825ac1d>] :sata_nv:nv_adma_interrupt+0x1d/0x4fc
 [<ffffffff8034c88c>] ioread8+0x1/0x2c
 <<EOE>>  <IRQ>  [<ffffffff8824278d>] :libata:ata_tf_read+0x95/0xc4
 [<ffffffff88238888>] :libata:fill_result_tf+0x23/0x25
 [<ffffffff8823a6de>] :libata:ata_qc_complete+0xa5/0xb1
 [<ffffffff8825b036>] :sata_nv:nv_adma_interrupt+0x436/0x4fc
 [<ffffffff80210753>] handle_IRQ_event+0x20/0x55
 [<ffffffff802bd8c9>] handle_fasteoi_irq+0x9d/0xdd
 [<ffffffff8026bf7f>] do_IRQ+0xf6/0x166
 [<ffffffff8026a666>] default_idle+0x0/0x51
 [<ffffffff8025c666>] ret_from_intr+0x0/0xf
 <EOI>  [<ffffffff80260eba>] __sched_text_start+0x92a/0x962
 [<ffffffff8026a69d>] default_idle+0x37/0x51
 [<ffffffff8026a69b>] default_idle+0x35/0x51
 [<ffffffff8024895d>] cpu_idle+0xa1/0xc4
 [<ffffffff80269cea>] rest_init+0x2b/0x2d
 [<ffffffff80686893>] start_kernel+0x2e3/0x2f0
 [<ffffffff80686158>] _sinittext+0x158/0x15f

BUG: warning at drivers/input/serio/i8042.c:825/i8042_panic_blink() (Tainted: G   M  )

Call Trace:
 <#MC>  [<ffffffff803e6d7a>] i8042_panic_blink+0x143/0x301
 [<ffffffff8028cdab>] panic+0x1a8/0x213
 [<ffffffff802647db>] oops_begin+0x29/0x78
 [<ffffffff80270947>] print_mce+0xe8/0xed
 [<ffffffff802709d9>] mce_log+0x0/0xa1
 [<ffffffff80270de2>] do_machine_check+0x316/0x3a8
 [<ffffffff8025d2ef>] machine_check+0x7f/0x90
 [<ffffffff8825ac1d>] :sata_nv:nv_adma_interrupt+0x1d/0x4fc
 [<ffffffff8034c88c>] ioread8+0x1/0x2c
 <<EOE>>  <IRQ>  [<ffffffff8824278d>] :libata:ata_tf_read+0x95/0xc4
 [<ffffffff88238888>] :libata:fill_result_tf+0x23/0x25
 [<ffffffff8823a6de>] :libata:ata_qc_complete+0xa5/0xb1
 [<ffffffff8825b036>] :sata_nv:nv_adma_interrupt+0x436/0x4fc
 [<ffffffff80210753>] handle_IRQ_event+0x20/0x55
 [<ffffffff802bd8c9>] handle_fasteoi_irq+0x9d/0xdd
 [<ffffffff8026bf7f>] do_IRQ+0xf6/0x166
 [<ffffffff8026a666>] default_idle+0x0/0x51
 [<ffffffff8025c666>] ret_from_intr+0x0/0xf
 <EOI>  [<ffffffff80260eba>] __sched_text_start+0x92a/0x962
 [<ffffffff8026a69d>] default_idle+0x37/0x51
 [<ffffffff8026a69b>] default_idle+0x35/0x51
 [<ffffffff8024895d>] cpu_idle+0xa1/0xc4
 [<ffffffff80269cea>] rest_init+0x2b/0x2d
 [<ffffffff80686893>] start_kernel+0x2e3/0x2f0
 [<ffffffff80686158>] _sinittext+0x158/0x15f

BUG: warning at drivers/input/serio/i8042.c:828/i8042_panic_blink() (Tainted: G   M  )

Call Trace:
 <#MC>  [<ffffffff803e6e63>] i8042_panic_blink+0x22c/0x301
 [<ffffffff8028cdab>] panic+0x1a8/0x213
 [<ffffffff802647db>] oops_begin+0x29/0x78
 [<ffffffff80270947>] print_mce+0xe8/0xed
 [<ffffffff802709d9>] mce_log+0x0/0xa1
 [<ffffffff80270de2>] do_machine_check+0x316/0x3a8
 [<ffffffff8025d2ef>] machine_check+0x7f/0x90
 [<ffffffff8825ac1d>] :sata_nv:nv_adma_interrupt+0x1d/0x4fc
 [<ffffffff8034c88c>] ioread8+0x1/0x2c
 <<EOE>>  <IRQ>  [<ffffffff8824278d>] :libata:ata_tf_read+0x95/0xc4
 [<ffffffff88238888>] :libata:fill_result_tf+0x23/0x25
 [<ffffffff8823a6de>] :libata:ata_qc_complete+0xa5/0xb1
 [<ffffffff8825b036>] :sata_nv:nv_adma_interrupt+0x436/0x4fc
 [<ffffffff80210753>] handle_IRQ_event+0x20/0x55
 [<ffffffff802bd8c9>] handle_fasteoi_irq+0x9d/0xdd
 [<ffffffff8026bf7f>] do_IRQ+0xf6/0x166
 [<ffffffff8026a666>] default_idle+0x0/0x51
 [<ffffffff8025c666>] ret_from_intr+0x0/0xf
 <EOI>  [<ffffffff80260eba>] __sched_text_start+0x92a/0x962
 [<ffffffff8026a69d>] default_idle+0x37/0x51
 [<ffffffff8026a69b>] default_idle+0x35/0x51
 [<ffffffff8024895d>] cpu_idle+0xa1/0xc4
 [<ffffffff80269cea>] rest_init+0x2b/0x2d
 [<ffffffff80686893>] start_kernel+0x2e3/0x2f0
 [<ffffffff80686158>] _sinittext+0x158/0x15f

BUG: warning at drivers/input/serio/i8042.c:831/i8042_panic_blink() (Tainted: G   M  )

Call Trace:
 <#MC>  [<ffffffff803e6f0b>] i8042_panic_blink+0x2d4/0x301
 [<ffffffff8028cdab>] panic+0x1a8/0x213
 [<ffffffff802647db>] oops_begin+0x29/0x78
 [<ffffffff80270947>] print_mce+0xe8/0xed
 [<ffffffff802709d9>] mce_log+0x0/0xa1
 [<ffffffff80270de2>] do_machine_check+0x316/0x3a8
 [<ffffffff8025d2ef>] machine_check+0x7f/0x90
 [<ffffffff8825ac1d>] :sata_nv:nv_adma_interrupt+0x1d/0x4fc
 [<ffffffff8034c88c>] ioread8+0x1/0x2c
 <<EOE>>  <IRQ>  [<ffffffff8824278d>] :libata:ata_tf_read+0x95/0xc4
 [<ffffffff88238888>] :libata:fill_result_tf+0x23/0x25
 [<ffffffff8823a6de>] :libata:ata_qc_complete+0xa5/0xb1
 [<ffffffff8825b036>] :sata_nv:nv_adma_interrupt+0x436/0x4fc
 [<ffffffff80210753>] handle_IRQ_event+0x20/0x55
 [<ffffffff802bd8c9>] handle_fasteoi_irq+0x9d/0xdd
 [<ffffffff8026bf7f>] do_IRQ+0xf6/0x166
 [<ffffffff8026a666>] default_idle+0x0/0x51
 [<ffffffff8025c666>] ret_from_intr+0x0/0xf
 <EOI>  [<ffffffff80260eba>] __sched_text_start+0x92a/0x962
 [<ffffffff8026a69d>] default_idle+0x37/0x51
 [<ffffffff8026a69b>] default_idle+0x35/0x51
 [<ffffffff8024895d>] cpu_idle+0xa1/0xc4
 [<ffffffff80269cea>] rest_init+0x2b/0x2d
 [<ffffffff80686893>] start_kernel+0x2e3/0x2f0
 [<ffffffff80686158>] _sinittext+0x158/0x15f



Without the patch, no MCEs.

	Dave

-- 
http://www.codemonkey.org.uk

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

* Re: [PATCH] libata: HPA support
  2007-04-17 18:41 ` Dave Jones
@ 2007-04-17 19:15   ` Jeff Garzik
  2007-04-17 19:30     ` Dave Jones
  2007-04-17 21:45   ` Alan Cox
  1 sibling, 1 reply; 20+ messages in thread
From: Jeff Garzik @ 2007-04-17 19:15 UTC (permalink / raw)
  To: Dave Jones; +Cc: Alan Cox, linux-ide, jkeating

Dave Jones wrote:
> On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
>  > Signed-off-by: Alan Cox <alan@redhat.com>
>  > 
>  > Add support for ignoring the BIOS HPA result (off by default) and setting
>  > the disk to the full available size unless already frozen.
>  > 
>  > Tested with various platforms/disks and confirmed to work with the
>  > Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
>  > readback that Tejun fixed).
>  > 
>  > For normal users this brings us, I believe, to feature parity with old IDE
>  > (and of course more featured in some areas too).
> 
> This is broken horribly on nvidia chipsets..

I think this is what Kyle reported?  Try booting with sata_nv module 
parameter 'adma' set to zero, does that fix the problem?

	Jeff




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

* Re: [PATCH] libata: HPA support
  2007-04-17 19:15   ` Jeff Garzik
@ 2007-04-17 19:30     ` Dave Jones
  2007-04-17 19:34       ` Jesse Keating
  0 siblings, 1 reply; 20+ messages in thread
From: Dave Jones @ 2007-04-17 19:30 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan Cox, linux-ide, jkeating

On Tue, Apr 17, 2007 at 03:15:23PM -0400, Jeff Garzik wrote:
 > Dave Jones wrote:
 > > On Wed, Apr 11, 2007 at 12:23:13AM +0100, Alan Cox wrote:
 > >  > Signed-off-by: Alan Cox <alan@redhat.com>
 > >  > 
 > >  > Add support for ignoring the BIOS HPA result (off by default) and setting
 > >  > the disk to the full available size unless already frozen.
 > >  > 
 > >  > Tested with various platforms/disks and confirmed to work with the
 > >  > Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
 > >  > readback that Tejun fixed).
 > >  > 
 > >  > For normal users this brings us, I believe, to feature parity with old IDE
 > >  > (and of course more featured in some areas too).
 > > 
 > > This is broken horribly on nvidia chipsets..
 > 
 > I think this is what Kyle reported?
 
Yeah sounds like it.  Kyle just pointed out the discussion that followed,
which for some reason linux-ide neglected to send me.  I seem to have
fallen off the list a few weeks back, as looking at the archives shows
a bunch of ata related mails I don't recall ever seeing before.

 > Try booting with sata_nv module 
 > parameter 'adma' set to zero, does that fix the problem?

jesse, wanna give that a shot? booting with the installer with
sata_nv.adma=0 should do the trick.

	Dave

-- 
http://www.codemonkey.org.uk

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

* Re: [PATCH] libata: HPA support
  2007-04-17 19:30     ` Dave Jones
@ 2007-04-17 19:34       ` Jesse Keating
  2007-04-17 20:42         ` Jeff Garzik
  0 siblings, 1 reply; 20+ messages in thread
From: Jesse Keating @ 2007-04-17 19:34 UTC (permalink / raw)
  To: Dave Jones; +Cc: Jeff Garzik, Alan Cox, linux-ide

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

On Tuesday 17 April 2007 15:30:57 Dave Jones wrote:
> jesse, wanna give that a shot? booting with the installer with
> sata_nv.adma=0 should do the trick.

That didn't effect anything.  I still saw a message about "using ADMA mode" 
right before the panic(s).

I added "sata_nv.adma=0" to the kernel arguments.

-- 
Jesse Keating
Release Engineer: Fedora

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] libata: HPA support
  2007-04-17 19:34       ` Jesse Keating
@ 2007-04-17 20:42         ` Jeff Garzik
  2007-04-17 22:05           ` Kyle McMartin
  0 siblings, 1 reply; 20+ messages in thread
From: Jeff Garzik @ 2007-04-17 20:42 UTC (permalink / raw)
  To: Jesse Keating; +Cc: Dave Jones, Alan Cox, linux-ide

Jesse Keating wrote:
> On Tuesday 17 April 2007 15:30:57 Dave Jones wrote:
>> jesse, wanna give that a shot? booting with the installer with
>> sata_nv.adma=0 should do the trick.
> 
> That didn't effect anything.  I still saw a message about "using ADMA mode" 
> right before the panic(s).
> 
> I added "sata_nv.adma=0" to the kernel arguments.

If you still saw ADMA mode, then it's not seeing the module parameter.

It sounds like putting sata_nv.adma on the kernel command line didn't do 
the trick?

	Jeff




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

* Re: [PATCH] libata: HPA support
  2007-04-17 18:41 ` Dave Jones
  2007-04-17 19:15   ` Jeff Garzik
@ 2007-04-17 21:45   ` Alan Cox
  1 sibling, 0 replies; 20+ messages in thread
From: Alan Cox @ 2007-04-17 21:45 UTC (permalink / raw)
  To: Dave Jones; +Cc: jgarzik, linux-ide, jkeating

>  > For normal users this brings us, I believe, to feature parity with old IDE
>  > (and of course more featured in some areas too).
> 
> This is broken horribly on nvidia chipsets..

Your Nvidia driver is out of date.

> HARDWARE ERROR
> CPU 0: Machine Check Exception:                4 Bank 4: b200000000070f0f
> TSC 5d45fa1400 
> This is not a software problem!
> Run through mcelog --ascii to decode and contact your hardware vendor
> Kernel panic - not syncing: Machine check
> BUG: warning at kernel/panic.c:137/panic() (Tainted: G   M  )

If you send certain commands via ADMA the chip takes the entire machine
out. The current Nvidia driver has this cured (and you want it as
otherwise you can blow up the machine via SG_IO)

Alan

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

* Re: [PATCH] libata: HPA support
  2007-04-17 20:42         ` Jeff Garzik
@ 2007-04-17 22:05           ` Kyle McMartin
  0 siblings, 0 replies; 20+ messages in thread
From: Kyle McMartin @ 2007-04-17 22:05 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Jesse Keating, Dave Jones, Alan Cox, linux-ide

On Tue, Apr 17, 2007 at 04:42:41PM -0400, Jeff Garzik wrote:
> Jesse Keating wrote:
> >On Tuesday 17 April 2007 15:30:57 Dave Jones wrote:
> >>jesse, wanna give that a shot? booting with the installer with
> >>sata_nv.adma=0 should do the trick.
> >
> >That didn't effect anything.  I still saw a message about "using ADMA 
> >mode" right before the panic(s).
> >
> >I added "sata_nv.adma=0" to the kernel arguments.
> 
> If you still saw ADMA mode, then it's not seeing the module parameter.
> 
> It sounds like putting sata_nv.adma on the kernel command line didn't do 
> the trick?
> 

If it's a module, putting it on the kernel command line won't fix it, you
have to break into the initramfs and add the module param.

I've got a patch to send out later to apply saved_command_line[] checking
to modules that I really wish I had been able to get into feisty.

Cheers,
	Kyle

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

end of thread, other threads:[~2007-04-17 22:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-10 23:23 [PATCH] libata: HPA support Alan Cox
2007-04-10 23:36 ` Jeff Garzik
2007-04-11  0:15   ` Alan Cox
2007-04-10 23:43 ` Kyle McMartin
2007-04-11 16:38 ` Kyle McMartin
2007-04-13 15:33 ` Kyle McMartin
2007-04-13 15:44   ` Kyle McMartin
2007-04-13 16:24     ` Jeff Garzik
2007-04-13 16:33       ` Kyle McMartin
2007-04-13 16:46         ` Jeff Garzik
2007-04-13 16:47         ` Kyle McMartin
2007-04-13 21:06           ` ROBERT HANCOCK
2007-04-17 16:10 ` Jeff Garzik
2007-04-17 18:41 ` Dave Jones
2007-04-17 19:15   ` Jeff Garzik
2007-04-17 19:30     ` Dave Jones
2007-04-17 19:34       ` Jesse Keating
2007-04-17 20:42         ` Jeff Garzik
2007-04-17 22:05           ` Kyle McMartin
2007-04-17 21:45   ` 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).