# eSATA + port multiplier + AHCI not working

## MorpheuS.Ibis

Hi,

I have an extrenal 2-drive docking box (thermaltake ST0015E), which includes a port multiplier

the problem is that it doesn't work properly, on JMB36x or ICH10, both in AHCI mode

dmesg snippets follow

ICH10:

```
[ 1791.840820] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1791.841163] ata6.15: Port Multiplier 1.1, 0x197b:0x2352 r0, 2 ports, feat 0x0/0x0

[ 1791.841167] ata6.15: Asynchronous notification not supported, hotplug won't

[ 1791.841347] ata6.00: hard resetting link

[ 1792.324470] ata6.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1792.324513] ata6.01: hard resetting link

[ 1792.332210] ata6.01: failed to read SCR 2 (Emask=0x40)

[ 1792.332214] ata6.01: COMRESET failed (errno=-5)

[ 1792.332218] ata6.01: failed to read SCR 0 (Emask=0x40)

[ 1792.332220] ata6.01: reset failed, giving up

[ 1792.332224] ata6.15: hard resetting link

[ 1792.816668] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1797.323486] ata6.00: hard resetting link

[ 1800.323042] ata6.15: qc timeout (cmd 0xe4)

[ 1800.323053] ata6.00: failed to read SCR 2 (Emask=0x4)

[ 1800.323055] ata6.00: COMRESET failed (errno=-5)

[ 1800.323059] ata6.00: failed to read SCR 0 (Emask=0x40)

[ 1800.323061] ata6.00: reset failed, giving up

[ 1800.323065] ata6.15: hard resetting link

[ 1800.806961] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1802.322736] ata6.00: hard resetting link

[ 1805.582249] ata6.15: qc timeout (cmd 0xe4)

[ 1805.582258] ata6.00: failed to read SCR 0 (Emask=0x4)

[ 1805.582261] ata6.00: COMRESET failed (errno=-5)

[ 1805.582264] ata6.00: failed to read SCR 0 (Emask=0x40)

[ 1805.582267] ata6.00: reset failed, giving up

[ 1805.582271] ata6.15: hard resetting link

[ 1806.067647] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1807.322491] ata6.00: hard resetting link

[ 1807.806272] ata6.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1807.806321] ata6.01: hard resetting link

[ 1807.813910] ata6.01: failed to read SCR 2 (Emask=0x40)

[ 1807.813913] ata6.01: COMRESET failed (errno=-5)

[ 1807.813916] ata6.01: failed to read SCR 0 (Emask=0x40)

[ 1807.813918] ata6.01: reset failed, giving up

[ 1807.813922] ata6.15: hard resetting link

[ 1808.298367] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1812.805934] ata6.00: hard resetting link

[ 1813.293979] ata6.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1813.294025] ata6.01: hard resetting link

[ 1813.301091] ata6.01: failed to read SCR 2 (Emask=0x40)

[ 1813.301096] ata6.01: COMRESET failed (errno=-5)

[ 1813.301100] ata6.01: failed to read SCR 0 (Emask=0x40)

[ 1813.301103] ata6.01: reset failed, giving up

[ 1813.301105] ata6.01: failed to recover link after 3 tries, disabling

[ 1813.301109] ata6.15: hard resetting link

[ 1813.785039] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1814.105646] ata6.01: failed to read SCR 0 (Emask=0x100)

[ 1814.105651] ata6.01: failed to write SCR 1 (Emask=0x40)

[ 1814.105653] ata6.01: failed to clear SError.N (errno=-5)

[ 1814.105658] ata6.15: hard resetting link

[ 1814.588910] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1814.908981] ata6.01: failed to read SCR 0 (Emask=0x40)

[ 1814.908987] ata6.01: failed to write SCR 1 (Emask=0x40)

[ 1814.908990] ata6.01: failed to clear SError.N (errno=-5)

[ 1814.908994] ata6.15: hard resetting link

[ 1815.392787] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1815.713398] ata6.01: failed to read SCR 0 (Emask=0x40)

[ 1815.713402] ata6.01: failed to write SCR 1 (Emask=0x40)

[ 1815.713405] ata6.01: failed to clear SError.N (errno=-5)

[ 1815.713409] ata6.15: hard resetting link

[ 1816.197157] ata6.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1816.516716] ata6.01: failed to read SCR 0 (Emask=0x40)

[ 1816.516722] ata6.01: failed to write SCR 1 (Emask=0x40)

[ 1816.516724] ata6.01: failed to clear SError.N (errno=-5)

[ 1816.516727] ata6: failed to recover PMP after 5 tries, giving up

[ 1816.516729] ata6.15: Port Multiplier detaching

[ 1816.516779] ata6.00: disabled

[ 1816.516786] ata6: exception Emask 0x2 SAct 0x0 SErr 0x0 action 0x6 frozen t4

[ 1816.516788] ata6: irq_stat 0x00800000, incorrect PMP

[ 1816.516793] ata6: hard resetting link

[ 1817.001043] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1817.001051] ata6: EH complete

```

JMB36x:

