ufs: Fix wrong bitfield usage for Data Direction in Transfer Request
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Fri, 10 Oct 2025 02:45:57 +0000 (11:45 +0900)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 28 Oct 2025 16:10:46 +0000 (17:10 +0100)
commitd0dfb8c635ab4ff60090878879c9f75f9a7193da
tree472458f3f88777bf0b3c2ed8dbf5e8227004286b
parent6defecd943e92e4341cfa088ef4f4cc19ff2db8b
ufs: Fix wrong bitfield usage for Data Direction in Transfer Request

Commit d232d7fdbf6f ("ufs: core: sync ufshci.h with Linux v6.12") updated
the Data Direction values from bitmask values to simple enumerations.

Before:
    enum {
        UTP_NO_DATA_TRANSFER    = 0x00000000,
        UTP_HOST_TO_DEVICE      = 0x02000000,
        UTP_DEVICE_TO_HOST      = 0x04000000,
    };

Updated:
    enum utp_data_direction {
        UTP_NO_DATA_TRANSFER    = 0,
        UTP_HOST_TO_DEVICE      = 1,
        UTP_DEVICE_TO_HOST      = 2,
    };

However, the U-Boot code still uses these values directly without shifting,
and resulting in wrong bitfield placement in the Transfer Request
Descriptor.

This fixes the issue by applying the necessary shift to align the value.

Fixes: d232d7fdbf6f ("ufs: core: sync ufshci.h with Linux v6.12")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251010024557.673787-1-hayashi.kunihiko@socionext.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/ufs/ufs.c
drivers/ufs/ufs.h