* dvd-r detection problem with port multiplier
@ 2006-09-25 17:38 Trent George
2006-09-26 6:14 ` Tejun Heo
0 siblings, 1 reply; 8+ messages in thread
From: Trent George @ 2006-09-25 17:38 UTC (permalink / raw)
To: htejun; +Cc: linux-ide
Hi Tejun,
Thanks for your clarification and advice.
I downloaded the 2.6.17.4, applied the combined.patch and recompiled
It seems to detect the port multiplier now... but...
now both drives are gone.
it seems like it times out and the dvdr drive "seek"
I should have mentioned that they have sata to pata bridgeboards
on the drives.
I tried rebooting, with discs in and not in the drives.
I can send you a physical bridgeboard, or drive if it helps you...
the samsung hard drive is on the motherboard sata controller.
the dvd drives are on pmp on the sata_sil24 board
Thanks
Trent George
uname -a
Linux suse 2.6.17.4-libata #3 SMP Mon Sep 25 00:46:35 PDT 2006 x86_64 x86_64 x86_64 GNU/Linux
dmesg snip
libata version 2.00 loaded.
ata_piix 0000:00:1f.2: version 2.00
ata_piix 0000:00:1f.2: MAP [ P0 P2 P1 P3 ]
GSI 19 sharing vector 0xE1 and IRQ 19
ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 225
PCI: Setting latency timer of device 0000:00:1f.2 to 64
ata1: SATA max UDMA/133 cmd 0xD400 ctl 0xD802 bmdma 0xE400 irq 225
ata2: SATA max UDMA/133 cmd 0xDC00 ctl 0xE002 bmdma 0xE408 irq 225
scsi0 : ata_piix
ata1.00: ATA-7, max UDMA7, 312579695 sectors: LBA48
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/133
scsi1 : ata_piix
ata2: SATA port has no device.
ATA: abnormal status 0x7F on port 0xDC07
Vendor: ATA Model: SAMSUNG SP1614C Rev: SW10
Type: Direct-Access ANSI SCSI revision: 05
SCSI device sda: 312579695 512-byte hdwr sectors (160041 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back
SCSI device sda: 312579695 512-byte hdwr sectors (160041 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back
sda: sda1 sda2 < sda5 > sda3 sda4
sd 0:0:0:0: Attached scsi disk sda
sata_sil24 0000:01:00.0: version 0.3
ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
PCI: Setting latency timer of device 0000:01:00.0 to 64
ata3: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
ata4: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
scsi2 : sata_sil24
sd 0:0:0:0: Attached scsi generic sg0 type 0
ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.15: Port Multiplier 1.1, 0x1095:0x3726 r23, 5 ports, feat 0x9/0x9
ata3.00: hard resetting port
ata3.00: softreset failed (timeout)
ata3.00: follow-up softreset failed, retrying in 5 secs
ata3.00: hard resetting port
ata3.00: COMRESET failed (errno=3D-16)
ata3.00: reset failed, giving up
ata3.15: hard resetting port
ata3.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: hard resetting port
ata3.00: softreset failed (timeout)
ata3.00: follow-up softreset failed, retrying in 5 secs
ata3.00: hard resetting port
ata3.00: COMRESET failed (errno=3D-16)
ata3.00: reset failed, giving up
ata3.00: failed to recover link after 2 tries, disabling
ata3: failed to recover PMP, retrying in 5 secs
ata3.15: hard resetting port
ata3.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.01: hard resetting port
ata3.01: softreset failed (SRST command error)
ata3.01: follow-up softreset failed, retrying in 5 secs
ata3.01: hard resetting port
ata3.01: softreset failed (SRST command error)
ata3.01: reset failed, giving up
ata3.15: hard resetting port
ata3: controller in dubious state, performing PORT_RST
ata3.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata3.01: hard resetting port
ata3.01: softreset failed (SRST command error)
ata3.01: follow-up softreset failed, retrying in 5 secs
ata3.01: hard resetting port
ata3.01: softreset failed (SRST command error)
ata3.01: reset failed, giving up
ata3.01: failed to recover link after 2 tries, disabling
ata3: failed to recover PMP, retrying in 5 secs
ata3.15: hard resetting port
ata3: controller in dubious state, performing PORT_RST
ata3.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata3.02: hard resetting port
ata3.02: SATA link down (SStatus 0 SControl 300)
ata3.03: hard resetting port
ata3.03: SATA link down (SStatus 0 SControl 300)
ata3.04: hard resetting port
ata3.04: SATA link down (SStatus 0 SControl 300)
ata3: EH pending after completion, repeating EH (cnt=3D4)
ata3.15: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x1
ata3.15: (irq_stat 0x08000800, SDB notify)
ata3: EH complete
Losing some ticks... checking if CPU frequency changed.
scsi3 : sata_sil24
ata4: SATA link down (SStatus 0 SControl 300)
and here was 2.6.18, without the port multiplier patch
uname -a
Linux suse 2.6.18-smp #1 SMP Sat Sep 23 11:13:06 PDT 2006 x86_64 x86_64 x86_64 GNU/Linux
lspci -v
01:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II
Controller (rev 01)
Subsystem: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller
Flags: bus master, fast devsel, latency 0, IRQ 169
Memory at e1004000 (64-bit, non-prefetchable) [size=3D128]
Memory at e1000000 (64-bit, non-prefetchable) [size=3D16K]
I/O ports at 9000 [size=3D128]
[virtual] Expansion ROM at 80000000 [disabled] [size=3D512K]
Capabilities: [54] Power Management version 2
Capabilities: [5c] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable
-
Capabilities: [70] Express Legacy Endpoint IRQ 0
Capabilities: [100] Advanced Error Reporting
dmesg snip
sata_sil24 0000:01:00.0: version 0.3
ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
PCI: Setting latency timer of device 0000:01:00.0 to 64
ata3: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
Losing some ticks... checking if CPU frequency changed.
sd 0:0:0:0: Attached scsi generic sg0 type 0
ata4: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
scsi2 : sata_sil24
ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATAPI, max UDMA/66
ata3.00: configured for UDMA/66
scsi3 : sata_sil24
ata4: SATA link down (SStatus 0 SControl 300)
Vendor: _NEC Model: DVD_RW ND-3550A Rev: 1.G3
Type: CD-ROM ANSI SCSI revision: 05
scsi 2:0:0:0: Attached scsi generic sg1 type 5
ACPI: Processor [CPU0] (supports 2 throttling states)
ACPI: Processor [CPU1] (supports 2 throttling states)
sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 2:0:0:0: Attached scsi CD-ROM sr0
> Trent George wrote:
> > Hi Tejun,
> >
> > I am a novice to linux.
> > I installed suse 10.1
> > Downloaded a frest kernel source 2.6.18, compiled and installed.
> >
> > In windows I can see both dvd-r on the port multiplier
> > In linux, it seems only the first drive is available.
> > I posted some info from the machine.
> >
> > Please advise if you need anything else to help diagnose the problem.=
> >
> > I assume the problem may be related to the SStatus 123 ?
> > I dont know if you have tested optical drives, or only hard drives on=
the mulitplier. I hope to build a tower of 20+ drives.
>
> PMP support isn't yet included in the mainline kernel, so libata can
> only see the first device. I haven't updated libata-tj-stable yet, so =
> if you wanna use PMP support, you'll have to use 2.6.17.4 +
> libata-tj-stable patch. Please take a look at the following page.
>
> http://home-tj.org/wiki/index.php/Libata-tj-stable
>
> --
> tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
2006-09-25 17:38 Trent George
@ 2006-09-26 6:14 ` Tejun Heo
0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2006-09-26 6:14 UTC (permalink / raw)
To: Trent George; +Cc: linux-ide
Hello, Trent.
Trent George wrote:
[--snip--]
> I should have mentioned that they have sata to pata bridgeboards
> on the drives.
That shouldn't change much.
> I tried rebooting, with discs in and not in the drives.
> I can send you a physical bridgeboard, or drive if it helps you...
> the samsung hard drive is on the motherboard sata controller.
> the dvd drives are on pmp on the sata_sil24 board
I have plenty of SATA and PMP hardware these days, so thanks but that
wouldn't be necessary.
[--snip--]
> sata_sil24 0000:01:00.0: version 0.3
> ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
> PCI: Setting latency timer of device 0000:01:00.0 to 64
> ata3: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
> ata4: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
> scsi2 : sata_sil24
> sd 0:0:0:0: Attached scsi generic sg0 type 0
> ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> ata3.15: Port Multiplier 1.1, 0x1095:0x3726 r23, 5 ports, feat 0x9/0x9
> ata3.00: hard resetting port
> ata3.00: softreset failed (timeout)
> ata3.00: follow-up softreset failed, retrying in 5 secs
> ata3.00: hard resetting port
> ata3.00: COMRESET failed (errno=3D-16)
> ata3.00: reset failed, giving up
> ata3.15: hard resetting port
> ata3.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> ata3.00: hard resetting port
> ata3.00: softreset failed (timeout)
> ata3.00: follow-up softreset failed, retrying in 5 secs
> ata3.00: hard resetting port
> ata3.00: COMRESET failed (errno=3D-16)
> ata3.00: reset failed, giving up
> ata3.00: failed to recover link after 2 tries, disabling
Is the first port occupied? 3726 seems to fail initialization if the
first port is not occupied. At the moment, I'm not very sure whether
the hardware or the driver is responsible for this. When this happens,
all other ports fail too which is consistent with your result.
[--snip--]
> sata_sil24 0000:01:00.0: version 0.3
> ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
> PCI: Setting latency timer of device 0000:01:00.0 to 64
> ata3: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
> Losing some ticks... checking if CPU frequency changed.
> sd 0:0:0:0: Attached scsi generic sg0 type 0
> ata4: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
> scsi2 : sata_sil24
> ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> ata3.00: ATAPI, max UDMA/66
> ata3.00: configured for UDMA/66
> scsi3 : sata_sil24
> ata4: SATA link down (SStatus 0 SControl 300)
> Vendor: _NEC Model: DVD_RW ND-3550A Rev: 1.G3
> Type: CD-ROM ANSI SCSI revision: 05
Ah... So your ATAPI device is connected to the first port. Can you swap
the two and see what happens? Does the same setup work okay on windows?
Thanks for testing.
--
tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
@ 2006-09-27 0:22 Trent George
2006-09-27 1:36 ` Tejun Heo
0 siblings, 1 reply; 8+ messages in thread
From: Trent George @ 2006-09-27 0:22 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
Hi Tejun,
Well after 2 days and nights of trying to hack into the driver to figure what is my problem....
I have a fix for me, and an explanation
The problem seemed related to a pioneer drive and bridgeboard
I modified sata_sil24.c with the following addition
in the sil24_do_softreset funtion:
+ void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
/* put the port into known state */
if (sil24_init_port(ap)) {
reason ="port not ready";
goto err;
}
+ ata_wait_register(port + PORT_CTRL_STAT, 0x1f0000,
+ x1f0000, 10, 2000);
+
/* do SRST */
ata_tf_init(link->device, &tf); /* doesn't really matter */
this will wait until the "active slot" of the "port status" field changes from the port mulitpler pmp id of 0x1f (still executing previous command)
it seemed there was a delay from 12 to 84 jiffies for this to clear.
everything works perfect for me now.
sorry I dont know how to post a patch using the correct method.
and I know this is not the "correct" fix, but it is the essence of what needs to be done. This will probablly fix the issue of mixing ATAPI and ATA devices, slow devices or bridgeboards causing reset cycling, and using or not the pmp port 0
Trent
ps: I used this ugly code to see what was happening:
------------
tmp0 = ata_wait_register(port + PORT_CTRL_STAT, PORT_CS_RDY,
0, 10, 10);
tmp1 = jiffies;
tmp = ata_wait_register(port + PORT_CTRL_STAT, 0x1f0000,
0x1f0000, 10, 1000);
ata_link_printk(link, KERN_ERR, "wait for ready on pmp %d %x %x %d\n ", pmp, tmp0, tmp, jiffies-tmp1);
--------------
> Hello, Trent.
>
> Trent George wrote:
> [--snip--]
> > I should have mentioned that they have sata to pata bridgeboards
> > on the drives.
>
> That shouldn't change much.
>
> > I tried rebooting, with discs in and not in the drives.
> > I can send you a physical bridgeboard, or drive if it helps you...
> > the samsung hard drive is on the motherboard sata controller.
> > the dvd drives are on pmp on the sata_sil24 board
>
> I have plenty of SATA and PMP hardware these days, so thanks but that
> wouldn't be necessary.
>
> [--snip--]
> > sata_sil24 0000:01:00.0: version 0.3
> > ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
> > PCI: Setting latency timer of device 0000:01:00.0 to 64
> > ata3: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
> > ata4: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
> > scsi2 : sata_sil24
> > sd 0:0:0:0: Attached scsi generic sg0 type 0
> > ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> > ata3.15: Port Multiplier 1.1, 0x1095:0x3726 r23, 5 ports, feat 0x9/0x9
> > ata3.00: hard resetting port
> > ata3.00: softreset failed (timeout)
> > ata3.00: follow-up softreset failed, retrying in 5 secs
> > ata3.00: hard resetting port
> > ata3.00: COMRESET failed (errno=3D-16)
> > ata3.00: reset failed, giving up
> > ata3.15: hard resetting port
> > ata3.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> > ata3.00: hard resetting port
> > ata3.00: softreset failed (timeout)
> > ata3.00: follow-up softreset failed, retrying in 5 secs
> > ata3.00: hard resetting port
> > ata3.00: COMRESET failed (errno=3D-16)
> > ata3.00: reset failed, giving up
> > ata3.00: failed to recover link after 2 tries, disabling
>
> Is the first port occupied? 3726 seems to fail initialization if the
> first port is not occupied. At the moment, I'm not very sure whether
> the hardware or the driver is responsible for this. When this happens,
> all other ports fail too which is consistent with your result.
>
> [--snip--]
> > sata_sil24 0000:01:00.0: version 0.3
> > ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
> > PCI: Setting latency timer of device 0000:01:00.0 to 64
> > ata3: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
> > Losing some ticks... checking if CPU frequency changed.
> > sd 0:0:0:0: Attached scsi generic sg0 type 0
> > ata4: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
> > scsi2 : sata_sil24
> > ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> > ata3.00: ATAPI, max UDMA/66
> > ata3.00: configured for UDMA/66
> > scsi3 : sata_sil24
> > ata4: SATA link down (SStatus 0 SControl 300)
> > Vendor: _NEC Model: DVD_RW ND-3550A Rev: 1.G3
> > Type: CD-ROM ANSI SCSI revision: 05
>
> Ah... So your ATAPI device is connected to the first port. Can you swap
> the two and see what happens? Does the same setup work okay on windows?
>
> Thanks for testing.
>
> --
> tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
2006-09-27 0:22 Trent George
@ 2006-09-27 1:36 ` Tejun Heo
2006-09-27 2:37 ` Tejun Heo
0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2006-09-27 1:36 UTC (permalink / raw)
To: Trent George; +Cc: linux-ide
Hello, Trent.
Trent George wrote:
> Hi Tejun,
>
> Well after 2 days and nights of trying to hack into the driver to figure what is my problem....
>
> I have a fix for me, and an explanation
> The problem seemed related to a pioneer drive and bridgeboard
I have one px716-sa (embedded bridge board), several PATA odds and an
external simg bridge board. All of them work okay with the current code.
> I modified sata_sil24.c with the following addition
>
> in the sil24_do_softreset funtion:
>
> + void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
>
> /* put the port into known state */
> if (sil24_init_port(ap)) {
> reason ="port not ready";
> goto err;
> }
>
> + ata_wait_register(port + PORT_CTRL_STAT, 0x1f0000,
> + x1f0000, 10, 2000);
> +
> /* do SRST */
> ata_tf_init(link->device, &tf); /* doesn't really matter */
>
> this will wait until the "active slot" of the "port status" field changes from the port mulitpler pmp id of 0x1f (still executing previous command)
> it seemed there was a delay from 12 to 84 jiffies for this to clear.
> everything works perfect for me now.
That's interesting. I guess that's from sil24_clear_pmp(). Maybe that
function needs to wait for active slot to change after clearing each
port's error condition. Hmm.. wasn't in the spec though.
> sorry I dont know how to post a patch using the correct method.
> and I know this is not the "correct" fix, but it is the essence of what needs to be done. This will probablly fix the issue of mixing ATAPI and ATA devices, slow devices or bridgeboards causing reset cycling, and using or not the pmp port 0
So, you're saying that this is the same problem which causes reset
failures if port 0 is unoccupied? That's great. Thanks a lot for
tracking this problem down.
> ps: I used this ugly code to see what was happening:
> ------------
> tmp0 = ata_wait_register(port + PORT_CTRL_STAT, PORT_CS_RDY,
> 0, 10, 10);
> tmp1 = jiffies;
> tmp = ata_wait_register(port + PORT_CTRL_STAT, 0x1f0000,
> 0x1f0000, 10, 1000);
> ata_link_printk(link, KERN_ERR, "wait for ready on pmp %d %x %x %d\n ", pmp, tmp0, tmp, jiffies-tmp1);
> --------------
Pretty enough. :-) I'll investigate into sil24_clear_pmp() and try to
merge your fix.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
2006-09-27 1:36 ` Tejun Heo
@ 2006-09-27 2:37 ` Tejun Heo
0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2006-09-27 2:37 UTC (permalink / raw)
To: Trent George; +Cc: linux-ide
Can you please test the following patch? The spec says that clearing
PMP status should be followed by port initialization and I missed that
before.
Index: work1/drivers/scsi/sata_sil24.c
===================================================================
--- work1.orig/drivers/scsi/sata_sil24.c 2006-09-27 11:35:00.000000000 +0900
+++ work1/drivers/scsi/sata_sil24.c 2006-09-27 11:35:04.000000000 +0900
@@ -594,15 +594,17 @@ static int sil24_init_port(struct ata_po
struct sil24_port_priv *pp = ap->private_data;
u32 tmp;
+ if (ap->nr_pmp_links) {
+ /* clear PMP error status */
+ sil24_clear_pmp(ap);
+ }
+
writel(PORT_CS_INIT, port + PORT_CTRL_STAT);
ata_wait_register(port + PORT_CTRL_STAT,
PORT_CS_INIT, PORT_CS_INIT, 10, 100);
tmp = ata_wait_register(port + PORT_CTRL_STAT,
PORT_CS_RDY, 0, 10, 100);
- /* clear PMP error status */
- sil24_clear_pmp(ap);
-
if ((tmp & (PORT_CS_INIT | PORT_CS_RDY)) != PORT_CS_RDY) {
pp->do_port_rst = 1;
ap->link.eh_context.i.action |= ATA_EH_HARDRESET;
@@ -916,12 +918,12 @@ static void sil24_irq_clear(struct ata_p
static void sil24_pmp_attach(struct ata_port *ap)
{
sil24_config_pmp(ap, 1);
- sil24_clear_pmp(ap);
+ sil24_init_port(ap);
}
static void sil24_pmp_detach(struct ata_port *ap)
{
- sil24_clear_pmp(ap);
+ sil24_init_port(ap);
sil24_config_pmp(ap, 0);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
@ 2006-09-27 6:58 Trent George
2006-09-27 7:24 ` Tejun Heo
0 siblings, 1 reply; 8+ messages in thread
From: Trent George @ 2006-09-27 6:58 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
sorry to be a pest with this.
Hopefully this helps though..
> Can you please test the following patch? The spec says that clearing
> PMP status should be followed by port initialization and I missed that
> before.
>
> Index: work1/drivers/scsi/sata_sil24.c
> ===================================================================
> --- work1.orig/drivers/scsi/sata_sil24.c 2006-09-27 11:35:00.000000000 +0900
> +++ work1/drivers/scsi/sata_sil24.c 2006-09-27 11:35:04.000000000 +0900
> @@ -594,15 +594,17 @@ static int sil24_init_port(struct ata_po
> struct sil24_port_priv *pp = ap->private_data;
> u32 tmp;
>
> + if (ap->nr_pmp_links) {
> + /* clear PMP error status */
> + sil24_clear_pmp(ap);
> + }
> +
> writel(PORT_CS_INIT, port + PORT_CTRL_STAT);
> ata_wait_register(port + PORT_CTRL_STAT,
> PORT_CS_INIT, PORT_CS_INIT, 10, 100);
> tmp = ata_wait_register(port + PORT_CTRL_STAT,
> PORT_CS_RDY, 0, 10, 100);
>
> - /* clear PMP error status */
> - sil24_clear_pmp(ap);
> -
> if ((tmp & (PORT_CS_INIT | PORT_CS_RDY)) != PORT_CS_RDY) {
> pp->do_port_rst = 1;
> ap->link.eh_context.i.action |= ATA_EH_HARDRESET;
> @@ -916,12 +918,12 @@ static void sil24_irq_clear(struct ata_p
> static void sil24_pmp_attach(struct ata_port *ap)
> {
> sil24_config_pmp(ap, 1);
> - sil24_clear_pmp(ap);
> + sil24_init_port(ap);
> }
>
> static void sil24_pmp_detach(struct ata_port *ap)
> {
> - sil24_clear_pmp(ap);
> + sil24_init_port(ap);
> sil24_config_pmp(ap, 0);
> }
>
>
that patch did not work for me.
this folling patch did work for me. (I moved the one line fix
into the sil24_init_port function, compared to before)
I wonder if the processer speed makes a difference ?
I'am on a intel 820 D dual core 2.8ghz
I believe the problem is based on a failing PRB_CTRL_SRST,
while the PORT_CS_INIT is still in progress.
Even though the PORT_CS_RDY comes ready quickly.
I think you can not send another pmp command until the last
one completes (seems the init is slow on some bridgeboards)
the plextor finsihed in 12/250 seconds, the pioneer in 84/250 sec
The other option is a msleep(1000); in the do_softrest after
the init_port.
It seems you can also monitor the PORT_SACTIVE register with a
ata_wait_register(port + PORT_SACTIVE, 1, 1, 10, 1000);
to do the same thing.
all in all, it is VERY hard to fix without the same revision
hardware, as if you can't duplicate it, you cant fix it.
The spec does not really tell you what will happen on a init
while in pmp mode. it shows a different enumeration method
than the driver uses for pmp ...
Plus the plextor is very fast, and one slow device, messes it
up for all the other devices.
it seems this may not be optimum on non-pmp hardware though.
my vote would be for the msleep for compatability
Index: drivers/scsi/sata_sil24.c
===================================================================
--- drivers/scsi/sata_sil24.c.orig 2006-09-26 20:34:03.000000000 -0700
+++ drivers/scsi/sata_sil24.c 2006-09-26 21:46:39.000000000 -0700
@@ -595,15 +595,20 @@
struct sil24_port_priv *pp = ap->private_data;
u32 tmp;
+ if (ap->nr_pmp_links) {
+ /* clear PMP error status */
+ sil24_clear_pmp(ap);
+ }
+
writel(PORT_CS_INIT, port + PORT_CTRL_STAT);
ata_wait_register(port + PORT_CTRL_STAT,
PORT_CS_INIT, PORT_CS_INIT, 10, 100);
tmp = ata_wait_register(port + PORT_CTRL_STAT,
PORT_CS_RDY, 0, 10, 100);
- /* clear PMP error status */
- sil24_clear_pmp(ap);
-
+ ata_wait_register(port + PORT_CTRL_STAT,
+ 0x1f0000, 0x1f0000, 10, 1000);
+
if ((tmp & (PORT_CS_INIT | PORT_CS_RDY)) != PORT_CS_RDY) {
pp->do_port_rst = 1;
ap->link.eh_context.i.action |= ATA_EH_HARDRESET;
@@ -917,12 +922,12 @@
static void sil24_pmp_attach(struct ata_port *ap)
{
sil24_config_pmp(ap, 1);
- sil24_clear_pmp(ap);
+ sil24_init_port(ap);
}
static void sil24_pmp_detach(struct ata_port *ap)
{
- sil24_clear_pmp(ap);
+ sil24_init_port(ap);
sil24_config_pmp(ap, 0);
}
here is a dmesg output of the bad and good version
the bad version, just cycles through reseting seamingly "forever"
bad:
------------
sata_sil24 0000:01:00.0: version 0.3
ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
PCI: Setting latency timer of device 0000:01:00.0 to 64
ata5: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
ata6: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
scsi4 : sata_sil24
ata5: SATA link down (SStatus 0 SControl 300)
scsi5 : sata_sil24
ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata6.15: Port Multiplier 1.1, 0x1095:0x3726 r23, 5 ports, feat 0x9/0x9
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.03: hard resetting port
ata6.03: COMRESET failed (errno=-16)
ata6.03: hardreset failed, retrying in 5 secs
ata6.03: hard resetting port
ata6.03: COMRESET failed (errno=-16)
ata6.03: reset failed, giving up
ata6.15: hard resetting port
ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.03: hard resetting port
ata6.03: COMRESET failed (errno=-16)
ata6.03: hardreset failed, retrying in 5 secs
ata6.03: hard resetting port
ata6.03: COMRESET failed (errno=-16)
ata6.03: reset failed, giving up
ata6.03: failed to recover link after 2 tries, disabling
ata6: failed to recover PMP, retrying in 5 secs
ata6.15: hard resetting port
ata6: controller in dubious state, performing PORT_RST
ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.04: hard resetting port
ata6.04: COMRESET failed (errno=-16)
ata6.04: hardreset failed, retrying in 5 secs
ata6.04: hard resetting port
ata6.04: COMRESET failed (errno=-16)
ata6.04: reset failed, giving up
ata6.15: hard resetting port
ata6: controller in dubious state, performing PORT_RST
ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.04: hard resetting port
ata6.04: COMRESET failed (errno=-16)
ata6.04: hardreset failed, retrying in 5 secs
ata6.04: hard resetting port
ata6.04: COMRESET failed (errno=-16)
ata6.04: reset failed, giving up
ata6.04: failed to recover link after 2 tries, disabling
ata6: failed to recover PMP, retrying in 5 secs
ata6.15: hard resetting port
ata6: controller in dubious state, performing PORT_RST
ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.15: failed to read PMP_GSCR_ERROR
ata6: failed to recover PMP, retrying in 5 secs
ata6.15: hard resetting port
ata6: controller in dubious state, performing PORT_RST
ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.15: failed to read PMP_GSCR_ERROR
ata6: failed to recover PMP, retrying in 5 secs
ata6.15: hard resetting port
ata6: controller in dubious state, performing PORT_RST
ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata6.00: hard resetting port
ata6.00: SATA link down (SStatus 0 SControl 310)
ata6.01: hard resetting port
ata6.01: SATA link down (SStatus 0 SControl 300)
ata6.02: hard resetting port
ata6.02: softreset failed (SRST command error)
ata6.02: follow-up softreset failed, retrying in 5 secs
ata6.02: hard resetting port
ata6.15: failed to read PMP_GSCR_ERROR
ata6: failed to recover PMP after 5 tries, giving up
ata6.15: Port Multiplier detaching
ata6.00: disabled
ata6: EH pending after completion, repeating EH (cnt=4)
ata6: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x1
ata6: (irq_stat 0x08040800, SDB notify)
ata6: EH complete
good:
------------
sata_sil24 0000:01:00.0: version 0.3
ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 169
PCI: Setting latency timer of device 0000:01:00.0 to 64
ata7: SATA max UDMA/100 cmd 0xFFFFC20000020000 ctl 0x0 bmdma 0x0 irq 169
ata8: SATA max UDMA/100 cmd 0xFFFFC20000022000 ctl 0x0 bmdma 0x0 irq 169
scsi6 : sata_sil24
ata7: SATA link down (SStatus 0 SControl 300)
scsi7 : sata_sil24
ata8: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata8.15: Port Multiplier 1.1, 0x1095:0x3726 r23, 5 ports, feat 0x9/0x9
ata8.00: hard resetting port
ata8.00: SATA link down (SStatus 0 SControl 310)
ata8.01: hard resetting port
ata8.01: SATA link down (SStatus 0 SControl 300)
ata8.02: hard resetting port
ata8.02: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.03: hard resetting port
ata8.03: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.04: hard resetting port
ata8.04: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.02: ATAPI, max UDMA/66
ata8.02: configured for UDMA/66
ata8.03: ATAPI, max UDMA/66
ata8.03: configured for UDMA/66
ata8.04: ATAPI, max UDMA/66
ata8.04: applying bridge limits
ata8.04: qc timeout (cmd 0xef)
ata8.04: failed to set xfermode (err_mask=0x104)
ata8.04: limiting speed to UDMA/44
ata8: failed to recover some devices, retrying in 5 secs
ata8.04: hard resetting port
ata8.04: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.04: configured for UDMA/44
ata8: EH complete
ata8.02: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata8.02: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata8.15: hard resetting port
ata8: controller in dubious state, performing PORT_RST
ata8.15: SATA link up 3.0 Gbps (SStatus 123 SControl 0)
ata8.00: hard resetting port
ata8.00: SATA link down (SStatus 0 SControl 310)
ata8.01: hard resetting port
ata8.01: SATA link down (SStatus 0 SControl 300)
ata8.02: hard resetting port
ata8.02: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.03: hard resetting port
ata8.03: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.04: hard resetting port
ata8.04: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.02: failed to set xfermode (err_mask=0x101)
ata8.02: limiting speed to UDMA/44
ata8.03: configured for UDMA/66
ata8.04: configured for UDMA/44
ata8: failed to recover some devices, retrying in 5 secs
ata8.02: hard resetting port
ata8.02: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.02: configured for UDMA/44
ata8: EH pending after completion, repeating EH (cnt=4)
ata8.04: exception Emask 0x2 SAct 0x0 SErr 0x0 action 0x2
ata8.04: (irq_stat 0x00060002, protocol mismatch)
ata8.04: soft resetting port
ata8.04: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata8.04: configured for UDMA/44
ata8: EH complete
Vendor: _NEC Model: DVD_RW ND-3550A Rev: 1.G3
Type: CD-ROM ANSI SCSI revision: 05
7:0:2:0: Attached scsi generic sg1 type 5
Vendor: PLEXTOR Model: DVDR PX-755A Rev: 1.03
Type: CD-ROM ANSI SCSI revision: 05
7:0:3:0: Attached scsi generic sg2 type 5
Vendor: PIONEER Model: DVD-RW DVR-111D Rev: 1.23
Type: CD-ROM ANSI SCSI revision: 05
7:0:4:0: Attached scsi generic sg3 type 5
sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 7:0:2:0: Attached scsi CD-ROM sr0
sr1: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray
sr 7:0:3:0: Attached scsi CD-ROM sr1
sr2: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray
sr 7:0:4:0: Attached scsi CD-ROM sr2
not to get off topic, but
this was from SiI-DS-0113_3124-1_full.pdf
5.4.6 Interrupts and Command Completion
talked about the multi interrupt lines.
Trent
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
2006-09-27 6:58 dvd-r detection problem with port multiplier Trent George
@ 2006-09-27 7:24 ` Tejun Heo
2006-10-17 4:49 ` Tejun Heo
0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2006-09-27 7:24 UTC (permalink / raw)
To: Trent George; +Cc: linux-ide
Hello,
Trent George wrote:
> sorry to be a pest with this.
> Hopefully this helps though..
Don't be sorry. You're helping a lot.
[--snip--]
> that patch did not work for me.
>
> this folling patch did work for me. (I moved the one line fix
> into the sil24_init_port function, compared to before)
>
> I wonder if the processer speed makes a difference ?
> I'am on a intel 820 D dual core 2.8ghz
>
> I believe the problem is based on a failing PRB_CTRL_SRST,
> while the PORT_CS_INIT is still in progress.
> Even though the PORT_CS_RDY comes ready quickly.
PORT_CS_INIT is "Port Initialize" and is internal (re-)initialization.
It doesn't issue anything to outside of the controller silicon. It
simply makes the chip forget about pending commands and internal state
and ready for the next command. So, I'm a bit surprised that slow
device has affect on it. It's described in 7.3.3 Bit[2].
> I think you can not send another pmp command until the last
> one completes (seems the init is slow on some bridgeboards)
Not only that, from the result it seems the whole controller is locked
up after such sequence.
> the plextor finsihed in 12/250 seconds, the pioneer in 84/250 sec
> The other option is a msleep(1000); in the do_softrest after
> the init_port.
I see.
> It seems you can also monitor the PORT_SACTIVE register with a
> ata_wait_register(port + PORT_SACTIVE, 1, 1, 10, 1000);
> to do the same thing.
I'm just curious what PORT_SACTIVE or Active Slot field has to do with
PORT_CS_INIT. Maybe it's some internal detail.....
> all in all, it is VERY hard to fix without the same revision
> hardware, as if you can't duplicate it, you cant fix it.
> The spec does not really tell you what will happen on a init
> while in pmp mode. it shows a different enumeration method
> than the driver uses for pmp ...
>
> Plus the plextor is very fast, and one slow device, messes it
> up for all the other devices.
>
> it seems this may not be optimum on non-pmp hardware though.
> my vote would be for the msleep for compatability
I'll contact simg and ask them about the problem and incorporate
whatever fix they recommend to next iteration of PMP patches. I hope
you'll be around to test it. :-)
[--snip--]
> here is a dmesg output of the bad and good version
> the bad version, just cycles through reseting seamingly "forever"
Well, it gives up link by link. As the timeout is quite long and all
links fail, it takes quite some time but it isn't forever. This will be
improved in the future.
[--snip--]
> not to get off topic, but
> this was from SiI-DS-0113_3124-1_full.pdf
> 5.4.6 Interrupts and Command Completion
> talked about the multi interrupt lines.
Ah... that one. Now I remember. Yeah, sil24 can do 4 IRQs using
INTA-D, which is pretty interesting, but I don't think off-the-shelf IO
add-on cards actually connect them. Even if there is card which do, I
think we'll need to jump through some loops to get IRQ routing right.
INTA-D lines aren't supposed to be used like that after all. I think
that's why the doc says "In certain embedded environments,...".
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dvd-r detection problem with port multiplier
2006-09-27 7:24 ` Tejun Heo
@ 2006-10-17 4:49 ` Tejun Heo
0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2006-10-17 4:49 UTC (permalink / raw)
To: Trent George; +Cc: linux-ide
Hello,
New round of PMP patches are out now.
http://article.gmane.org/gmane.linux.ide/13503 (the subject line is wrong)
I first included your fix but noticed that it slowed down the whole
device detection regardless of attached device. I'm also waiting for
SIMG to respond on the issue.
Can you cook something up which doesn't slow down detection for all devices?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-10-17 4:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 6:58 dvd-r detection problem with port multiplier Trent George
2006-09-27 7:24 ` Tejun Heo
2006-10-17 4:49 ` Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2006-09-27 0:22 Trent George
2006-09-27 1:36 ` Tejun Heo
2006-09-27 2:37 ` Tejun Heo
2006-09-25 17:38 Trent George
2006-09-26 6:14 ` Tejun Heo
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).