Solved eSATA card and AHCI strange behavior

I’m having a problem with eSata cards and AHCI on a FreeBSD 11.0 RELEASE test box. I’ve been running a generic dual port eSata card from StarTech, with a 4 bay Mediasonic (port multiplier supported) enclosure on one port and a single bay generic enclosure on the other. Everything has worked fine with that configuration. However, I’m trying replace the single bay enclosure with second 4 bay Mediasonic enclosure. The StarTech card apparently doesn’t support two pmp enclosures, so I’ve been experimenting with different eSata cards. The current one is a Syba SD-PEX40049 2 port card based on the ASM 1061 chipset. The original enclosure has 4 drives (in a zfs raidz configuration) and the new enclosure has 3 drives.

When the machine is booted, the bios on the eSata card sees all 7 disks and reports them properly to the console, and in fewer than 2 seconds.

After the reboot, none of the 7 drives appear in the machines device list, although the card itself appears as ahci0 (see below for the pertinent dmesg segments). Note also that FreeBSD itself is on internal UFS drives, so the machine boots fine, it just doesn’t see the drives in the two external enclosures.

After logging in, I then run camcontrol reset 0 (actually, sometimes I need to run it several times, and sometimes I need to run camcontrol rescan 0), and finally the first four drives appear. Then camcontrol reset 1 typically makes the other 3 drives appear. See the dmesg segment below after running these commands. From then on the machine seems normal

Here are my questions:

1. Is this a controller issue?
2. Is this an issue with the controller card?
3. If so, is there a recommended eSata card that works in this configuration?

Any help in debugging this would be greatly appreciated.

Boot dmesg segments:
Code:
ahci0: <ASMedia ASM1061 AHCI SATA controller> port 0xe050-0xe057,0xe040-0xe043,0xe030-0xe037,0xe020-0xe023,0xe000-0xe01f mem 0xf7d10000-0xf7d101ff irq 16 at device 0.0 on pci1
ahci0: AHCI v1.20 with 2 6Gbps ports, Port Multiplier supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0

pmp0 at ahcich0 bus 0 scbus0 target 15 lun 0
pmp0: <Port Multiplier 575f197b 000e> ATA device
pmp0: 600.000MB/s transfers (SATA 3.x, NONE, PIO 8192bytes)
pmp0: 15 fan-out ports
pmp1 at ahcich1 bus 0 scbus1 target 15 lun 0
pmp1: <Port Multiplier 575f197b 000e> ATA device
pmp1: 600.000MB/s transfers (SATA 3.x, NONE, PIO 8192bytes)
pmp1: 15 fan-out ports

Running camcontrol devlist yields the following:
Code:
<Port Multiplier 575f197b 000e>    at scbus0 target 15 lun 0 (pass0,pmp0)
<Port Multiplier 575f197b 000e>    at scbus1 target 15 lun 0 (pass1,pmp1)

dmesg after running camcontrol reset 0 and camcontrol reset 1:
Code:
ahcich0: Timeout on slot 14 port 15
ahcich0: is 00800000 cs 00000000 ss 00000000 rs 00004000 tfd 1d0 serr 00000000 cmd 0004cd17
(pmp0:ahcich0:0:15:0): WRITE_PM. ACB: e8 01 ff ff ff 02 00 00 00 00 ff 00
(pmp0:ahcich0:0:15:0): CAM status: Command timeout
(pmp0:ahcich0:0:15:0): Retrying command
ada3 at ahcich0 bus 0 scbus0 target 0 lun 0
ada3: <ST32000641AS CC13> ATA8-ACS SATA 3.x device
ada3: Serial Number 9WM5KLW7
ada3: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada3: Command Queueing enabled
ada3: 1907729MB (3907029168 512 byte sectors)
ada4 at ahcich0 bus 0 scbus0 target 2 lun 0
ada4: <ST32000641AS CC13> ATA8-ACS SATA 3.x device
ada4: Serial Number 9WM47YFF
ada4: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada4: Command Queueing enabled
ada4: 1907729MB (3907029168 512 byte sectors)
ada5 at ahcich0 bus 0 scbus0 target 1 lun 0
ada5: <ST2000DM001-9YN164 CC46> ATA8-ACS SATA 3.x device
ada5: Serial Number Z1E0621D
ada5: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada5: Command Queueing enabled
ada5: 1907729MB (3907029168 512 byte sectors)
ada5: quirks=0x1<4K>
ada6 at ahcich0 bus 0 scbus0 target 3 lun 0
ada6: <ST2000DM001-9YN164 CC46> ATA8-ACS SATA 3.x device
ada6: Serial Number Z2F03WHB
ada6: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada6: Command Queueing enabled
ada6: 1907729MB (3907029168 512 byte sectors)
ada6: quirks=0x1<4K>
ada7 at ahcich1 bus 0 scbus1 target 0 lun 0
ada7: <ST2000DM006-2DM164 CC26> ACS-2 ATA SATA 3.x device
ada7: Serial Number Z4Z8EZFL
ada7: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada7: Command Queueing enabled
ada7: 1907729MB (3907029168 512 byte sectors)
ada7: quirks=0x1<4K>
ada8 at ahcich1 bus 0 scbus1 target 1 lun 0
ada8: <ST4000DM005-2DP166 0001> ACS-3 ATA SATA 3.x device
ada8: Serial Number ZDH1SYWE
ada8: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada8: Command Queueing enabled
ada8: 3815447MB (7814037168 512 byte sectors)
ada8: quirks=0x1<4K>
ada9 at ahcich1 bus 0 scbus1 target 2 lun 0
ada9: <ST1000DM010-2EP102 CC43> ATA8-ACS SATA 3.x device
ada9: Serial Number Z9AFT5NM
ada9: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada9: Command Queueing enabled
ada9: 953869MB (1953525168 512 byte sectors)
ada9: quirks=0x1<4K>

--Rick
 
A Bit more info about this problem. I wrote a script that gets run out of rc.d that made the disks come alive, essentially doing what I was running by hand after the boot process. That basically fixed everything. A day later, I upgraded from 11.0 to 11.1 and the problem went away, making the script unnecessary. Sigh. All is well however. A final note is that the Mediasonic box does not have an option to power on automatically after a power outage, making it a questionable choice in some cases.

--Rick
 
Hey Rick,

I have the same problem with mediasonic 4 bay eSATA enclosure and FreeBSD 11.0 ( using FreeNAS 11). Can you share the script you used when you were having problem please?

Regarding the power sync of the enclosure, as per the manual they say there are 3 modes: blue led = will turnoff with main system but won't turn on; orange led = stand by when system turn off and they say will come back on when boot up and led turned off = will stay always on. (press and hold sync button for those changes)

take it easy


xico
 
Back
Top