提交 3f89fea3 编写于 作者: T Thierry Escande 提交者: Samuel Ortiz

NFC: digital: Rework error handling in DEP_RES response

The Digital Protocol stack used to send a NACK frame whatever the error
type it receives in digital_in_recv_dep_res(). It actually should only
send a NACK frame on CRC or parity check errors or on any transmission
error if a NACK frame was previously sent. Existing drivers used to send
EIO error for this kind of issues so this patch limits sending of NACK
frames on EIO errors. All other errors will be reported to the upper
layers.
Signed-off-by: NThierry Escande <thierry.escande@collabora.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 b7769344
......@@ -664,7 +664,7 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
rc = PTR_ERR(resp);
resp = NULL;
if (((rc != -ETIMEDOUT) || ddev->nack_count) &&
if ((rc == -EIO || (rc == -ETIMEDOUT && ddev->nack_count)) &&
(ddev->nack_count++ < DIGITAL_NFC_DEP_N_RETRY_NACK)) {
ddev->atn_count = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册