All of lore.kernel.org
 help / color / mirror / Atom feed
* Implement the technote about promise/maxtor drives
@ 2007-01-31 17:12 Alan
  2007-02-02 16:49 ` Jeff Garzik
  2007-02-16  6:32 ` Albert Lee
  0 siblings, 2 replies; 6+ messages in thread
From: Alan @ 2007-01-31 17:12 UTC (permalink / raw)
  To: jeff, linux-ide

I don't have the hardware combination to test this one so would
appreciate people testing it before it goes anywhere further

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/pata_pdc2027x.c linux-2.6.20-rc6-mm3/drivers/ata/pata_pdc2027x.c
--- linux.vanilla-2.6.20-rc6-mm3/drivers/ata/pata_pdc2027x.c	2007-01-31 14:20:39.000000000 +0000
+++ linux-2.6.20-rc6-mm3/drivers/ata/pata_pdc2027x.c	2007-01-31 14:31:02.000000000 +0000
@@ -68,6 +68,7 @@
 static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev);
 static void pdc2027x_post_set_mode(struct ata_port *ap);
 static int pdc2027x_check_atapi_dma(struct ata_queued_cmd *qc);
+static unsigned long pdc2027x_mode_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask);
 
 /*
  * ATA Timing Tables based on 133MHz controller clock.
@@ -146,6 +147,7 @@
 
 static struct ata_port_operations pdc2027x_pata100_ops = {
 	.port_disable		= ata_port_disable,
+	.mode_filter		= ata_pci_default_filter,
 
 	.tf_load		= ata_tf_load,
 	.tf_read		= ata_tf_read,
@@ -180,6 +182,7 @@
 	.set_piomode		= pdc2027x_set_piomode,
 	.set_dmamode		= pdc2027x_set_dmamode,
 	.post_set_mode		= pdc2027x_post_set_mode,
+	.mode_filter		= pdc2027x_mode_filter,
 
 	.tf_load		= ata_tf_load,
 	.tf_read		= ata_tf_read,
@@ -334,6 +337,33 @@
 }
 
 /**
+ *	pdc2720x_mode_filter	-	mode selection filter
+ *	@ap: ATA interface
+ *	@adev: ATA device
+ *
+ *	Block UDMA on devices that cause trouble with this controller.
+ */
+
+static unsigned long pdc2027x_mode_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
+{
+	unsigned char model_num[ATA_ID_PROD_LEN + 1];
+	struct ata_device *pair = ata_dev_pair(adev);
+	
+	if (adev->class != ATA_DEV_ATA || adev->devno == 0 || pair == NULL)
+		return ata_pci_default_filter(ap, adev, mask);
+
+	/* Check for slave of a Maxtor at UDMA6 */
+	ata_id_c_string(pair->id, model_num, ATA_ID_PROD,
+			  ATA_ID_PROD_LEN + 1);
+	/* If the master is a maxtor in UDMA6 then the slave should not use UDMA 6 */
+	if(strstr(model_num, "Maxtor") == 0 && pair->dma_mode == XFER_UDMA_6)
+		mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));
+	
+	return ata_pci_default_filter(ap, adev, mask);
+}
+
+
+/**
  *	pdc2027x_set_piomode - Initialize host controller PATA PIO timings
  *	@ap: Port to configure
  *	@adev: um

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

* Re: Implement the technote about promise/maxtor drives
  2007-01-31 17:12 Implement the technote about promise/maxtor drives Alan
@ 2007-02-02 16:49 ` Jeff Garzik
  2007-02-16  6:32 ` Albert Lee
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-02-02 16:49 UTC (permalink / raw)
  To: Alan; +Cc: linux-ide, Mikael Pettersson

Alan wrote:
> I don't have the hardware combination to test this one so would
> appreciate people testing it before it goes anywhere further

I wonder if sata_promise PATA support needs this too?


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

* Re: Implement the technote about promise/maxtor drives
  2007-01-31 17:12 Implement the technote about promise/maxtor drives Alan
  2007-02-02 16:49 ` Jeff Garzik
@ 2007-02-16  6:32 ` Albert Lee
  2007-02-16  6:53   ` Albert Lee
  1 sibling, 1 reply; 6+ messages in thread
From: Albert Lee @ 2007-02-16  6:32 UTC (permalink / raw)
  To: Alan; +Cc: jeff, linux-ide, Mikael Pettersson

Alan wrote:
> I don't have the hardware combination to test this one so would
> appreciate people testing it before it goes anywhere further
> 

I've gotten two Maxtor UDMA/133 drives for testing with 2.6.20-git11.
Those Maxtors drives are quite old: the media access commands no longer
work, but device identify/configuration still works.

Below is the test result:

1. Before the patch, both drives are configured to UDMA/133:

pata_pdc2027x 0000:02:05.0: version 0.74-ac5
ACPI: PCI Interrupt 0000:02:05.0[A] -> Link [LNK1] -> GSI 10 (level, low) -> IRQ 10
pata_pdc2027x 0000:02:05.0: PLL input clock 16713 kHz
ata5: PATA max UDMA/133 cmd 0xe09e97c0 ctl 0xe09e9fda bmdma 0xe09e9000 irq 10
ata6: PATA max UDMA/133 cmd 0xe09e95c0 ctl 0xe09e9dda bmdma 0xe09e9008 irq 10
scsi4 : pata_pdc2027x
ata5.00: ATA-5: MAXTOR 6L060L3, A93.0500, max UDMA/133
ata5.00: 117266688 sectors, multi 16: LBA 
ata5.01: ATA-7: Maxtor 6Y060L0, YAR41BW0, max UDMA/133
ata5.01: 120103200 sectors, multi 16: LBA 
ata5.00: configured for UDMA/133
ata5.01: configured for UDMA/133
scsi5 : pata_pdc2027x
ATA: abnormal status 0x8 on port 0xe09e95df
scsi 4:0:0:0: Direct-Access     ATA      MAXTOR 6L060L3   A93. PQ: 0 ANSI: 5
SCSI device sdb: 117266688 512-byte hdwr sectors (60041 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 3a 00 00
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sdb: 117266688 512-byte hdwr sectors (60041 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 3a 00 00
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdb:
sd 4:0:0:0: Attached scsi disk sdb
scsi 4:0:1:0: Direct-Access     ATA      Maxtor 6Y060L0   YAR4 PQ: 0 ANSI: 5
SCSI device sdc: 120103200 512-byte hdwr sectors (61493 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 3a 00 00
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sdc: 120103200 512-byte hdwr sectors (61493 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 3a 00 00
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdc: sdc1
sd 4:0:1:0: Attached scsi disk sdc

======================================================================================
2. After the patch, the slave drive is limited to UDMA/100:

pata_pdc2027x 0000:02:05.0: version 0.74-ac5
ACPI: PCI Interrupt Link [LNK1] enabled at IRQ 10
ACPI: PCI Interrupt 0000:02:05.0[A] -> Link [LNK1] -> GSI 10 (level, low) -> IRQ 10
pata_pdc2027x 0000:02:05.0: PLL input clock 16992 kHz
ata3: PATA max UDMA/133 cmd 0xe08497c0 ctl 0xe0849fda bmdma 0xe0849000 irq 10
ata4: PATA max UDMA/133 cmd 0xe08495c0 ctl 0xe0849dda bmdma 0xe0849008 irq 10
scsi2 : pata_pdc2027x
input: ImPS/2 Logitech Wheel Mouse as /class/input/input1
ata3.00: ATA-5: MAXTOR 6L060L3, A93.0500, max UDMA/133
ata3.00: 117266688 sectors, multi 16: LBA 
ata3.01: ATA-7: Maxtor 6Y060L0, YAR41BW0, max UDMA/133
ata3.01: 120103200 sectors, multi 16: LBA 
ata3.00: configured for UDMA/133
ata3.01: configured for UDMA/100
scsi3 : pata_pdc2027x
ATA: abnormal status 0x8 on port 0xe08495df
scsi 2:0:0:0: Direct-Access     ATA      MAXTOR 6L060L3   A93. PQ: 0 ANSI: 5
SCSI device sdb: 117266688 512-byte hdwr sectors (60041 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 3a 00 00
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sdb: 117266688 512-byte hdwr sectors (60041 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 3a 00 00
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdb:
sd 2:0:0:0: Attached scsi disk sdb
scsi 2:0:1:0: Direct-Access     ATA      Maxtor 6Y060L0   YAR4 PQ: 0 ANSI: 5
SCSI device sdc: 120103200 512-byte hdwr sectors (61493 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 3a 00 00
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sdc: 120103200 512-byte hdwr sectors (61493 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 3a 00 00
SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdc: sdc1
sd 2:0:1:0: Attached scsi disk sdc
===================================================
So, it looks the patch works as designed/intended.
BTW, maybe we should print something similar to the "applying bridge limits" message,
otherwise the end users might wonder why their slave drive is configured as UDMA/100.

--
albert


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

* Re: Implement the technote about promise/maxtor drives
  2007-02-16  6:32 ` Albert Lee
@ 2007-02-16  6:53   ` Albert Lee
  2007-02-17 17:59     ` Eric D. Mudama
  0 siblings, 1 reply; 6+ messages in thread
From: Albert Lee @ 2007-02-16  6:53 UTC (permalink / raw)
  To: Alan; +Cc: jeff, linux-ide, Mikael Pettersson

Albert wrote:
> Alan wrote:
> 
>>I don't have the hardware combination to test this one so would
>>appreciate people testing it before it goes anywhere further
>>
> 
> 
> I've gotten two Maxtor UDMA/133 drives for testing with 2.6.20-git11.
> Those Maxtors drives are quite old: the media access commands no longer
> work, but device identify/configuration still works.
> 
> Below is the test result:
> 
> 1. Before the patch, both drives are configured to UDMA/133:
> 
<snip>
> 
> ======================================================================================
> 2. After the patch, the slave drive is limited to UDMA/100:
> 
> pata_pdc2027x 0000:02:05.0: version 0.74-ac5
> ACPI: PCI Interrupt Link [LNK1] enabled at IRQ 10
> ACPI: PCI Interrupt 0000:02:05.0[A] -> Link [LNK1] -> GSI 10 (level, low) -> IRQ 10
> pata_pdc2027x 0000:02:05.0: PLL input clock 16992 kHz
> ata3: PATA max UDMA/133 cmd 0xe08497c0 ctl 0xe0849fda bmdma 0xe0849000 irq 10
> ata4: PATA max UDMA/133 cmd 0xe08495c0 ctl 0xe0849dda bmdma 0xe0849008 irq 10
> scsi2 : pata_pdc2027x
> input: ImPS/2 Logitech Wheel Mouse as /class/input/input1
> ata3.00: ATA-5: MAXTOR 6L060L3, A93.0500, max UDMA/133
> ata3.00: 117266688 sectors, multi 16: LBA 
> ata3.01: ATA-7: Maxtor 6Y060L0, YAR41BW0, max UDMA/133
> ata3.01: 120103200 sectors, multi 16: LBA 
> ata3.00: configured for UDMA/133
> ata3.01: configured for UDMA/100
> scsi3 : pata_pdc2027x
> ATA: abnormal status 0x8 on port 0xe08495df
<snip>

> ===================================================
> So, it looks the patch works as designed/intended.
> BTW, maybe we should print something similar to the "applying bridge limits" message,
> otherwise the end users might wonder why their slave drive is configured as UDMA/100.
> 

Some Maxtor drives have "Maxtor" and others have "MAXTOR" in the identify device data.
If the slave is a "MAXTOR" one, the following code segment doesn't work.

+	/* If the master is a maxtor in UDMA6 then the slave should not use UDMA 6 */
+	if(strstr(model_num, "Maxtor") == 0 && pair->dma_mode == XFER_UDMA_6)
+		mask &= ~ (1 << (6 + ATA_SHIFT_UDMA));

