[PATCH 03/10] ufs: host: Add common Hibern8 TX FSM polling helper

Bart Van Assche bvanassche at acm.org
Wed Aug 26 08:33:38 PDT 2026


On 8/26/26 6:40 AM, Larisa Grigore wrote:
> +	for (i = 0; i < num_lanes; i++) {
> +		err = ufshcd_dme_get(hba,
> +				UIC_ARG_MIB_SEL(TX_FSM_STATE,
> +					UIC_ARG_MPHY_TX_GEN_SEL_INDEX(i)),
> +				&tx_fsm_val);
> +		if (err) {
> +			dev_err(hba->dev,
> +					"%s: unable to get TX_FSM_STATE for lane %u, err %d\n",
> +					__func__, i, err);
> +			return err;
> +		}
> +
> +		if (tx_fsm_val != TX_STATE_HIBERN8) {
> +			dev_err(hba->dev,
> +					"%s: timeout waiting for lane %u to enter HIBERN8, TX_FSM_STATE=%u\n",
> +					__func__, i, tx_fsm_val);
> +			return -ETIMEDOUT;
> +		}
> +	}
Instead of duplicating this code block, please move it into a new
function.

Thanks,

Bart.



More information about the linux-arm-kernel mailing list