]> git.baikalelectronics.ru Git - kernel.git/commit
soundwire: cadence: add parity error injection through debugfs
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 8 Sep 2020 13:45:21 +0000 (21:45 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 10 Sep 2020 05:51:05 +0000 (11:21 +0530)
commit5b3691de523c3522ab6ec310b9ba1c7919eec316
tree60d25591d63659cb37339c07b1e3efb580a4ffe4
parent9df8d0316f8a9e94660d0df247817e29ae9780d6
soundwire: cadence: add parity error injection through debugfs

The Cadence IP can inject errors, let's make use of this capability to
test Slave parity error checks.

See e.g. example log where both the master and slave detect the parity
error injected on a dummy read command.

cd /sys/kernel/debug/soundwire/master-1/intel-sdw/
echo 1 > cdns-parity-error-injection

[   44.756249] intel-master sdw-master-1: Parity error
[   44.756313] intel-master sdw-master-1: Msg NACK received
[   44.756366] intel-master sdw-master-1: Msg NACKed for Slave 15
[   44.756375] intel-master sdw-master-1: trf on Slave 15 failed:-5
[   44.756382] intel-master sdw-master-1: parity error injection, read: -5
[   44.756649] rt1308 sdw:1:25d:1308:0: Parity error detected

The code makes sure the Master device is resumed, hence the clock
restarted, before sending a parity error.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200908134521.6781-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/cadence_master.c