提交 159426eb 编写于 作者: P Pierre-Louis Bossart 提交者: Zheng Zengkai

soundwire: cadence: fix ACK/NAK handling

stable inclusion
from stable-5.10.20
commit 7c0c9081f81691e9649413ed7daef56b9b707e60
bugzilla: 50608

--------------------------------

[ Upstream commit db9d9f94 ]

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: 956baa19 ('soundwire: cdns: Add sdw_master_ops and IO transfer support')
Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: NBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210115053738.22630-5-yung-chuan.liao@linux.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 df79df20
...@@ -484,12 +484,12 @@ cdns_fill_msg_resp(struct sdw_cdns *cdns, ...@@ -484,12 +484,12 @@ cdns_fill_msg_resp(struct sdw_cdns *cdns,
if (!(cdns->response_buf[i] & CDNS_MCP_RESP_ACK)) { if (!(cdns->response_buf[i] & CDNS_MCP_RESP_ACK)) {
no_ack = 1; no_ack = 1;
dev_dbg_ratelimited(cdns->dev, "Msg Ack not received\n"); dev_dbg_ratelimited(cdns->dev, "Msg Ack not received\n");
}
if (cdns->response_buf[i] & CDNS_MCP_RESP_NACK) { if (cdns->response_buf[i] & CDNS_MCP_RESP_NACK) {
nack = 1; nack = 1;
dev_err_ratelimited(cdns->dev, "Msg NACK received\n"); dev_err_ratelimited(cdns->dev, "Msg NACK received\n");
} }
} }
}
if (nack) { if (nack) {
dev_err_ratelimited(cdns->dev, "Msg NACKed for Slave %d\n", msg->dev_num); dev_err_ratelimited(cdns->dev, "Msg NACKed for Slave %d\n", msg->dev_num);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册