Re: Bug report for ahci-mvebu driver

Damien Le Moal
2022-11-10T02:06:17Z

On 11/10/22 04:55, marius@psihoexpert.ro wrote:
> November 8, 2022 8:27 AM, "Damien Le Moal" <damien.lemoal@opensource.wdc.com> wrote:
>
>> So the adapter & driver are OK for regular ATA devices but they may not
>> like port-multiplier devices, or one of its flavor. See:
>> https://en.wikipedia.org/wiki/Port_multiplier for a nice summary. PM
>> comes with either command-based switching or FIS-based switching. The
>> adapter may not support the flavor that your PM box uses, while the
>> sata-mv adapter does.
>>
>> Try to check the router SATA adapter specs and your PM box spec and see
>> what PM flavor they support. If that matches, then this is likely a
>> driver issue. If they do not match, then nothing we can do. You will not
>> be able to use that PM box with your router.
>>
>> --
>> Damien Le Moal
>> Western Digital Research
>
> There is a lot of info in Marvell Armada 38x Functional Specifications manual, but I don't
> understand it. "FIS" is mentioned.
> See https://ulli-kroll.de/Downloads/NAS326/A38x-Functional-Spec-PU0A.pdf , page 241.

Yep, looks like the adapter does support FIS based switching. See table
1291 of that manual.

> From my kernel log:
> ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
> From kernel sources ahci.h:
> pmp means "port multiplier"
> fbs means "FIS based switching"

Yep. So the driver says it does support pmp & fbs, as expected from the
manual info.

> Areca didn't write information so detailed in the manual, but it does say it supports NCQ,
> so according to Wikipedia article you indicated, it probably isn't command-based switching.
> Is there any way to get this info from the working router (sata-mv)? Or if I connect it to a desktop PC?

For the working router, you should also be getting the same message that
you printed above, listing the flags of the adapter. On my test box, for
an Intel C620 series AHCI I have:

ahci 0000:00:11.5: flags: 64bit ncq sntf pm led clo only pio slum part
ems deso sadm sds apst

So no pmp nor fbs support. And for an additional Marvell PCI SATA
adapter on that same box that supports port multiplier, I have:

ahci 0000:61:00.0: flags: 64bit ncq pio

So no pmp nor fbs either. Yet, I have a 4-drive port multiplier box
connected with eSATA to that adapter, some random unknown vendor thing.
And weirdly enough, it works fine.

On a different test machine, an Intel Z170 chipset AHCI says:

ahci 0000:00:17.0: flags: 64bit ncq sntf pm led clo only pio slum part
ems deso sadm sds apst

No pmp/fbs again (No Intel adapter that I know support pmp). And an
ASMedia ASM1062 Serial ATA Controller add-on PCI card says:

ahci 0000:08:00.0: flags: 64bit ncq sntf stag led clo pmp pio slum part
ccc sxs

pmp is supported, but no fbs. I have a Logitech LGB-4BNHEU3 4-drives box
connected which does not seem to support fbs (the manual is useless
about that). It works fine, but when connected to the Marvel adapter on
the other box, it does not...

PMP is a mess and never really stabilized as faster USB interfaces
showed up at about the same time as eSATA tried to spread. That never
happened, and we are left with a bunch of devices that are hit-and-miss.

This of course does not mean that this is not a bug in the ahci-mvebu
driver. We can try digging into that. First thing to try: enable debug
messages in libata and libahci/ahci-mvebu. See
Documentation/admin-guide/dynamic-debug-howto.rst for that. Then connect
your eSATA box and see what it says.

>
> Marius Dinu