Bananian

SATA port multiplier support

107 45412
Post Last Edited by rwelteroth at 2014-9-1 04:47

Hi everybody,
I'm trying to connect a SIL5744 based two bay hdd-enclosure to the banana pi via SATA/esata.
The hardware-raid modes are working but since I want more control over RAID, I'd rather use the two drives in jbod mode and use Software RAID. But in jbod-mode, the system only can see one oft the two drives which seems to be an indication that SATA port multipler support doesn't work correctly. Am I missing anything? Does the kernel support PMP?


Thanks for your help
Richard
pgk  
For me:
  1. gunzip </proc/config.gz | grep ATA_PMP
Copy the Code
Returns:
CONFIG_SATA_PMP=y

Which suggests the kernel has the PMP support enabled. The code in git for libata-pmp.c does seem to have code to deal with specific quirks in the SIL5744, so it suggests it should work.

Do you get anything in dmesg which would indicate a problem etc.?

Hi Richard!

Please keep us informed!
This is very interesting and I had no time to test SATA multipliers myself.

Hi again,

I just hooked up the enclosure to the banana. Mode is set to JBOD.
Here is the relevant part from dmesg:
  1. [  537.534292] ata1: exception Emask 0x10 SAct 0x0 SErr 0x4050002 action 0xe frozen
  2. [  537.547153] ata1: irq_stat 0x00000040, connection status changed
  3. [  537.558697] ata1: SError: { RecovComm PHYRdyChg CommWake DevExch }
  4. [  537.567967] ata1: hard resetting link
  5. [  541.203374] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
  6. [  541.215492] ata1.00: ATA-8: TOSHIBA MK5059GSXP, GN001U, max UDMA/100
  7. [  541.228018] ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
  8. [  541.239441] ata1.00: configured for UDMA/100
  9. [  541.246003] ata1: EH complete
  10. [  541.256925] scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK5059GS GN00 PQ: 0 ANSI: 5
  11. [  541.274718] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
  12. [  541.288892] sd 0:0:0:0: [sda] 4096-byte physical blocks
  13. [  541.299853] sd 0:0:0:0: [sda] Write Protect is off
  14. [  541.310009] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
  15. [  541.314296] sd 0:0:0:0: Attached scsi generic sg0 type 0
  16. [  541.328365] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
  17. [  541.377470] Dev Sunxi softw311 sda magic does not match for MBR 1:         
  18. [  541.390864] Dev Sunxi softw311 sda magic does not match for MBR 2:         
  19. [  541.416818] Dev Sunxi softw311 sda magic does not match for MBR 3:         
  20. [  541.430152] Dev Sunxi softw311 sda magic does not match for MBR 4:         
  21. [  541.445203] Dev Sunxi softw311 sda header bad for all MBR copies, MBR corrupted or not present.
  22. [  541.460394] Dev Sunxi softw411 sda magic does not match for MBR 1:         
  23. [  541.474159] Dev Sunxi softw411 sda magic does not match for MBR 2:         
  24. [  541.487841] Dev Sunxi softw411 sda magic does not match for MBR 3:         
  25. [  541.501562] Dev Sunxi softw411 sda magic does not match for MBR 4:         
  26. [  541.516669] Dev Sunxi softw411 sda header bad for all MBR copies, MBR corrupted or not present.
  27. [  541.528874]  sda: unknown partition table
  28. [  541.538897] sd 0:0:0:0: [sda] Attached SCSI disk
Copy the Code
As you can see, only one of the two disks is recognized as sda. I think the error messages concerning MBR result from a not formatted disk or from an MBR that remained from my tests with the box in RAID1 mode.
Meanwhile, I had found out myself that PMP is set to y in config. Maybe that is the problem. What could I do to try out with CONFIG_SATA_PMP=n? As far as I can see, I need to build my own kernel for that or is there a way to switch off PMP-Support without changing the kernel?

Greetings,

Richard

Any new thoughts on this?
I'm just setting up a toolchain to compile my own kernel.

Greetings,
Richard

Meanwhile, I gave it a try but with no success. I'm afraid that the problem has to do with the SATA driver or maybe a boot option.
For now, I am out of options which is quite sad :-(
Happily open for new ideas since I think that it is a software rather than a Hardware Problem.

Greetings
Richard

pgk  
Post Last Edited by pgk at 2014-9-6 13:23

PMP requires hardware support, not just the software. For the A10 processor it seems PMP is not supported - http://linux-sunxi.org/Cubieboar ... _hard_disk_drive.3F

For the A20 people seem to think will the same (though not 100% confirmed from what I can find). It might be one which will simply never work.
Also found this discussion about the A20, where someone does state that A20 doesn't support PMP, but the whole discusion seems a little inconclusive

I had found that thread too. It led me to the hope that it might be a software issue. Very strange that no one could tell for sure whether the A20 supports PMP or not. I'd definitely be willing to try as long as someone leads me the way to patching kernel sources to switch on missing switches

thanks and greetings
Richard

pgk  
As far as I can see it'd be a change to the file <kernel source>/drivers/ata/sw_ahci_platform.c

There is a line "| AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ),"

Which would need to be changed to just "| AHCI_HFLAG_YES_NCQ),

It does look like what was described in that thread, the lookup of AHCI capablities apparently says it can do PMP, however that code specifically overrides it and says it can't, leading to the message in dmesg  "controller can't do PMP, turning off CAP_PMP"

I would have a guess that it can't do PMP and the override is correct, but can't be sure.

I just go and give it a try.
Going to report as soon as kernel is ready and test is done.

You have to log in before you can reply Login | Sign Up

Points Rules