From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEC40480941 for ; Mon, 19 Oct 2026 04:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792384657; cv=none; b=k8zYkL3Wc0nlGllumKZBX2+aNdbE2Xs4+7b+CULLbKhFN/Ga5fI1yyBixjS50M3fQ8beWbyERfOKgR83M+modXH9n0w0syBVF17x4Jl7TDsTkwhFn1PhLcHg/f2+RECq4ebxRUfK2+r/dYbw9gI4k4WF3aKQSvNYPv8rIn0P/Mg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792384657; c=relaxed/simple; bh=nrSw7454Yde/Xd9a5ZeyoU3us508jOrB5rWc9Varruc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date; b=d8d/CSSQ9lJTtE3v3gA8s7AfTNmLplZxbio17AFzCygwV4Hu17wUxFlEhgjDzV4RLk1Fe0mlZPWxwhTtQr51xH6zPmvEooZy89hLNho7ntc/rJwVZwZyy6QD/MKH152LYhZ2T/IcvPVq1ZXzuTqcqHS+IQ1Cpca58dziFl+55L8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pct28buN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pct28buN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 721E81F000C4; Mon, 19 Oct 2026 04:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792384653; bh=d+qqxLO0uMgUfP0IagOu8i6E4S3pBHSASehhGJyH+S4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Pct28buNLdmszT33OjrkZxssR1Wc+lIkLprI0go3bot1IHKbvvzPngcyWAQgmTueq ewcc8OkDCeu2SUdBQVw9kFxxUHIRoFUbMGBniLTFNVtl9rm5CAYkZOHq4j+Y/7mD8D aiKnsrfQKD5uN6yzm8RuAnRKVXFE+kfqtUikAwtXk7Wa+84iG2zdGFrttiB0USh7eN ezRhh+ES/0qrsRHlGqP700AxB/Ni/MyL9LxK1v3hGVta6d0zLCOXAAs4sLzdd/OmNJ W32nAHyPERlZu5ZixB9MpkU76mqiCYk2kfmG6scikuNSQPjaLiooYvJTewVLrXyBUH IRTrtC9DMksog== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v10 3/3] gpu: nova-core: add ChannelIdPool Reply-To: sashiko-reviews@lists.linux.dev To: "Eliot Courtney" , "Alice Ryhl" , "Burak Emir" , "Yury Norov" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?b?QmrDtnJuIFJveSBCYXJvbg==?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Danilo Krummrich" , "Daniel Almeida" , "Tamir Duberstein" , "Alexandre Courbot" , =?utf-8?b?T251ciDDlnprYW4=?= , "David Airlie" , "Simona Vetter" Cc: "Greg Kroah-Hartman" , "John Hubbard" , "Alistair Popple" , "Timur Tabi" , "Zhi Wang" , nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org In-Reply-To: <20261019-chid-v10-3-67de9180b4ed@nvidia.com> References: <20261019-chid-v10-0-67de9180b4ed@nvidia.com> <20261019-chid-v10-3-67de9180b4ed@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Oct 2026 04:37:32 +0000 Precedence: bulk X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] gpu: nova-core: call to missing IdPool::reserve_ids() and release_i= ds() -- commit 086e60d9f7e7ac9b6628a571ed585382eb5212a9 Author: Eliot Courtney gpu: nova-core: add ChannelIdPool This commit introduces ChannelIdPool on top of IdPool to automatically track and release contiguous ranges of channel IDs for nova-core. Link: https://lore.kernel.org/all/84bc8bd2-e292-4b84-9580-a1b5df4c5bdc@nvid= ia.com/ # [1] Link: https://lore.kernel.org/all/20260710-chid-maple-v1-1-4ee869055268@nvi= dia.com/ # [2] Link: https://lore.kernel.org/all/20260717053241.916441-1-ynorov@nvidia.com= / # [3] > diff --git a/drivers/gpu/nova-core/gpu/channel.rs b/drivers/gpu/nova-core= /gpu/channel.rs > new file mode 100644 > index 0000000000000..485efaba059d9 > --- /dev/null > +++ b/drivers/gpu/nova-core/gpu/channel.rs > @@ -0,0 +1,198 @@ [ ... ] > +impl ChannelIdPool { > + /// Creates a pool managing `num_chids` channel IDs. > + pub(crate) fn new(num_chids: NonZero) -> impl PinInit { > + try_pin_init!(Self { > + inner <- new_mutex!(IdPool::with_capacity(num_chids.get(), G= FP_KERNEL)?), > + }) > + } > + > + /// Reserves a contiguous area of `count` channel IDs starting at a = multiple of `align`, > + /// returning a guard that releases the area on drop. > + pub(crate) fn reserve_ids( > + &self, > + count: NonZero, > + align: Alignment, > + ) -> Result> { > + let mut ids =3D self.inner.lock(); > + let range =3D ids.reserve_ids(0, count, align).ok_or(ENOSPC)?; > + Ok(ChannelIdReservation { pool: self, range }) > + } > +} > + > +/// A reserved contiguous area of channel IDs. > +/// > +/// Releases the whole area back to its [`ChannelIdPool`] when dropped. = Releasing locks a > +/// sleeping [`Mutex`], so the area must be dropped in a context that is= allowed to sleep. > +#[must_use =3D "the channel ID reservation is released immediately when = unused"] > +pub(crate) struct ChannelIdReservation<'a> { > + pool: &'a ChannelIdPool, > + range: Range, > +} > + > +impl Drop for ChannelIdReservation<'_> { > + fn drop(&mut self) { > + self.pool.inner.lock().release_ids(&self.range); > + } > +} [Severity: Low] Does this fail to build under CONFIG_NOVA_CORE due to a missing prerequisite patch for IdPool? In drivers/gpu/nova-core/gpu/channel.rs, ChannelIdPool::reserve_ids() calls ids.reserve_ids(0, count, align), and ::drop() calls release_ids(&self.range). However, in rust/kernel/id_pool.rs, kernel::id_pool::IdPool only defines single-ID operations: pub fn find_unused_id(&mut self, offset: usize) -> Option { self.map.next_zero_bit(offset).map(|id| { self.map.set_bit(id); id }) } pub fn release_id(&mut self, id: usize) { self.map.clear_bit(id); } Neither IdPool::reserve_ids() nor IdPool::release_ids() exists in the tree = yet. [ ... ] --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261019-chid-v10-0= -67de9180b4ed@nvidia.com?part=3D3