Additional findings: D4-320U hibernation, UAS and SYNCHRONIZE CACHE
I did some additional research and found several points that may be useful for TerraMaster Support and R&D.
My current understanding is that the fix may
not necessarily require only a D4-320U firmware update. There are at least two possible places where this issue could potentially be addressed:
- D4-320U USB-to-SATA bridge firmware
- TOS / Linux UAS / SCSI layer
1. D4-320U USB-to-SATA bridge
According to my system logs, the affected bridge enumerates as:
This VID:PID is identified by public USB databases and smartmontools as a
Realtek RTL9201 USB-to-SATA bridge.
With Disk Hibernation enabled, the bridge rejects:
with:
Code: Select all
Sense Key: Illegal Request
Add. Sense: Invalid field in CDB
The failure sequence is essentially:
Code: Select all
SYNCHRONIZE CACHE(10)
→ Illegal Request / Invalid field in CDB
→ write/cache-flush error
→ UAS reset
→ md: super_written gets error=-121
→ md/raid1 marks the disk failed
So one possible solution may be a firmware fix for the RTL9201 bridge, if the firmware incorrectly handles SYNCHRONIZE CACHE(10), especially during or after hibernation/wakeup.
2. Possible TOS / Linux UAS / SCSI workaround
Even if changing the bridge firmware is not possible, R&D could investigate a Linux/TOS device-specific quirk or workaround for:
Possible approaches could include different handling of the rejected cache-flush command, a UAS-specific quirk, or preventing the device from being offlined after this failure.
As a diagnostic test, it may also be useful to force this bridge to use the traditional
driver instead of UAS.
I am
not suggesting that disabling UAS is necessarily the correct permanent fix, because it may reduce performance. My point is that the issue may potentially be addressed on either side of the USB/SCSI interface.
Therefore I think R&D should investigate
both the D4-320U bridge firmware and the TOS Linux UAS/SCSI layer.
3. Very similar SYNCHRONIZE CACHE / UAS failure on D4-320 under Linux
I found a very interesting TerraMaster forum thread:
D4-320 disconnecting in linux, and other problems
A Proxmox user reported:
Code: Select all
uas_eh_abort_handler
CDB: Synchronize Cache(10)
uas_eh_device_reset_handler start
uas_eh_device_reset_handler FAILED
Device offlined - not ready after error recovery
Synchronize Cache(10) failed
This is very similar to my case:
Code: Select all
SYNCHRONIZE CACHE
→ UAS error handling/reset
→ disk becomes unavailable/offline
I understand that this is
not proof of the same root cause, and D4-320 and D4-320U may use different USB-SATA bridge hardware. However, the similarity at the Linux SCSI/UAS level seems significant enough that R&D should compare the two cases.
Another user in that discussion later reported that disabling UAS and using
eliminated the errors on a related TerraMaster DAS. This may therefore be useful as a diagnostic test.
4. Existing D4-320 sleep / RAID reports
There is also this thread:
D4-320 sleep issue on Mac
Users reported RAID degradation and problems related to the DAS putting drives to sleep and waking them again.
Another user with a Mac Mini M4 and D4-320 using two HDDs in software RAID1 suspected an interaction between software RAID, hibernation and the DAS itself.
TM Support directed users to:
This is a different host OS and a D4-320 rather than D4-320U, so I am
not claiming that the root cause is identical. However, it shows that sleep/wakeup behaviour combined with software RAID has caused problems for other users in the D4-320 family.
5. Official TerraMaster USB TDAS troubleshooting guide
TerraMaster also publishes:
TerraMaster USB TDAS Data Interruption Troubleshooting Guide
The list of applicable products explicitly includes:
Code: Select all
D2-320, D4-320, D4-320U, D6-320,
D5 Hybrid, D8 Hybrid, D9-320
The guide discusses read/write interruptions during USB data transfer.
I understand that it mainly covers ports, cables and general connection problems, so it does not prove that my issue has the same cause.
However, it confirms that TerraMaster already treats USB data-interruption problems affecting the D4-320U as a specific troubleshooting category.
My case appears more specific because the problem is reproducibly triggered by
Disk Hibernation, and the kernel log clearly shows the failed
immediately before the UAS reset and RAID degradation.
6. D4-320U / Realtek hardware
There is also a D4-320U hardware discussion here:
D4-320U chipset discussion
A forum member, referring to an internal-board photo, stated that the D4-320U appears to use an all-Realtek solution.
This was not an official TerraMaster statement, so I do not treat it as confirmation. However, my system actually reports:
which public USB databases identify as
Realtek RTL9201.
7. Existing D4-320 firmware is not listed for D4-320U
TerraMaster has a firmware update guide for D4-320/D6-320:
Firmware Update Guide for D6-320/D4-320
This is interesting because it shows that firmware updates in this product family can fix USB/SATA related problems.
However, the guide explicitly lists only:
D4-320U is not listed.
Therefore I do not think it would be safe to try that firmware on my D4-320U.
This raises an important question:
Does the Realtek RTL9201 used in the D4-320U have upgradeable firmware, and if so, is there a newer production, beta or engineering firmware that changes SYNCHRONIZE CACHE or hibernation behaviour?
8. Questions for TerraMaster R&D
I would appreciate it if this case could be escalated to R&D and they could check:
- What firmware version is running on the RTL9201 in my D4-320U?
- Is newer production, beta or engineering firmware available?
- Does the bridge fully support ?
- Does its behaviour change after hibernation/wakeup?
- Is this issue known for USB ID ?
- Could a TOS/Linux UAS quirk prevent the disk from being offlined?
- Would disabling UAS for be a useful diagnostic test?
- Can R&D reproduce this with D4-320U + TerraMaster NAS + software RAID1 + Disk Hibernation enabled?
9. Most important observation from my testing
The failure
does not follow the physical HDD.
I physically swapped the two HDDs, but the problem continued to follow the same D4-320U USB path/device position.
Whichever physical disk enumerates as
on that path is eventually removed from RAID1 after Disk Hibernation is enabled.
With
Disk Hibernation disabled, the RAID1 array remains stable.
This strongly suggests an interaction between:
Code: Select all
D4-320U
* RTL9201 USB-SATA bridge
* UAS/SCSI
* Disk Hibernation/Wakeup
* SYNCHRONIZE CACHE(10)
rather than a defective HDD.
Conclusion
I believe this should be investigated specifically as a possible
D4-320U bridge firmware / UAS / hibernation compatibility issue, not only as a generic USB connectivity problem.
The strongest evidence is:
- the failure follows the D4-320U path rather than the physical HDD;
- Disk Hibernation reproducibly triggers it;
- is rejected immediately before the failure;
- the rejection is followed by UAS recovery/reset;
- md/RAID1 then removes the disk;
- similar SYNCHRONIZE CACHE/UAS failures have been reported with other TerraMaster DAS devices under Linux.
I am happy to provide additional logs, test with UAS disabled, test beta/engineering firmware, or perform any other controlled test requested by R&D.
Thank you.