Maybe we should check both "Maxtor" and "MAXTOR"?
--
albert


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

* Re: Implement the technote about promise/maxtor drives
  2007-02-16  6:53   ` Albert Lee
@ 2007-02-17 17:59     ` Eric D. Mudama
  0 siblings, 0 replies; 6+ messages in thread
From: Eric D. Mudama @ 2007-02-17 17:59 UTC (permalink / raw)
  To: albertl; +Cc: Alan, jeff, linux-ide, Mikael Pettersson

On 2/15/07, Albert Lee <albertcc@tw.ibm.com> wrote:
> Some Maxtor drives have "Maxtor" and others have "MAXTOR" in the identify device data.
> If the slave is a "MAXTOR" one, the following code segment doesn't work.

The 6L drive is a design brought over from Maxtor's purchase of
Quantum, the 6Y is a Maxtor local design.

> Maybe we should check both "Maxtor" and "MAXTOR"?

It will have to... or maybe not...

Since I think Maxtor was the only vendor doing ATA133, maybe just
limit slave port on those adapters to UDMA100?  (Just checked newegg,
and Hitachi lists theirs as ATA133, while Samsung list theirs as
ATA133 compatible (default ATA100))

Were there enough other vendors doing ATA133 at the time the technote
was written to know if other brands were also affected?

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

* Re: Implement the technote about promise/maxtor drives
@ 2007-02-02 18:27 Mikael Pettersson
  0 siblings, 0 replies; 6+ messages in thread
From: Mikael Pettersson @ 2007-02-02 18:27 UTC (permalink / raw)
  To: alan, jeff; +Cc: linux-ide, mikpe

On Fri, 02 Feb 2007 11:49:17 -0500, Jeff Garzik wrote:
>Alan wrote:
>> I don't have the hardware combination to test this one so would
>> appreciate people testing it before it goes anywhere further
>
>I wonder if sata_promise PATA support needs this too?

Hmm, I saw Alan's post but ignored it because I assumed
it applied only to older HW. Can someone give me a pointer
to the technote?

I don't have any Maxtor disks for testing, alas.

/Mikael

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

end of thread, other threads:[~2007-02-17 17:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31 17:12 Implement the technote about promise/maxtor drives Alan
2007-02-02 16:49 ` Jeff Garzik
2007-02-16  6:32 ` Albert Lee
2007-02-16  6:53   ` Albert Lee
2007-02-17 17:59     ` Eric D. Mudama
2007-02-02 18:27 Mikael Pettersson

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.