Skip to contentSkip to conversation

soundwire: cadence: Write to correct address for each FIFO chunk

PATCH Applied Richard Fitzgerald 3 participants 3 messages Sep 17, 2022 – Sep 20, 2022 SoundWire

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soundwire: cadence: Write to correct address for each FIFO chunk

_cdns_xfer_msg() must add the fragment offset to msg->addr to get the base target address of each FIFO chunk. Otherwise every chunk will be written to the first 32 register addresses.

---
 drivers/soundwire/cadence_master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/cadence_master.c +1 -1
index 3ef472049980..ca241bbeadd9 100644
@@ -569,7 +569,7 @@ _cdns_xfer_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int cmd,
 	}
 
 	base = CDNS_MCP_CMD_BASE;
-	addr = msg->addr;
+	addr = msg->addr + offset;
 
 	for (i = 0; i < count; i++) {
 		data = FIELD_PREP(CDNS_MCP_CMD_DEV_ADDR, msg->dev_num);
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Richard Fitzgerald

_cdns_xfer_msg() must add the fragment offset to msg->addr to get the base target address of each FIFO chunk. Otherwise every chunk will be written to the first 32 register addresses.

---
 drivers/soundwire/cadence_master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/cadence_master.c +0 -0
index 3ef472049980..ca241bbeadd9 100644

drivers/soundwire/cadence_master.c _cdns_xfer_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int cmd, · line 572

Quoted 5 lines
drivers/soundwire/cadence_master.c +1 -1
@@ -569,7 +569,7 @@ _cdns_xfer_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int cmd,
 	}
 
 	base = CDNS_MCP_CMD_BASE;
-	addr = msg->addr;
+	addr = msg->addr + offset;

LGTM, probably means that sending a large command broken in several pieces never worked. D'oh.

Thanks Richard!

Quoted 3 lines
drivers/soundwire/cadence_master.c +0 -0
 	for (i = 0; i < count; i++) {
 		data = FIELD_PREP(CDNS_MCP_CMD_DEV_ADDR, msg->dev_num);
maintainer Applied
#2 lore raw
In reply to Richard Fitzgerald
Quoted 3 lines · Richard Fitzgerald

_cdns_xfer_msg() must add the fragment offset to msg->addr to get the base target address of each FIFO chunk. Otherwise every chunk will be written to the first 32 register addresses.

Applied, thanks

Signature · 1 line
~Vinod