Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,6 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave)
dev_err(&slave->dev,
"SDW_SCP_BUSCLOCK_SCALE_B1 write failed:%d\n", ret);

slave->scale_index = scale_index;
return ret;
Comment on lines 1411 to 1414
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates both cached bank values unconditionally, even when the B1 write failed (and possibly when only one bank was actually programmed). This can desynchronize software state from hardware. Update the cache only for the bank(s) successfully written, and only on success (e.g., after both writes succeed, or set [0]/[1] immediately after each corresponding successful write).

Copilot uses AI. Check for mistakes.
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/soundwire/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,6 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
if (scale_index < 0)
return scale_index;

if (scale_index == slave->scale_index)
continue;

/* Skip the unattached Peripherals */
if (!completion_done(&slave->enumeration_complete)) {
dev_warn(&slave->dev,
Expand All @@ -720,7 +717,6 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
dev_err(&slave->dev, "SDW_SCP_BUSCLOCK_SCALE register write failed\n");
return ret;
}
slave->scale_index = scale_index;
}

manager_runtime:
Expand Down
2 changes: 0 additions & 2 deletions include/linux/soundwire/sdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ struct sdw_slave_ops {
* protocol for SoundWire mockup devices
* @sdw_dev_lock: mutex used to protect callbacks/remove races
* @sdca_data: structure containing all device data for SDCA helpers
* @scale_index: current bus clock scaling index
*/
struct sdw_slave {
struct sdw_slave_id id;
Expand All @@ -687,7 +686,6 @@ struct sdw_slave {
bool is_mockup_device;
struct mutex sdw_dev_lock; /* protect callbacks/remove races */
struct sdca_device_data sdca_data;
unsigned int scale_index;
};

#define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev)
Expand Down
Loading