On 04/10/2026 21:22, Petr Hodina via B4 Relay wrote:
This series brings up UFS on the Sony Xperia "Yoshino" (MSM8998) and
"Tama" (SDM845) families.

The work falls into four layers:

1. A small refactor that extends ufs_dev_desc with the product revision
    string and the UFS spec version (patch 1). No behaviour change.

2. A device-quirk infrastructure (patches 2-4) that lets us match
    per-device link / power-mode workarounds against manufacturer id,
    model and fw revision:

      - patch 2: generic ufs_fixups[] table and ufshcd_fixup_dev_quirks(),
        called from ufs_start() before power-mode negotiation
      - patch 3: UFS_DEVICE_QUIRK_EXTEND_SYNC_LENGTH for SK Hynix devices
        that need PA_TxHsG{1,2,3}SyncLength programmed to 0x48
      - patch 4: CONFIG_UFS_RESTRICT_TX_LANES build-time knob for boards
        with only a single reliable TX lane. Defaults to N so nothing
        else is affected.

3. The NO_PURGE quirk for devices that brick if issued PURGE / UNMAP
    (patches 5-7):

      - patch 5: refuse erase/UNMAP in the SCSI uclass when NO_PURGE
        is set on the underlying UFS device
      - patch 6: print device identification (vendor / model / rev /
        spec version) at probe so quirk matching is observable on the
        console
      - patch 7: a platform gate that auto-enables NO_PURGE on Sony
        Yoshino/Tama compatibles because per-UFS-chip rows can't see
        blank string descriptors on some affected boards.

4. Akatsuki DTS enablement (patch 8): re-enable the UFS controller node.

Background on NO_PURGE: on the affected Sony platforms the SCSI ERASE /
UNMAP / WRITE_BUFFER PURGE operation overwrites the bootloader region
and permanently bricks the device.

Based on the linux patches by Angelo:
https://github.com/kholk/kernel/commit/2e7a9ee1c91a016baa0b826a7752ec45663a0561

Tested on Sony XZ3 (akatsuki, SDM845) where U-Boot enumerates UFS LUN0
and exposes the GPT.

```
UFS Device Information (ufshc@1d84000)
   Manufacturer:    Samsung (0x01ce)
   Model:           (unset)
   Revision:        (unset)
   Spec Version:    0x0210
   Gear  - RX: 3, TX: 3
   Lane  - RX: 2, TX: 2
   Power - RX: 1, TX: 1, HS rate: 2
   Device Quirks:   0x00000001
   NO_PURGE Quirk:  Yes

...

=> scsi erase 0 1

scsi erase: device 0 block # 0, count 1 ... scsi_erase: erase not supported on 
this device
0 blocks erased: ERROR
=>
```

Hi Petr,

very happy to see this series! So many Sony devices of this generation can be re-purposed but this was the main blocker.

From sample of 25 people on today's workshop, there was one Xperia with this issues (and since we didn't had microSD, we couldn't install anything).

Series,

Acked-by: David Heidelberg <[email protected]>

David

P.S. I assume when mainline kernel gets the fixes for their driver too, you'll revert the manual override in
` arm: dts: qcom: akatsuki: re-enable the UFS controller node`

Reply via email to