From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.148 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796048377; b=Bje2/H6tsgrdp+SVdhaL6MWpOz5u3Oc+hqrNdRj2H3CCYqzO6uxEUrt7yD0obL0GlnX6 V1km4x9yt+abunXGd9xJ1mHoKK+uBPjTLY4n7tBXZVZQ+sIyQYfv5pRl6wS6pPSEZqw4b 5sZrz99v7oj3D56iVfnNNkyVJ6KdvRhwX0DSMl4B7eDTSgq4BUEAtCINepPu3TkBWlas5 Oj3uY7M11Qy9KwMcrzaFy8pgbwU3DO5gr0C0HFuoIfPMLv3E7K2xDPVlECWJs9IRfR6qO dMxGTZbfIT+rEX+rHq9vj9sbC2V0fCa4j0TiyXBOsLOI6pDzVLie5iuM+IyHTHTn3cg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796048377; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=1m78Zn5Q4wckBntcz1Ci/TnX+XDTgB3KhglGZK9Ayuo=; b=zRY8fdn9CEjuNcm9S8k5cHmUC4Dl4BCSGvZHB91xQH04qlw0GGoyphUFxOAZ08vKEnny FIWxiP+MPBzxtfHeD1z9ADY2D9xLodTz37Nskw49syx0IWaWr9sXj6JaTAmG+LBUlwyfH +OmWNAv17OOptnixgQyaGTPrXemGhZzvoKrqq34Nl0zYby81QygVQmoHucE+rETEfyno5 l2GALd5FLCVydGj3wXX6yX3P6id9VWfCO4wjoiaqpLJ0pQMV610HQCtQDBo7iw4e3+Yg8 rC3uuB/eO5bLMFnHUgEwfIYZg48h7O03/oFuThUrR+vLKWW3lthjwXkSZlcHT8DUVaA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=jannau.net; spf=pass smtp.mailfrom=jannau.net; dkim=pass header.d=jannau.net header.i=@jannau.net header.a=rsa-sha256 header.s=fm2 header.b=VMDQp9JQ; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=i9QLW9jG; arc=none smtp.remote-ip=103.168.172.148 Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 640A5606A327 for ; Mon, 30 Nov 2026 14:19:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 640A5606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jannau.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=jannau.net header.i=@jannau.net header.a=rsa-sha256 header.s=fm2 header.b=VMDQp9JQ; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=i9QLW9jG Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 4DDECEC5C9D for ; Mon, 30 Nov 2026 09:19:30 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 30 Nov 2026 09:19:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jannau.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1796048370; x=1796134770; bh=1m78Zn5Q4wckBntcz1Ci/TnX+XDTgB3KhglGZK9Ayuo=; b= VMDQp9JQ9slHUZMjx/R0KcT7ivPjFx4v6t2k+/VudZvQEpAst8E6eSzgzHeGCT31 MaS1ZYpMctvMez/4dhbHHiRq5vM8SdxE7X66Lsg1GfNH5vAX+PL9O+r+bvWqGZex NTWZEq3r/m2aYGv8e0APBvI6NUvFhVKDKWTxuBjbdpHzCQF42KYoyElYcVOdHwUF 2k9deblmcud6CF+cBTgwilzyXNJRuEINvI9UMLuY/In+5oLNAQMe1JKEI0I2i+90 jJbEFzppfy7bvkksm7ZwCvkEy9Wz8KcGNqEPfwU19VZnbojOET1uLIoZ5WA28kPo 3dKwVUtxdBHaBCk0MR8FNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796048370; x= 1796134770; bh=1m78Zn5Q4wckBntcz1Ci/TnX+XDTgB3KhglGZK9Ayuo=; b=i 9QLW9jGHn4kmveuNUqUmGRceB+jPP6BgYO9F1Iyl55E53u9QDsT8P/Ne+gy+v4To UbO4oRjF4lHXVMHg/A1wIDb4igGihUcS0oMUvLb7WIpa26/JZsu8VkmRTEn4v0y2 jb+zc/TH53hWVsnFUXpJRvfXWYNauzTVUwUPR7PRT/IlvHFdv9L3ZgADW/mNL9Qp dwI6FV6bf26z2MR5/zJd+Tv5FoOhIdkXS7MFc1/53eric2AMeVsJiQrh6+tPCDJ1 ZHlcBRxNeyX6+Og1W1okwBn6KrmyCSHlA4XGEZr0TDX4vPNsIF0uTLxYqxKRIjlL FnrSFLJokP8z/2OsAbeuA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=jannau.net a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796048370; d=jannau.net; mf=PGpAamFubmF1Lm5ldD4=; rt=PG5vdmEtZ3B1QGxpc3RzLmxpbnV4LmRldj4=; s=fm2:rsa-sha256:Sz/WwdNU8Ylf2TIBIYgZqqGeLHRkbFWyq/VCcFQlloxrA2c NjQ94tSqnZWFHekksDM7p3tQgFpXGLD17goL4gylUMK2oBTsi2pwUi+IjoRPitE3 TXbo7tnGh2eYBAum82jSwjpTbMMsby0sU1NlD6hsqtwkPjGZ5svW/qnz2E8Ual3/ 9evHVRA8xH4cggQ7oOpKHWwmE9uOPOb+14s/3XWSWIfh72LovpMAg4exBfM3/HdQ iyI8mPqpkYngVWDlhwVV8iz/w5ObCZ+nkdHdgxOvx7vuNQ6G8dUUKzswH8ayHz+C GNvvAfgDpNAI4ozCeX780FciLCzJ9pv3aH7x2JQ==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=13; hn=cc,content-disposition,content-transfer-encoding, content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to; Message-Instance: m=1; h=sha256:uIRkuvt+wzeO6vKmaTZlyHEKwdegdiPKnx8YjYV1dcg=:E/NEtkj3V4uI24dk5MvMcmgAdH6KDxTWvpe34ySrMVI=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTF07FGzDuFqTq0JI4uVybVN74Z0DXOlQhsa9ss9xTlgdDaNEsf7VepRlpbbN39VJe mMQ1oKLYiM4V1Qw/2ji6lKJenv2BWvWj7/mmoDt0x5naKHIir+/I6O4joGPcfx0jqUHVk4 QWCwQ3U16+FqhmWrYYNTPM0l66zuDUO1rDNbJQxiDLlnWLqbuWUuvODhOT1YKfitwLFjvm 5xbUSaI68VOHoS9rFvdLp7vMABFCjw1ynEQmQXFHRjxMdckelTiiNA1SR2F6rBTr0a7qNC AUplAoc7M9jXuJWodPWlWC2TpG1GF06OeXQKZXSTMxBB+Y4u+nGzKR98wEqUM8ZfUqyASd SJq92gofteWV6/lKvOTBbO39dn0pV89wGsuhEYdqN0uAbvcj09P8db8jvKeAN8bcVZOth8 VfEjOOrmopFhWfJuUO1J47xSzF1adeP/OPs0OGf7lfzbNQTfTCKtU9LUsDue1XdJbtaveu hU04jj7kykh5cCYcEiDLd5ZGJ+YbJeBUGXMvVdGS7WSGygfq6H81+Yh0hitqvuCjsDOgAJ OlgnZ1alZdOPUs+fU5cKGlPFhJXr+wVreQfp3A3T1HIZfrz1jWGXLMPZUalLjsxNGT0Ixk 4P2d28bVXdcQNZjkCgNe7bsZq6gxVn5RnKCFwjzhbPbPuo3j3TcVhrtaovZg X-ME-Proxy: Feedback-ID: i47b949f6:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Nov 2026 09:19:29 -0500 (EST) Date: Mon, 30 Nov 2026 15:19:27 +0100 From: Janne Grunau To: Alice Ryhl Cc: Miguel Ojeda , Danilo Krummrich , Daniel Almeida , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Tamir Duberstein , Alexandre Courbot , Onur =?utf-8?B?w5Z6a2Fu?= , nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH 1/2] rust: drm: ioctl: return Result from ioctl handlers Message-ID: <20261130141927.GC41778@robin.jannau.net> References: <20261130-drm-ioctl-return-i32-v1-0-2134e8274300@google.com> <20261130-drm-ioctl-return-i32-v1-1-2134e8274300@google.com> X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Nov 30, 2026 at 01:32:18PM +0100, Alice Ryhl wrote: > On Mon, Nov 30, 2026 at 12:48 PM Miguel Ojeda > wrote: > > > > On Mon, Nov 30, 2026 at 11:18 AM Alice Ryhl wrote: > > > > > > While teaching the Rust for Linux course, > > > > Without context, people will not know what course it means. Maybe add > > the company name? > > Yeah I worded this "my" elsewhere but forgot to do so here. > > > > integer, so it's not clear what values about i32::MAX would mean. > > > > "above" > > > > > This means that there are two ways of returning a > > > negative value to userspace (either Err(err) or Ok(-x)), and that > > > userspace cannot distinguish whether the driver did one or the other. > > > > Yeah, I am not thrilled about having two ways that look different but > > do the same. > > Well, I don't think the current behavior that has errornous behavior > is great either. Perhaps we can just return Result<()>, but I am not > sure if any DRM drivers actually need non-zero return value. drm_ioctl() is annotated to return "Zero on success, negative error code on failure." [1] so it should be safe to switch to Result<()>. I verified that it's true for the asahi downstream driver. A quick verification of panthor's (and nouveau's?) ioctl wouldn't hurt but I'd be surprised if those return values other than 0 on success. So it should be safe to return Result<()> at least for now but I wouldn't expect this to change. The drm_ioctl implementation had since forever (the git root commit in 2005) a debug log statement on non-zero ioctl return values. Janne Link: https://www.kernel.org/doc/html/v4.11/gpu/drm-internals.html#c.drm_ioctl [1]