Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796131062; b=Ep5bfkv6K87d8Ye9VomorTgc4lF3MNy628srY3kaefqK7nY5A6fSf0dRfEC0ehf9xsGu BLcFUwii6UIKyeyjkQAEVPrb+CcI1oH+HCgXg+lab+tau1DuAZm3PWnHkuiRvTMAvorik TKTori+Y0/f0CyxoSqyehrXYF4iNMyWAGsMrFP0B4+YLIRYJe26q1CRqHvTNiKgeR06s7 7GqOBYJjYYbBdwlSYuzVV23KBeFthxTKtqmDOubstf8IER5jxoLPb2OZWFiDJS9dmsWKN bUqNl3CwgyKTkbewE4bq7ta28DxMJv09/3JQgFk+0MhTndZe/4YCURfZQMgtQDwySIw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131062; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=DifmPu67TTLEQkcncHgklgvP+9J7dgwEL4lq+ZGVjdI=; b=zE+4iyHeYiiQjnD0OAvgbogBIJ27YGemnDhFzh3LYlt+63IjZcuWQqvst6x3LD8RNyXz ZKcEA7K5uACeZhIk5hzDixCJqbnlfwqpclS3VP5Q9qWMfm1D8UzaLEvnf37YK+2VgBShl 6tyrmvwo7AXt8rzSqblP3Qbpo9C5Of+rxppS9zti213sFzi4BX34V5XneZ/16F1dEiaKL /s9P+Mb+Z001W8nkztHU1/2FWNnP4p84PCzJFw9z6R5EIFxmwRngMwLGtMzF7KvsDf3HJ 82Mg0LWtUJ5fE1oNXhWi5RVMTDAcLlF7C3sH/DpreobP0M8u/s9IMPnR1PTES467JHw== 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=BRxcSK1O; arc=none smtp.remote-ip=100.103.45.18 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 5F86B606A31A for ; Tue, 1 Dec 2026 13:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BRxcSK1O Received: by smtp.kernel.org (Postfix) with ESMTPSA id E271B1F00893; Tue, 1 Dec 2026 13:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796131062; bh=DifmPu67TTLEQkcncHgklgvP+9J7dgwEL4lq+ZGVjdI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=BRxcSK1OVs296RlBINpm0aAnVaANI0+gxX+SvCeHYPjFzmRmBAHgx/SvB4S3g/qGP 1egfGL6I5moBlW0h00zDOpA7vlHsxoCJ90ioEw12uCqXWdma3Hunaf6jWLDXWmURmO QXpWv1+fA8AdFQQKk/esjc8To664Nslzh8nxsS6senVNZr2buy5iJzukslcamdrh+G sGdNcXMqBQQMp3lCC0LT/OX0c3O+Mgs08LKd+m5Jx2qaVNttFEOEnDuDgblqhRtY2C 6rClNz87ak5e8H5fP9iZx12xSH9yT261WCeU5SbAiMKsjcEvncrPBv2iwFQaCiXVbP 22dbFYBdCUgWg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v16 1/4] revocable: Revocable resource management Reply-To: sashiko-reviews@lists.linux.dev To: "Tzung-Bi Shih" Cc: linux-gpio@vger.kernel.org In-Reply-To: <20261201130303.14530-2-tzungbi@kernel.org> References: <20261201130303.14530-1-tzungbi@kernel.org> <20261201130303.14530-2-tzungbi@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 13:17:41 +0000 X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] revocable: exclusive context lock annotations used for shared srcu_struct - [Low] revocable: missing Return section in revocable_init() kernel-doc comment -- commit 50e7a51b025e8180202192107f613bdccc5a9f5b Author: Tzung-Bi Shih revocable: Revocable resource management This commit introduces an SRCU-based revocable resource management primitive that provides safe access to resources that can be asynchronously removed. > diff --git a/drivers/base/revocable.c b/drivers/base/revocable.c > new file mode 100644 > index 0000000000000..a7fcda012f3c6 > --- /dev/null > +++ b/drivers/base/revocable.c > @@ -0,0 +1,305 @@ [ ... ] > +/** > + * revocable_init() - Initialize struct revocable. > + * @rev: The pointer of resource provider. > + * @res: The pointer of resource. > + * > + * This initializes a resource provider handle embedded within another s= truct. > + */ > +int revocable_init(struct revocable *rev, void *res) [Severity: Low] revocable_init() returns an int, but its kernel-doc comment has no Return: section, causing scripts/kernel-doc to warn when run with -Wreturn (such as during W=3D2 builds). [ ... ] > diff --git a/include/linux/revocable.h b/include/linux/revocable.h > new file mode 100644 > index 0000000000000..577ee1a8dc17e > --- /dev/null > +++ b/include/linux/revocable.h > @@ -0,0 +1,220 @@ [ ... ] > +void *revocable_try_access(struct revocable_handle *rh) > + __acquires(&rh->rev->srcu); > +void revocable_withdraw_access(struct revocable_handle *rh) > + __releases(&rh->rev->srcu); > + > +DEFINE_FREE(access_rev, struct revocable_handle *, if (_T) { > + revocable_withdraw_access(_T); > + revocable_handle_destroy(_T); > +}) > + > +#define _revocable_try_access_with(_rev, _rh, _res) \ > + struct revocable_handle _rh; \ > + struct revocable_handle *__UNIQUE_ID(name) __free(access_rev) =3D &_rh;= \ > + \ > + revocable_handle_init(_rev, &_rh); \ > + _res =3D revocable_try_access(&_rh) [Severity: Low] Should revocable_try_access() and revocable_withdraw_access() use __acquires_shared(&rh->rev->srcu) and __releases_shared(&rh->rev->srcu) here and in drivers/base/revocable.c? srcu_read_lock() and srcu_read_unlock() acquire and release srcu_struct in shared mode (__acquires_shared / __releases_shared), so the exclusive __acquires and __releases annotations trigger Clang -Wthread-safety warnings when context analysis is enabled. In addition, _revocable_try_access_with() and _revocable_try_access_with_scoped() call revocable_try_access(&_rh) directly in the caller's scope while relying on DEFINE_FREE(access_rev, ...) to rele= ase the SRCU read lock at scope exit. Because DEFINE_FREE() generates __free_access_rev() with __context_unsafe and no release annotation, Clang context analysis reports &_rh.rev->srcu as still held at the end of the cal= ler scope. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201130303.1453= 0-1-tzungbi@kernel.org?part=3D1