drm/amdgpu: only set restart on first cmd of the smu i2c transaction
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 22 Jan 2021 04:56:32 +0000 (23:56 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 1 Jul 2021 04:24:39 +0000 (00:24 -0400)
Not sure how the firmware interprets these.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c

index 2cc6c65..945e25d 100644 (file)
@@ -1984,7 +1984,7 @@ static int arcturus_i2c_xfer(struct i2c_adapter *i2c_adap,
                        if ((msg[i].flags & I2C_M_STOP) ||
                            (!remaining_bytes))
                                cmd->CmdConfig |= CMDCONFIG_STOP_MASK;
-                       if ((i > 0) && !(msg[i].flags & I2C_M_NOSTART))
+                       if ((i > 0) && (j == 0) && !(msg[i].flags & I2C_M_NOSTART))
                                cmd->CmdConfig |= CMDCONFIG_RESTART_BIT;
                }
        }
index 049d05d..b6a2393 100644 (file)
@@ -2783,7 +2783,7 @@ static int navi10_i2c_xfer(struct i2c_adapter *i2c_adap,
                        if ((msg[i].flags & I2C_M_STOP) ||
                            (!remaining_bytes))
                                cmd->CmdConfig |= CMDCONFIG_STOP_MASK;
-                       if ((i > 0) && !(msg[i].flags & I2C_M_NOSTART))
+                       if ((i > 0) && (j == 0) && !(msg[i].flags & I2C_M_NOSTART))
                                cmd->CmdConfig |= CMDCONFIG_RESTART_BIT;
                }
        }
index 1d06641..9e49505 100644 (file)
@@ -3490,7 +3490,7 @@ static int sienna_cichlid_i2c_xfer(struct i2c_adapter *i2c_adap,
                        if ((msg[i].flags & I2C_M_STOP) ||
                            (!remaining_bytes))
                                cmd->CmdConfig |= CMDCONFIG_STOP_MASK;
-                       if ((i > 0) && !(msg[i].flags & I2C_M_NOSTART))
+                       if ((i > 0) && (j == 0) && !(msg[i].flags & I2C_M_NOSTART))
                                cmd->CmdConfig |= CMDCONFIG_RESTART_BIT;
                }
        }