Re: [PATCH 01/10] ufs: unipro: Move Tx/Rx FSM state definitions to unipro.h

Frank Li <[email protected]>
Newsgroups org.kernel.vger.linux-scsi,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <ao8AtFsYdr26rHVc@SMW015318>
On Wed, Aug 26, 2026 at 03:40:39PM +0200, Larisa Grigore wrote:
> [You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Move the Tx/Rx FSM state definitions from ufshcd-dwc.h to
> include/ufs/unipro.h.
>
> These state values are UniPro/M-PHY related and are not specific to
> the DesignWare UFS host controller implementation, so unipro.h is a
> more appropriate location for sharing them.
>
> As part of this move, drop the driver-private TX_FSM_HIBERN8 define in
> ufs-hisi and ufs-qcom and repoint their Hibern8 checks at the shared
> TX_STATE_HIBERN8 enum constant. This is a no-op change: TX_FSM_HIBERN8
> was 0x1 and TX_STATE_HIBERN8 is 1, so the compared values are identical.
>
> This also prepares for using these definitions in a subsequent commit.
>
> Signed-off-by: Larisa Grigore <[email protected]>
> ---
...
> -enum rx_fsm_state {
> -       RX_STATE_DISABLED = 0,
> -       RX_STATE_HIBERN8 = 1,
> -       RX_STATE_SLEEP = 2,
> -       RX_STATE_STALL = 3,
> -       RX_STATE_LSBURST = 4,
> -       RX_STATE_HSBURST = 5,
> -};
> -
> -enum tx_fsm_state {
> -       TX_STATE_DISABLED = 0,
> -       TX_STATE_HIBERN8 = 1,
> -       TX_STATE_SLEEP = 2,
> -       TX_STATE_STALL = 3,
> -       TX_STATE_LSBURST = 4,
> -       TX_STATE_HSBURST = 5,
> -};
> -
>  struct ufshcd_dme_attr_val {
>         u32 attr_sel;
>         u32 mib_val;
> diff --git a/include/ufs/unipro.h b/include/ufs/unipro.h
> index 9c168703b104..bf063edc284d 100644
> --- a/include/ufs/unipro.h
> +++ b/include/ufs/unipro.h
> @@ -466,4 +466,23 @@ enum {
>         CPORT_CONNECTED,
>  };
>
> +/* Tx/Rx FSM state */
> +enum ufs_rx_fsm_state {
> +       RX_STATE_DISABLED = 0,
> +       RX_STATE_HIBERN8 = 1,
> +       RX_STATE_SLEEP = 2,
> +       RX_STATE_STALL = 3,
> +       RX_STATE_LSBURST = 4,
> +       RX_STATE_HSBURST = 5,
> +};
> +
> +enum ufs_tx_fsm_state {
> +       TX_STATE_DISABLED = 0,
> +       TX_STATE_HIBERN8 = 1,
> +       TX_STATE_SLEEP = 2,
> +       TX_STATE_STALL = 3,
> +       TX_STATE_LSBURST = 4,
> +       TX_STATE_HSBURST = 5,
> +};

Suppose ref RX(TX)_FSM_State in mipi m-phy speci v6.0, table 50 M-RX status
attributes. you add ref to mipi M-phy to let reader know it is really
defined by spec, not dwc implementation.

Both value are the same, why need define two copy.

Frank

> +
>  #endif /* _UNIPRO_H_ */
> --
> 2.43.0
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.