linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HPA support: Revised patch
@ 2007-04-05 13:13 Alan Cox
  2007-04-05 16:25 ` Randy Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alan Cox @ 2007-04-05 13:13 UTC (permalink / raw)
  To: akpm, linux-ide, linux-kernel, kyle

This one should fix the problems with slave devices and the Macintosh hang

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/drivers/ata/libata-core.c linux-2.6.21-rc5-mm4/drivers/ata/libata-core.c
--- linux.vanilla-2.6.21-rc5-mm4/drivers/ata/libata-core.c	2007-04-03 16:56:32.000000000 +0100
+++ linux-2.6.21-rc5-mm4/drivers/ata/libata-core.c	2007-04-03 17:08:28.000000000 +0100
@@ -90,6 +90,10 @@
 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=off 1=on)");
+
 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)");
@@ -809,6 +813,202 @@
 	*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
+ *
+ *	Performa 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)) {
@@ -1659,6 +1859,7 @@
 			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,
@@ -1685,6 +1886,9 @@
 					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));
 
@@ -3335,6 +3546,11 @@
 			       "%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 -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/include/linux/ata.h linux-2.6.21-rc5-mm4/include/linux/ata.h
--- linux.vanilla-2.6.21-rc5-mm4/include/linux/ata.h	2007-04-03 16:52:31.000000000 +0100
+++ linux-2.6.21-rc5-mm4/include/linux/ata.h	2007-04-03 17:11:03.000000000 +0100
@@ -158,6 +158,8 @@
 	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 -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/include/linux/libata.h linux-2.6.21-rc5-mm4/include/linux/libata.h
--- linux.vanilla-2.6.21-rc5-mm4/include/linux/libata.h	2007-04-03 16:56:34.000000000 +0100
+++ linux-2.6.21-rc5-mm4/include/linux/libata.h	2007-04-03 17:11:03.000000000 +0100
@@ -470,6 +470,7 @@
 	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	[flat|nested] 10+ messages in thread

* Re: [PATCH] HPA support: Revised patch
  2007-04-05 13:13 [PATCH] HPA support: Revised patch Alan Cox
@ 2007-04-05 16:25 ` Randy Dunlap
  2007-04-05 19:24 ` Jan-Benedict Glaw
  2007-04-06 16:37 ` Matthew Garrett
  2 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2007-04-05 16:25 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-ide, linux-kernel, kyle

On Thu, 5 Apr 2007 14:13:52 +0100 Alan Cox wrote:

> This one should fix the problems with slave devices and the Macintosh hang

s/Performa/Perform/g

