RE: [PATCH v1 1/1] i2c: mlxbf: Use readl_poll_timeout_atomic() for polling

From: Asmaa Mnebhi
Date: Thu Mar 30 2023 - 17:11:47 EST


LGTM besides the small comment below:

> - /* Check whether the HW is idle */
> - if (WARN_ON(!mlxbf_i2c_smbus_master_wait_for_idle(priv))) {
> + /*
> + * SW must make sure that the SMBus Master GW is idle before
> starting
> + * a transaction. Accordingly, this call polls the Master FSM stop bit;
> + * it returns 0 when the bit is asserted, -ETIMEDOUT if not.

It returns 0 when the bit is cleared, -ETIMEDOUT if not.

> + */
> + ret = readl_poll_timeout_atomic(priv->mst->io + priv->chip-
> >smbus_master_fsm_off,
> + bits, !(bits &
> MLXBF_I2C_SMBUS_MASTER_FSM_STOP_MASK),
> + MLXBF_I2C_POLL_FREQ_IN_USEC,
> MLXBF_I2C_SMBUS_TIMEOUT);
> + if (WARN_ON(ret)) {
> ret = -EBUSY;
> goto out_unlock;