๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24119

Re: [PATCH net-next v5 03/14] dpll: dpllsim: Add configurable pins

#24119
From: netdev-bot+sashiko
Date: Sun, 29 Nov 2026 10:38
76 lines
10468 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In drivers/dpll/dpllsim/dpllsim.h, the comment on struct
  dpllsim_dev::pins and ::num_pins says "Pins in registration order,โ€ฆ

--

dpll: dpllsim: Add configurable pins

This adds configurable pins to the dpllsim driver. Each directory
created under the pins/ configfs group of an instance is a pin with
type, frequency and direction attributes. At live=1 the pins are
validated, ordered, obtained and registered with the DPLL subsystem
after the device.

> diff --git a/drivers/dpll/dpllsim/dpllsim.h b/drivers/dpll/dpllsim/dpllsim.h
> index 0b81bb2f769be..af33afc70cb2e 100644
> --- a/drivers/dpll/dpllsim/dpllsim.h
> +++ b/drivers/dpll/dpllsim/dpllsim.h

[ ... ]

> @@ -27,6 +56,9 @@ struct dpllsim_dev {
>  	 * the live attribute reports, see dpllsim_dev_live().
>  	 */
>  	bool registered;
> +	/* Pins in registration order, valid while @dpll is set */
> +	struct dpllsim_pin **pins;
> +	int num_pins;

[Severity: Low]
This isn't a bug, but does this comment match how deploy and undeploy
handle sim->pins?

dpllsim_dev_deploy() in drivers/dpll/dpllsim/dpll.c sets sim->dpll
first. Only after that does dpllsim_order_pins() allocate sim->pins:

	mutex_lock(&sim->lock);
	sim->dpll = dpll;
	mutex_unlock(&sim->lock);

	err = dpllsim_order_pins(sim);
	if (err)
		goto err_put_dpll;

dpllsim_order_pins() can return -EINVAL before the allocation, for a pin
with an unsupported frequency or a mux pin set as output. It can also
return -ENOMEM when kzalloc_objs() fails. In both cases sim->dpll is set
and sim->pins is NULL until the err_put_dpll unwind clears sim->dpll.

dpllsim_dev_undeploy() has the opposite window. It clears sim->dpll
before it frees sim->pins:

	scoped_guard(mutex, &sim->lock)
		sim->dpll = NULL;

	kfree(sim->pins);
	sim->pins = NULL;
	sim->num_pins = 0;

All current users of sim->pins run inside the deploy/undeploy sequence
under the configfs subsystem mutex. None of them checks
dpllsim_dev_frozen() before walking sim->pins, so nothing breaks at
runtime today.

Should the comment say the array is valid while the device is
registered? Another option is to build sim->pins before sim->dpll is
published.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com
Technical Details
Message-ID: <179594872729.3146.11707362355260083730@kernel.org>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373451-linux-kernel-netdev=dewy.ru
References: <20261125090522.3777494-4-poros@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373451-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 03/14] dpll: dpllsim: Add configurable pins
Date: Sun, 29 Nov 2026 10:38:47 +0000
Organization: Usenet Network
Message-ID: <179594872729.3146.11707362355260083730@kernel.org>
References: <20261125090522.3777494-4-poros@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1150271"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:BaEMuo3jCiGIIpA0V8l4uF4mao0= sha256:CEEgUUWJkjM4LxrUvyX6ht4OoI0VMs6rbDdAQgh7s4o=
	sha1:/2d+7AFaYCG2ZOEki4ZW6hqR+9c= sha256:9EFfFiJsK2MyYqqvfxOKYHmnxVRDiwEvzwVi2dSGOvc=
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 E3595125F96; Sun, 29 Nov 2026 13:39:04 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 1Gjs-LjuAHDP;
	Sun, 29 Nov 2026 13:39:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373451-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id AD3CD125F98; Sun, 29 Nov 2026 13:38:52 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id EB77E2408E; Sun, 29 Nov 2026 10:38:49 +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=1795948729;
	b=4oTCbQ4aeeXonm/eKiz+5dteIpoY98d2erGIre2RiJqvSSPPC33wNbhVPgyB5mFMMGWA
	 QkayCRMVX8p9lvR1i4kz0GUFRoiofiHEkHTRWoCRoGIJX1hqf5FQpSY6P4S9fV+jzHjTQ
	 moiApQRpnGPThizbWzQUXEdcsNX5Rh5YhKbWHCOiU54aRukVbeaFgBOywHR3ECHhQo6t0
	 Yit6XyDinKec2Q02DK/igFPZywJiDDH3Gl4c5d1wK/QchJYUFZ7+LSbPLJ2z/Eij9f430
	 SU7LXJTTNuIEsSLYQ4C7Iq5+Uw7VqsosdOm+30IFfGTvrtmXl1q1DjxMJqt4MqfUItg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795948729;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=aTxOklFIJVEQBRseL0gZeG5evVtlG/mjXus1NMTvpoU=;
	b=tMAww/wjp9ZGjsTQaW4z13130LqgR6g+Ngd206vnRkdylAQ4lKFn7bHFYsNxbZD+Xcj7
	 nLtgtNNSMVsB+IEWI5p0jkMglIxzw5mltvV0cbxXrXg+jQMF7iRFyJ+ZEe9AV6RguJVYU
	 nlPxVWJ3sab0k0e06WJnnUYdEIb1DWBghyoAVz7syFJfOVgGTJru16vD2r0jFsyyg++Gb
	 +VAtviFS1pmcTjZnVwH94xs6otEy5gC5axrnr5Wa9zWKuq+q7dJgmkpA6rcc0rlsWkwRP
	 4ejn7TWf7XJ2P8G/QnC9XpIAZ8mObvofqx0ItI0DEvoiiqoWsQ/Eagm2m1ZTBdn/yhA==
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=Pez4Azvs;
	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 C4114606A31C;
	Sun, 29 Nov 2026 10:38:49 +0000 (UTC)
