Skip to content

Commit e7f5fd3

Browse files
committed
soundwire: bus: test all write status
In the existing code we don't check all write transactions so may miss the root cause of an issue. Make sure all writes are tested and errors not propagated further. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 6618813 commit e7f5fd3

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

drivers/soundwire/bus.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,12 @@ static int sdw_initialize_slave(struct sdw_slave *slave)
12791279
}
12801280
if (status & SDW_SCP_INT1_BUS_CLASH) {
12811281
dev_warn(&slave->dev, "Bus clash detected before INT mask is enabled\n");
1282-
sdw_write_no_pm(slave, SDW_SCP_INT1, SDW_SCP_INT1_BUS_CLASH);
1282+
ret = sdw_write_no_pm(slave, SDW_SCP_INT1, SDW_SCP_INT1_BUS_CLASH);
1283+
if (ret < 0) {
1284+
dev_err(&slave->dev,
1285+
"SDW_SCP_INT1 write failed:%d\n", ret);
1286+
return ret;
1287+
}
12831288
}
12841289
}
12851290
if ((slave->bus->prop.quirks & SDW_MASTER_QUIRKS_CLEAR_INITIAL_PARITY) &&
@@ -1293,7 +1298,13 @@ static int sdw_initialize_slave(struct sdw_slave *slave)
12931298
}
12941299
if (status & SDW_SCP_INT1_PARITY) {
12951300
dev_warn(&slave->dev, "PARITY error detected before INT mask is enabled\n");
1296-
sdw_write_no_pm(slave, SDW_SCP_INT1, SDW_SCP_INT1_PARITY);
1301+
ret = sdw_write_no_pm(slave, SDW_SCP_INT1, SDW_SCP_INT1_PARITY);
1302+
if (ret < 0) {
1303+
dev_err(&slave->dev,
1304+
"SDW_SCP_INT1 write failed:%d\n", ret);
1305+
return ret;
1306+
}
1307+
12971308
}
12981309
}
12991310

0 commit comments

Comments
 (0)