mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] nfc: pn533: fix hung task on stalled USB send
@ 2026-10-27  7:01 Zhao Feng
  2026-10-27  7:01 ` [PATCH v2 1/2] nfc: pn533: complete failed queued commands and keep queue moving Zhao Feng
  2026-10-27  7:01 ` [PATCH v2 2/2] nfc: pn533: add timeout to USB frame send completion wait Zhao Feng
  0 siblings, 2 replies; 6+ messages in thread
From: Zhao Feng @ 2026-10-27  7:01 UTC (permalink / raw)
  To: netdev
  Cc: krzysztof.kozlowski, linux-kernel, syzbot+1c5368988052dc2d8201,
	Zhao Feng

The out URB wait in pn533_usb_send_frame() is unbounded, so a device
that never completes the transfer hangs the task holding the command
lock (syzbot report).  Simply adding a timeout is not enough, because
the error path of pn533_wq_cmd() cannot deal with a send failure: it
drops the queued command without completing it, leaving synchronous
callers asleep forever and the command queue frozen.

Patch 1 fixes that pre-existing error path; patch 2 then adds the
actual send timeout, handling the race where the transfer completes
right between the timeout expiring and the URB being killed.

Issues pointed out by the Sashiko AI review of v1.

Link to v1: https://lore.kernel.org/netdev/20261023025602.1746-1-zhaofeng2@cmss.chinamobile.com/

Zhao Feng (2):
  nfc: pn533: complete failed queued commands and keep queue moving
  nfc: pn533: add timeout to USB frame send completion wait

 drivers/nfc/pn533/pn533.c |  8 +++++++-
 drivers/nfc/pn533/usb.c   | 20 ++++++++++++++++----
 2 files changed, 23 insertions(+), 5 deletions(-)

-- 
2.39.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-29  2:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27  7:01 [PATCH v2 0/2] nfc: pn533: fix hung task on stalled USB send Zhao Feng
2026-10-27  7:01 ` [PATCH v2 1/2] nfc: pn533: complete failed queued commands and keep queue moving Zhao Feng
2026-10-28 15:40   ` Simon Horman
2026-10-29  2:02   ` Zhao Feng
2026-10-27  7:01 ` [PATCH v2 2/2] nfc: pn533: add timeout to USB frame send completion wait Zhao Feng
2026-10-28 15:40   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®