X-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=Pez4Azvs
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=1795948729;
	b=iAkeFHjOqe2v7TuiLWyQo/EclU+8iHhAGdaUQBZHrdIEv0PYqT2MPE8sO0/pwLZzJgtI
	 xFvhet8viP4usfTdlLZI9YQnFdcEZRoKQDng+yBOBublV6GYbYLIFPBZwAuqo1foMKDrN
	 mAmyciWyOBJCylkQ49r9T5HEahul4pF+RrzEDDN2zyjdM5Ycc+HPxcw8vK2ekpo/4z5Wl
	 vzVGzp8lYgZ72gD1k2i24g5dM0bKgkoN3EWFq1fe+3Ifn3dWThBH/aohWfplplfoZarZy
	 7K4ha8Lp5LSoW9GG2BN5wGIcYNsZ+XWaCZ9aK4onZyNaCz4MmgL8ZCaS/zHlXsESrGA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795948729;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=aTxOklFIJVEQBRseL0gZeG5evVtlG/mjXus1NMTvpoU=;
	b=cJenBDeM9fJPetPbsCmzVKvXIkVgf5R4rMnOm9Ab6OaSYPWnvQD4TZvECxIrrKlI52oH
	 tO3lqwuUVenj8iPALlgpek7xhUFJ12Y4xE1ZqlxgCkwE6n7sQi8PVQaClaPQ2SoLUPkAg
	 ruwfpOMlBmoq+3DV68urjMVPat5vk/6A2lVElei3tRld49c0uqXksyVK/S8Z1gXhmREiv
	 IkNiBW9Jq0fsn26x4YPTX/iyJZmjmwoH/r39oTXPOYaI6tN68QdttR9AlRTR4t406P8yB
	 j7yEbtPAUtPW0pegL4Vs7WZMu14+hbJx/H+FtHxi9FmnNNRGj1gwjwex6U6OBKlnCZg==
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=Pez4Azvs;
	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 E4D3D606A32A;
	Sun, 29 Nov 2026 10:38:48 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8C581F000C1;
	Sun, 29 Nov 2026 10:38:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795948728;
	bh=aTxOklFIJVEQBRseL0gZeG5evVtlG/mjXus1NMTvpoU=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Pez4AzvsxX6wXwiOF75yHodd4KZNG6O5WuWhP0KpYbyF/dgyD+k/Gaw5M9oeUgFWF
	 oc/JXCEUCS05kKNw3J2O1zPpIvC/Y6Rghi5NrzNndLtq8nLfQ21amz9JlxkCV4e9uQ
	 qbq/O3kkyXgTpOj2QVOLb2UEa9pdlojMO7q6zMIoWfdzmBBHfk/PtsYe77VORzkITU
	 qDuKh6pCxVxHXaQ0jiLdiCxB1jZwvsQ5B8+l6WkC5d6Hw+79gGPLziV58rE2Ufjo7L
	 SmwP/qO4yQkgDCjtX2s5gkXIkjuFKC6x5bmwBnv1zfvCY/VKbdeoRp7tNUJWNOgYsx
	 a4mzTUTBBmQ0w==
X-Cc: netdev@vger.kernel.org, ivecera@redhat.com, jiri@nvidia.com,
 corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org,
 rdunlap@infradead.org, jani.nikula@intel.com, vadim.fedorenko@linux.dev,
 arkadiusz.kubalewski@intel.com, jiri@resnulli.us, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
X-In-Reply-To: <20261125090522.3777494-4-poros@redhat.com>
X-sashiko-severity: Low
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