]> git.baikalelectronics.ru Git - kernel.git/commit
soundwire: cadence: fix ACK/NAK handling
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 15 Jan 2021 05:37:37 +0000 (13:37 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 19 Jan 2021 14:57:34 +0000 (20:27 +0530)
commit812c847babaf597a6cfee4769d2bf5a3274000b3
tree1f2259b5290ed83d3a18462d79a360b2813c8ebc
parent00b638a1e65e22ee91c4f849c7b56ab33744e7ac
soundwire: cadence: fix ACK/NAK handling

The existing code reports a NAK only when ACK=0
This is not aligned with the SoundWire 1.x specifications.

Table 32 in the SoundWire 1.2 specification shows that a Device shall
not set NAK=1 if ACK=1. But Table 33 shows the Combined Response
may very well be NAK=1/ACK=1, e.g. if another Device than the one
addressed reports a parity error.

NAK=1 signals a 'Command_Aborted', regardless of the ACK bit value.

Move the tests for NAK so that the NAK=1/ACK=1 combination is properly
detected according to the specification.

Fixes: 5541a3862e338 ('soundwire: cdns: Add sdw_master_ops and IO transfer support')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210115053738.22630-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/cadence_master.c