soundwire: bus: Don't zero page registers after every transaction
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Mon, 23 Jan 2023 16:49:48 +0000 (16:49 +0000)
committerVinod Koul <vkoul@kernel.org>
Tue, 31 Jan 2023 12:06:13 +0000 (17:36 +0530)
commitc8a0d6b256dfc54c6ee5f2d16706219ccedcb856
treebbab3122ddb9d679e927221a5888f145bf2c5a88
parent3dca1f89ae3455963d7b53245ecf298ea9bae857
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 <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230123164949.245898-2-rf@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c