> +/**
> + *	ata_read_native_max_address_ext	-	LBA48 native max query
> + *	@dev: Device to query
> + *
> + *	Performa 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)
> +{
> +}
> +
> +/**
> + *	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)
> +{
> +}


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-05 13:13 [PATCH] HPA support: Revised patch Alan Cox
  2007-04-05 16:25 ` Randy Dunlap
@ 2007-04-05 19:24 ` Jan-Benedict Glaw
  2007-04-05 20:18   ` Alan Cox
  2007-04-06 16:37 ` Matthew Garrett
  2 siblings, 1 reply; 10+ messages in thread
From: Jan-Benedict Glaw @ 2007-04-05 19:24 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-ide, linux-kernel, kyle

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

On Thu, 2007-04-05 14:13:52 +0100, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc5-mm4/drivers/ata/libata-core.c linux-2.6.21-rc5-mm4/drivers/ata/libata-core.c
> --- linux.vanilla-2.6.21-rc5-mm4/drivers/ata/libata-core.c	2007-04-03 16:56:32.000000000 +0100
> +++ linux-2.6.21-rc5-mm4/drivers/ata/libata-core.c	2007-04-03 17:08:28.000000000 +0100
> @@ -90,6 +90,10 @@
>  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=off 1=on)");
> +
>  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)");

For ignore_hpa, it would be nice to not go through inverse logic and
fix the help text a bit (0=honor HPA, 1=ignore HPA).

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:            http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
the second  :

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

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-05 19:24 ` Jan-Benedict Glaw
@ 2007-04-05 20:18   ` Alan Cox
  2007-04-05 20:30     ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Cox @ 2007-04-05 20:18 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: akpm, linux-ide, linux-kernel, kyle

> > +static int ata_ignore_hpa = 0;
> > +module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644);
> > +MODULE_PARM_DESC(ignore_hpa, "Ignore HPA (0=off 1=on)");
> > +
> >  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)");
> 
> For ignore_hpa, it would be nice to not go through inverse logic and
> fix the help text a bit (0=honor HPA, 1=ignore HPA).

Umm.. how about  "preserve_hpa" ?

Alan

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-05 20:18   ` Alan Cox
@ 2007-04-05 20:30     ` Jeff Garzik
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Garzik @ 2007-04-05 20:30 UTC (permalink / raw)
  To: Alan Cox; +Cc: Jan-Benedict Glaw, akpm, linux-ide, linux-kernel, kyle

Alan Cox wrote:
>>> +static int ata_ignore_hpa = 0;
>>> +module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644);
>>> +MODULE_PARM_DESC(ignore_hpa, "Ignore HPA (0=off 1=on)");
>>> +
>>>  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)");
>> For ignore_hpa, it would be nice to not go through inverse logic and
>> fix the help text a bit (0=honor HPA, 1=ignore HPA).
> 
> Umm.. how about  "preserve_hpa" ?

I think he meant fix the help text?

Regardless, it should be "ignore_hpa" as you have it now, though I feel 
the help text requires additional human brain parsing, and could be more 
clear.

	Jeff

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-05 13:13 [PATCH] HPA support: Revised patch Alan Cox
  2007-04-05 16:25 ` Randy Dunlap
  2007-04-05 19:24 ` Jan-Benedict Glaw
@ 2007-04-06 16:37 ` Matthew Garrett
  2007-04-09 21:22   ` Alan Cox
  2 siblings, 1 reply; 10+ messages in thread
From: Matthew Garrett @ 2007-04-06 16:37 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-ide, linux-kernel, kyle

On Thu, Apr 05, 2007 at 02:13:52PM +0100, Alan Cox wrote:
> This one should fix the problems with slave devices and the Macintosh hang

Better, but still not happy with ata_piix - I get the following:

[   10.972000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = 16337840
[   10.972000] ata3.01: ATA-8: FUJITSU MHW2120BH, 00810013, max UDMA/100
[   10.972000] ata3.01: 234441648 sectors, multi 16: LBA48 NCQ (depth 0/32)
[   10.980000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = -1342616656
[   10.980000] ata3.01: Host Protected Area detected:
[   10.980000] 	current size: 234441648 sectors
[   10.980000] 	native size: -1342616656 sectors
                             ^^^^^^^^^^^!?!?!?!?!?!?!?

so I'm not especially keen on letting it reprogram stuff. With ahci it 
works fine. Still on a Macbook Pro - fuller logs below.

With ata_piix:
[    9.984000] ata1: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x000140b0 irq 14
[    9.984000] ata2: PATA max UDMA/133 cmd 0x00010170 ctl 0x00010376 bmdma 0x000140b8 irq 15
[    9.984000] scsi0 : ata_piix
[   10.304000] ata1.00: ATAPI, max UDMA/66
[   10.468000] ata1.00: configured for UDMA/66
[   10.468000] scsi1 : ata_piix
[   10.632000] ATA: abnormal status 0x7F on port 0x00010177
[   10.636000] scsi 0:0:0:0: CD-ROM            MATSHITA DVD-R   UJ-857D  KCV9 PQ: 0 ANSI: 5
[   10.636000] ata_piix 0000:00:1f.2: MAP [ P0 P2 XX XX ]
[   10.636000] ata_piix 0000:00:1f.2: invalid MAP value 0
[   10.792000] ata3: SATA max UDMA/133 cmd 0x000140c8 ctl 0x000140e6 bmdma 0x000140a0 irq 20
[   10.792000] ata4: SATA max UDMA/133 cmd 0x000140c0 ctl 0x000140e2 bmdma 0x000140a8 irq 20
[   10.792000] scsi2 : ata_piix
[   10.948000] ATA: abnormal status 0x7F on port 0x000140cf
[   10.964000] ATA: abnormal status 0x7F on port 0x000140cf
[   10.972000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = 16337840
[   10.972000] ata3.01: ATA-8: FUJITSU MHW2120BH, 00810013, max UDMA/100
[   10.972000] ata3.01: 234441648 sectors, multi 16: LBA48 NCQ (depth 0/32)
[   10.980000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = -1342616656
[   10.980000] ata3.01: Host Protected Area detected:
[   10.980000] 	current size: 234441648 sectors
[   10.980000] 	native size: -1342616656 sectors
[   10.980000] ata3.01: configured for UDMA/100
[   10.980000] scsi3 : ata_piix
[   11.136000] ATA: abnormal status 0x7F on port 0x000140c7
[   11.140000] scsi 2:0:1:0: Direct-Access     ATA      FUJITSU MHW2120B 0081 PQ: 0 ANSI: 5

With ahci:
[   10.052000] libata version 2.20 loaded.
[   10.052000] ahci 0000:00:1f.2: version 2.1
[   10.052000] ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 20
[   11.056000] PCI: Setting latency timer of device 0000:00:1f.2 to 64
[   11.056000] ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 4 ports 1.5 Gbps 0x4 impl IDE mode
[   11.056000] ahci 0000:00:1f.2: flags: 64bit ncq ilck pm led clo pio slum part 
[   11.056000] ata1: SATA max UDMA/133 cmd 0xf88a8100 ctl 0x00000000 bmdma 0x00000000 irq 20
[   11.056000] ata2: SATA max UDMA/133 cmd 0xf88a8180 ctl 0x00000000 bmdma 0x00000000 irq 20
[   11.056000] ata3: SATA max UDMA/133 cmd 0xf88a8200 ctl 0x00000000 bmdma 0x00000000 irq 20
[   11.056000] ata4: SATA max UDMA/133 cmd 0xf88a8280 ctl 0x00000000 bmdma 0x00000000 irq 20
[   11.056000] scsi0 : ahci
[   11.300000] ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0017f2fffe812952]
[   11.368000] ata1: SATA link down (SStatus 0 SControl 0)
[   11.368000] scsi1 : ahci
[   11.680000] ata2: SATA link down (SStatus 0 SControl 0)
[   11.680000] scsi2 : ahci
[   12.164000] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[   12.164000] ata3.00: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = 234441648
[   12.164000] ata3.00: ATA-8: FUJITSU MHW2120BH, 00810013, max UDMA/100
[   12.164000] ata3.00: 234441648 sectors, multi 16: LBA48 NCQ (depth 31/32)
[   12.164000] ata3.00: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = 234441648
[   12.164000] ata3.00: configured for UDMA/100
[   12.164000] scsi3 : ahci
[   12.476000] ata4: SATA link down (SStatus 0 SControl 0)
[   12.476000] scsi 2:0:0:0: Direct-Access     ATA      FUJITSU MHW2120B 0081 PQ: 0 ANSI: 5
[   12.476000] ata_piix 0000:00:1f.1: version 2.10ac1
[   12.476000] ACPI: PCI Interrupt 0000:00:1f.1[A] -> GSI 18 (level, low) -> IRQ 18
[   12.476000] PCI: Setting latency timer of device 0000:00:1f.1 to 64
[   12.476000] ata5: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x000140b0 irq 14
[   12.476000] ata6: PATA max UDMA/133 cmd 0x00010170 ctl 0x00010376 bmdma 0x000140b8 irq 15
[   12.476000] scsi4 : ata_piix
[   12.480000] SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)


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

* Re: [PATCH] HPA support: Revised patch
  2007-04-06 16:37 ` Matthew Garrett
@ 2007-04-09 21:22   ` Alan Cox
  2007-04-09 21:55     ` Chuck Ebbert
  2007-04-10 14:06     ` Matthew Garrett
  0 siblings, 2 replies; 10+ messages in thread
From: Alan Cox @ 2007-04-09 21:22 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: akpm, linux-ide, linux-kernel, kyle

On Fri, 6 Apr 2007 17:37:07 +0100
Matthew Garrett <mjg59@srcf.ucam.org> wrote:

> On Thu, Apr 05, 2007 at 02:13:52PM +0100, Alan Cox wrote:
> > This one should fix the problems with slave devices and the Macintosh hang
> 
> Better, but still not happy with ata_piix - I get the following:
> 
> [   10.972000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = 16337840
> [   10.972000] ata3.01: ATA-8: FUJITSU MHW2120BH, 00810013, max UDMA/100
> [   10.972000] ata3.01: 234441648 sectors, multi 16: LBA48 NCQ (depth 0/32)
> [   10.980000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = -1342616656
> [   10.980000] ata3.01: Host Protected Area detected:
> [   10.980000] 	current size: 234441648 sectors
> [   10.980000] 	native size: -1342616656 sectors
>                              ^^^^^^^^^^^!?!?!?!?!?!?!?
> 
> so I'm not especially keen on letting it reprogram stuff. With ahci it 
> works fine. Still on a Macbook Pro - fuller logs below.

Please apply Tejun's fix for LBA48 data and try again. Hopefully its just
that which is causing the problem.

Alan

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-09 21:22   ` Alan Cox
@ 2007-04-09 21:55     ` Chuck Ebbert
  2007-04-10 14:06     ` Matthew Garrett
  1 sibling, 0 replies; 10+ messages in thread
From: Chuck Ebbert @ 2007-04-09 21:55 UTC (permalink / raw)
  To: Alan Cox; +Cc: Matthew Garrett, akpm, linux-ide, linux-kernel, kyle

Alan Cox wrote:
> On Fri, 6 Apr 2007 17:37:07 +0100
> Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> 
>> On Thu, Apr 05, 2007 at 02:13:52PM +0100, Alan Cox wrote:
>>> This one should fix the problems with slave devices and the Macintosh hang
>> Better, but still not happy with ata_piix - I get the following:
>>
>> [   10.972000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = 16337840
>> [   10.972000] ata3.01: ATA-8: FUJITSU MHW2120BH, 00810013, max UDMA/100
>> [   10.972000] ata3.01: 234441648 sectors, multi 16: LBA48 NCQ (depth 0/32)
>> [   10.980000] ata3.01: ata_hpa_resize 1: sectors = 234441648, hpa_sectors = -1342616656
>> [   10.980000] ata3.01: Host Protected Area detected:
>> [   10.980000] 	current size: 234441648 sectors
>> [   10.980000] 	native size: -1342616656 sectors
>>                              ^^^^^^^^^^^!?!?!?!?!?!?!?
>>
>> so I'm not especially keen on letting it reprogram stuff. With ahci it 
>> works fine. Still on a Macbook Pro - fuller logs below.
> 
> Please apply Tejun's fix for LBA48 data and try again. Hopefully its just
> that which is causing the problem.
> 

This?

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=4742d54fa4b391342dfb8f34de14d51da101fb39

    2.6.21 fix lba48 bug in libata fill_result_tf()

Looks like 2.6.20 material as well.

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-09 21:22   ` Alan Cox
  2007-04-09 21:55     ` Chuck Ebbert
@ 2007-04-10 14:06     ` Matthew Garrett
  2007-04-10 14:07       ` Kyle McMartin
  1 sibling, 1 reply; 10+ messages in thread
From: Matthew Garrett @ 2007-04-10 14:06 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-ide, linux-kernel, kyle

On Mon, Apr 09, 2007 at 10:22:41PM +0100, Alan Cox wrote:

> Please apply Tejun's fix for LBA48 data and try again. Hopefully its just
> that which is causing the problem.

Yes, that works absolutely fine now.
-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH] HPA support: Revised patch
  2007-04-10 14:06     ` Matthew Garrett
@ 2007-04-10 14:07       ` Kyle McMartin
  0 siblings, 0 replies; 10+ messages in thread
From: Kyle McMartin @ 2007-04-10 14:07 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: Alan Cox, akpm, linux-ide, linux-kernel, kyle

On Tue, Apr 10, 2007 at 03:06:18PM +0100, Matthew Garrett wrote:
> On Mon, Apr 09, 2007 at 10:22:41PM +0100, Alan Cox wrote:
> 
> > Please apply Tejun's fix for LBA48 data and try again. Hopefully its just
> > that which is causing the problem.
> Yes, that works absolutely fine now.

Thanks Alan, Matthew!

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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 13:13 [PATCH] HPA support: Revised patch Alan Cox
2007-04-05 16:25 ` Randy Dunlap
2007-04-05 19:24 ` Jan-Benedict Glaw
2007-04-05 20:18   ` Alan Cox
2007-04-05 20:30     ` Jeff Garzik
2007-04-06 16:37 ` Matthew Garrett
2007-04-09 21:22   ` Alan Cox
2007-04-09 21:55     ` Chuck Ebbert
2007-04-10 14:06     ` Matthew Garrett
2007-04-10 14:07       ` Kyle McMartin

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