Skip to content

Commit c8a0d6b

Browse files
rfvirgilvinodkoul
authored andcommitted
soundwire: bus: Don't zero page registers after every transaction
Zeroing the page registers at the end of every paged transaction is just overhead (40% overhead on a 1-register access, 25% on a 4-register transaction). According to the spec a peripheral that supports paging should only use the values in the page registers if the address is paged (address bit 15 set). The core SoundWire code always writes the page registers at the start of a paged transaction so there will never be a transaction that uses the stale values from a previous paged transaction. For peripherals that need large amounts of data to be transferred, for example firmware or filter coefficients, the overhead of page register zeroing can become quite significant. Signed-off-by: Richard Fitzgerald <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 3dca1f8 commit c8a0d6b

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

drivers/soundwire/bus.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -247,23 +247,6 @@ static inline int do_transfer_defer(struct sdw_bus *bus,
247247
return ret;
248248
}
249249

250-
static int sdw_reset_page(struct sdw_bus *bus, u16 dev_num)
251-
{
252-
int retry = bus->prop.err_threshold;
253-
enum sdw_command_response resp;
254-
int ret = 0, i;
255-
256-
for (i = 0; i <= retry; i++) {
257-
resp = bus->ops->reset_page_addr(bus, dev_num);
258-
ret = find_response_code(resp);
259-
/* if cmd is ok or ignored return */
260-
if (ret == 0 || ret == -ENODATA)
261-
return ret;
262-
}
263-
264-
return ret;
265-
}
266-
267250
static int sdw_transfer_unlocked(struct sdw_bus *bus, struct sdw_msg *msg)
268251
{
269252
int ret;
@@ -275,9 +258,6 @@ static int sdw_transfer_unlocked(struct sdw_bus *bus, struct sdw_msg *msg)
275258
(msg->flags & SDW_MSG_FLAG_WRITE) ? "write" : "read",
276259
msg->addr, msg->len);
277260

278-
if (msg->page)
279-
sdw_reset_page(bus, msg->dev_num);
280-
281261
return ret;
282262
}
283263

@@ -352,9 +332,6 @@ int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg,
352332
dev_err(bus->dev, "Defer trf on Slave %d failed:%d\n",
353333
msg->dev_num, ret);
354334

355-
if (msg->page)
356-
sdw_reset_page(bus, msg->dev_num);
357-
358335
return ret;
359336
}
360337

0 commit comments

Comments
 (0)