public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Wenyuan Li <2063309626@qq.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	gszhai@bjtu.edu.cn, 25125332@bjtu.edu.cn, 25125283@bjtu.edu.cn,
	23120469@bjtu.edu.cn
Subject: Re: [PATCH] nfc: pn533: add error handling for i2c_master_send() in pn533_i2c_send_ack()
Date: Fri, 20 Mar 2026 09:33:32 +0000	[thread overview]
Message-ID: <20260320093332.GC1753385@horms.kernel.org> (raw)
In-Reply-To: <tencent_1F05100756A32EDA9ECB2D342AFE8A3EBA09@qq.com>

On Thu, Mar 19, 2026 at 02:50:05PM +0800, Wenyuan Li wrote:
> In pn533_i2c_send_ack(), the return value of i2c_master_send() is not
> checked. If the I2C transfer fails, the driver continues execution
> without detecting the error, which may lead to incorrect device state
> or silent failures.

I would like to clarify that this patch addresses the silent failures
aspect, but not the potentially incorrect device state aspect. Although,
with notification users may be better able to diagnose that problem.

If so, I agree this patch should be treated as an enhancement
and routed via the net-next tree (the default for Networking patches)
without a fixes tag.

But for reference, it would be better if the tree was targeted like this:

Subject: [PATCH net-next]: ...

> 
> Specifically:
> 1. The ACK may not be sent to the device, leaving it in an undefined state
> 2. The caller (pn533_i2c_abort_cmd()) ignores the return value entirely
> 3. No error logging is provided for debugging
> 
> Fix this by:
> - Adding proper return value check for i2c_master_send()
> - Converting partial sends to -EIO and preserving kernel error codes
> - Adding nfc_err() logging with %pe format for human-readable errors
> - Propagating the error to the caller pn533_i2c_abort_cmd()
> 
> Even if ACK sending fails, the abort procedure continues by scheduling
> cmd_complete_work to ensure userspace is notified, but the error is
> properly logged for debugging.
> 
> Signed-off-by: Wenyuan Li <2063309626@qq.com>

...

  reply	other threads:[~2026-03-20  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  6:50 [PATCH] nfc: pn533: add error handling for i2c_master_send() in pn533_i2c_send_ack() Wenyuan Li
2026-03-20  9:33 ` Simon Horman [this message]
2026-03-24  9:30 ` Paolo Abeni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260320093332.GC1753385@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=2063309626@qq.com \
    --cc=23120469@bjtu.edu.cn \
    --cc=25125283@bjtu.edu.cn \
    --cc=25125332@bjtu.edu.cn \
    --cc=gszhai@bjtu.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox