🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8285

Re: [PATCH v2 1/2] nfc: pn533: complete failed queued commands and keep queue moving

#8285
From: Simon Horman
Date: Wed, 28 Oct 2026 15:40
40 lines
9426 bytes
On Tue, Oct 27, 2026 at 03:01:34PM +0800, Zhao Feng wrote:
> When pn533_wq_cmd() fails to send a queued command it silently drops
> it: the completion callback is never called, cmd_pending stays set and
> cmd_work is never rescheduled.  As a result:
> 
> - a synchronous caller sleeps forever in pn533_send_cmd_sync()'s
>   wait_for_completion();
> - an asynchronous caller is never completed, leaking its callback
>   context (e.g. struct pn533_data_exchange_arg, and the sock_hold()
>   reference for rawsock);
> - cmd_pending stuck at 1 makes every later command queue up without
>   ever being sent, freezing the device until unbind.
> 
> The broken error path is as old as the command queue, but it used to
> require an URB submission error to trigger; a device that stalls the
> OUT endpoint reaches it via the send timeout added by the next patch.
> 
> Call the command's completion callback with the error and reschedule
> cmd_work (unless the callback chained a direct command by returning
> -EINPROGRESS) so that every queued command completes with an error and
> the queue drains instead of freezing.
> 
> Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
> Cc: <stable@vger.kernel.org>

I think this patch also warrants a Fixes tag.

I don't think it's necessary to repost just to address that,
rather you can just respond to this email with the appropriate tag.

Also, I note that this patch did not apply cleanly (using git am)
and thus the CI did not run. I think this is due to minor fuzz -
git am is very fussy about that. I am unsure if there is value in
reposting to address that.

I've looked over the review of v1 and the updates made in v2.
And overall this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID: <20261028154032.GY257209@horms.kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352916-linux-kernel-netdev=dewy.ru
References: <20261027070136.1339-1-zhaofeng2@cmss.chinamobile.com> <20261027070136.1339-2-zhaofeng2@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352916-linux-kernel-netdev=dewy.ru
From: horms@kernel.org (Simon Horman)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 1/2] nfc: pn533: complete failed queued commands and
 keep queue moving
Date: Wed, 28 Oct 2026 15:40:32 +0000
Organization: Usenet Network
Message-ID: <20261028154032.GY257209@horms.kernel.org>
References: <20261027070136.1339-1-zhaofeng2@cmss.chinamobile.com>
 <20261027070136.1339-2-zhaofeng2@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1803456"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:LDTNmecIvLQa2zWina18uKGrfuc= sha256:gZ/w21v4asgIqIGD0XBIGubw2uWhLHNYa3sEajXNKaU=
	sha1:D90i5KRPc2nXF9YMwX6MHIuXQUI= sha256:NFl8chJZFBPY4VRGAA1BESTt2QwnuiFeXKHAadeJMbM=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 08709125C3A; Wed, 28 Oct 2026 18:43:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9FIPbPmR04_W;
	Wed, 28 Oct 2026 18:43:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-352916-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 144BC125C38; Wed, 28 Oct 2026 18:43:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 899B3603079; Wed, 28 Oct 2026 15:40:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793202046;
	b=mSdTy46KaWGDo3FTsGPDyd+J3QcbIpQuHzA+U6nV4m7NdXh+TuqhAblEMtuFnzUEdmmH
	 RQC41vHqzLTU6rKL70j5yj4AneeTQk3ZNW/pac3xXC6EEeU4lJquDfJ3JQqCaacftDtpe
	 r/S26eFAxkZeW47tXmvxVy/Op5fFvuJmavfP6AQr/+Vdj1XF8y9rUCpYOrZNv16f/ejFI
	 W12QIehWYm2Pp/uATYuiM/67VMa3VbunD1fyUgE7kHtd5WEDg76LVHiLYDur+FyfRi4JK
	 Mk3S4tUkkCUVisAClT2W8URBu60TzCgklm7jk3OijZXyClcxN0Yoc640y0gIwq1Nhcg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793202046;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=CqX1Esr4DHlyO93/7HT9V4FPub0OPW5DGyWWWpehH18=;
	b=0io6m7qvnbfNMFnYAA1g+33cDYyFPIXyO1sfrrQOL8fpVyazS5bEsD1rZRJ67dn4FPav
	 ltAaPsMNB+pInivNDoXS1Szh3K/jpABR1QqCp3ZthcrvC0s3i5F9xPCIKFAFpMA5B0H2z
	 DMoCTG+B8QpKTULYDMPo31Z4jSyzS6WaWIYixZNE7mm1N+zmypSgexE5dvqCC23nCe3gp
	 6zkV+XPV3iDfPrmm/YixdRUZnf564AH0F5O1eoqR4Cwd9qWdxAPA1fRl7yesMrAIZFSY9
	 bXGizG8+oM96q9U+P2zbSco/P1e1L9AZwmFtxv+TtowHQImnZxW+zEtOTcJ8KWy9oiQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CUnSWZzg;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D10CB606A327;
	Wed, 28 Oct 2026 15:40:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CUnSWZzg
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793202036;
	b=A/gfFCo/WYDQLWJH95pdUHLjMlzKnzof0BLZ/sikdL7lGvo/Dwo1nqiaoDSpilxRATSR
	 guL6CLwNGXLCv2nZV+Ve63PDTBDmoo2skaFY+gxnLXGRchf7xKW/OAO7yRUaihGGnhEe9
	 2FXZT1vPamvue/6uzlZpN62izXVLUHBhve44sdGtgreAqCOn4Tr6P5R2HrPu/lEsjTX2Z
	 2L5P9D6goVaQzfAJSNtLgEHOpZ9nvoy4iG6VkAf/2QXucg50lfEQDaJyEokZzOJqC8XAg
	 qlIeDWbp4VxwWZbEQfiEO1TBZhsoT5qim/egP027uilj0vicE/AhAKf0tKI/wDvGj1g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793202036;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=CqX1Esr4DHlyO93/7HT9V4FPub0OPW5DGyWWWpehH18=;
	b=MBfZY7wvXQqWVrbK/oRVfHP96CoA4nMA/s8wonOb8fPJACN4WAHePn1A68Brs95uU1IE
	 lJ1VHu4nzAmk4BGE2Geed7TMVDpqQ5x8D1FHWjy7Uqgf8YiiZ2QakmZf+dkh6mT0zI6fZ
	 kC9QnGlsf2EkzYxkxgN06qhMS5dUShO/LwKf/BV9Y0mbP4Ju9R+5LRqnIvUv7R/ucCRE0
	 SxdaZxsvqAu72WZ07nPK2xpezXJs/nDA/RFm2uCnVW3xTgd6+wp+TesS5HNKa3UKMoiP5
	 byEEubVcNFA2+RexZgJjCIaYjQpXfn0RCuYnn6PZTA1SOVgG6BrrIAAsHlgdog38rOw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CUnSWZzg;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4701606A32C;
	Wed, 28 Oct 2026 15:40:35 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65E3C1F01825;
	Wed, 28 Oct 2026 15:40:34 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793202035;
	bh=CqX1Esr4DHlyO93/7HT9V4FPub0OPW5DGyWWWpehH18=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=CUnSWZzgv9LNx0RhwRsO2Pduse14QOTQS5OSuu3QU/QnlR01u+dRylY3chGXUnIeS
	 FUoAJVigwbFrx97/d06slesNYq3TBnn1YyQS52c3JMIxI5v6KKaiGFsqIo5hcRMDxS
	 04u6rleJJmIsfIdgQEecGvmUbs3PZ4qYkXG4rKwvpfFvBdtwh1bi+uIC2lQXecEsDt
	 HfXcL4XpmuI4HXINfTWxHn2neCvJpycbXsb+PK8VqA4w9ngM2NGpB4se+foFTCpfek
	 PiZw2p3rnk9oU2LEWqoMFb/YuxOa9k6smAinE9QaPp4DMqY0WiRPK+Zbzftq9XtSwm
	 57wNxY94CIqAw==
X-Cc: netdev@vger.kernel.org, krzysztof.kozlowski@linaro.org,
	linux-kernel@vger.kernel.org,
	syzbot+1c5368988052dc2d8201@syzkaller.appspotmail.com,
	stable@vger.kernel.org
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261027070136.1339-2-zhaofeng2@cmss.chinamobile.com>