```
[ 1904.834442] ata8: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xe frozen

[ 1904.834446] ata8: irq_stat 0x00400040, connection status changed

[ 1904.834452] ata8: hard resetting link

[ 1914.854385] ata8: softreset failed (device not ready)

[ 1914.854389] ata8: hard resetting link

[ 1919.609666] ata8: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1919.610037] ata8.15: Port Multiplier 1.1, 0x197b:0x2352 r0, 2 ports, feat 0x0/0x0

[ 1919.610041] ata8.15: Asynchronous notification not supported, hotplug won't

[ 1919.610042]          work on fan-out ports. Use warm-plug instead.

[ 1919.610255] ata8.00: hard resetting link

[ 1920.093581] ata8.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1920.093637] ata8.01: hard resetting link

[ 1920.101912] ata8.01: failed to read SCR 2 (Emask=0x40)

[ 1920.101916] ata8.01: COMRESET failed (errno=-5)

[ 1920.101918] ata8.01: failed to read SCR 0 (Emask=0x40)

[ 1920.101921] ata8.01: reset failed, giving up

[ 1920.101924] ata8.15: hard resetting link

[ 1920.585532] ata8.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1925.092323] ata8.00: hard resetting link

[ 1925.576661] ata8.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1925.576746] ata8.01: hard resetting link

[ 1925.584780] ata8.01: failed to read SCR 2 (Emask=0x40)

[ 1925.584783] ata8.01: COMRESET failed (errno=-5)

[ 1925.584786] ata8.01: failed to read SCR 0 (Emask=0x40)

[ 1925.584788] ata8.01: reset failed, giving up

[ 1925.584792] ata8.15: hard resetting link

[ 1926.068758] ata8.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1930.576024] ata8.00: hard resetting link

[ 1931.059840] ata8.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1931.059925] ata8.01: hard resetting link

[ 1931.067422] ata8.01: failed to read SCR 2 (Emask=0x40)

[ 1931.067425] ata8.01: COMRESET failed (errno=-5)

[ 1931.067428] ata8.01: failed to read SCR 0 (Emask=0x40)

[ 1931.067430] ata8.01: reset failed, giving up

[ 1931.067432] ata8.01: failed to recover link after 3 tries, disabling

[ 1931.067436] ata8.15: hard resetting link

[ 1931.551886] ata8.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[ 1936.058701] ata8.00: hard resetting link

[ 1936.542987] ata8.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)

[ 1936.558677] ata8.00: ATA-8: WDC WD10EAVS-00D7B1, 01.01A01, max UDMA/133

[ 1936.558681] ata8.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA

[ 1936.559727] ata8.00: configured for UDMA/133

[ 1936.559785] ata8: EH complete

```

AHCI driver init:

```
[    1.121846] ahci 0000:00:1f.2: version 3.0

[    1.121862] ahci 0000:00:1f.2: PCI INT B -> GSI 20 (level, low) -> IRQ 20

[    1.122033] ahci 0000:00:1f.2: irq 55 for MSI/MSI-X

[    1.122056] ahci: SSS flag set, parallel bus scan disabled

[    1.122220] ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode

[    1.122427] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pmp pio slum part ccc ems sxs 

[    1.122636] ahci 0000:00:1f.2: setting latency timer to 64

[    1.162246] scsi0 : ahci

[    1.162443] scsi1 : ahci

[    1.162616] scsi2 : ahci

[    1.162787] scsi3 : ahci

[    1.162958] scsi4 : ahci

[    1.164626] scsi5 : ahci

[    1.166115] ahci 0000:04:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[    1.182229] ahci 0000:04:00.0: AHCI 0001.0000 32 slots 2 ports 3 Gbps 0x3 impl SATA mode

[    1.182440] ahci 0000:04:00.0: flags: 64bit ncq pm led clo pmp pio slum part 

[    1.182572] ahci 0000:04:00.0: setting latency timer to 64

[    1.182655] scsi6 : ahci

[    1.182833] scsi7 : ahci

```

any thoughts? google found some similar cases, unsolved

thanks

----------

## richard.scott

what do you mean by "doesn't work properly?"

What are you trying to do?

----------

## MorpheuS.Ibis

I am trying to have two drives accessible over single esata cable (thanks to the port multiplier), but what I get is one drive (when only one is docked) or a load of errors (see previous post) and drive in slot 1 (when both are docked)

EDIT: accessbile at the same time, not necessarily at full speed when accessing both (read: command based switching is fine)

----------

## py-ro

Only a few consumer sata-chips can hooked to a Port-Multiplier, a year ago i only got SiL-Chips working(even the cheapest one...) this way.

I think your controllers simply doesn't work with it.

Py

----------

## MorpheuS.Ibis

as seen from AHCI init, both controllers claim to support PMP (see pmp flag in both)

moreover, it works in windows with the JMB36x, after installing jmicron-provided drivers (doesn't work with microsoft AHCI drivers)

this looks like a software/driver problem to me   :Wink: 

----------

## frostschutz

port multipliers are so rare, for some time I doubted they actually exist

if your kernel is configured to support port multipliers but it doesn't work, then it may be it's just not been tested enough?

----------

## MorpheuS.Ibis

'zcat /proc/config.gz | grep -i PMP' says 'CONFIG_SATA_PMP=y', so the support is enabled

the multiplier is detected ('Port Multiplier 1.1, 0x197b:0x2352 r0, 2 ports, feat 0x0/0x0' from dmesg) but not correctly initialized

as far as my google research goes, some multipliers work (Sil-made, or at least those have quirks lists in driver), while others don't. to my understanding the multiplier is a fairly standardized device, not requiring any special support/driver for each brand

----------

