From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 479741E9B02 for ; Fri, 31 Jan 2025 16:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738341683; cv=none; b=HjkfCjO+WeRVC60uiIgM2bV4P2ksWgUk74YP+FgglroFGN0LnXkkJUPAO/YRuIgb0mBrHxs6kKryKIuioXjqrTtiMrVIVxjLL5SPzPCzrLQ0CLsExqRXwAnTnpp93yoGAdV6e6Xoxi+UaZRuIeMwWko2I87RZpGrXB0OgAS2B/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738341683; c=relaxed/simple; bh=vYqcK28rlnAXUTMWzDVKIWmMxjod4LKRg0bWBlV1A68=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RuMsr71ERLu8RFRUl74zmqrx+aWikUxxzoev6q0MZ4QbKniRVFn2QM6cZDuB3eDD6QGUUSqTN9JkZKFGcnRIh197alZOpNJkL1qZboG2fUdtKByQMV5m9VI6C0M9YseLHoA4dW/qm19yTei5OxL6IMG8hZOFNptlph50Y7G2Qkc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=Uq3KDUFS; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Uq3KDUFS" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1403356f8f.0 for ; Fri, 31 Jan 2025 08:41:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1738341679; x=1738946479; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=fzHjJrpyeP9mqc5JWkuMLQPalXYBqZxzyJtrO92iNow=; b=Uq3KDUFSO0a/LL/NTHQfIpiS46zaXiu5OsGdS0ujUf8UuVw7bs198u5plFv62IOblj V055LAWjdbNmrgoj0F7Mt3pOG37xUXgpxVGn5uY8b6CCYIIUytCZi909kpGbNuVXshlJ f4HkgC2PgwqGNE7nsat8LwvJtX5hXX8VFDb2U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738341679; x=1738946479; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fzHjJrpyeP9mqc5JWkuMLQPalXYBqZxzyJtrO92iNow=; b=LBk/0ifbKOz2YO+oI6GiEf/3ZkelxLEEbio0FfRqwgCR5CsGkC+1R8twvgqvNRzh9+ x2EG8T3+sHKmMspnXdN9NXq2XsqCYrejAYfNcE4gHdte8XCYwlMdwKj1IDCYJVOEHO0g afwJDhsgR8/ed/DYuydjZpsrjENCD6hkukZn8JeOWkyptw4xtc4apwEbOmxJ8yCJWFlg oL0npWqJuFAi8LvPDtHqTUm8MhB0sbaqUkxnoZEuaOqiGc4w6dLSUnT6AUpcbkwORHZA 50/tFWI30VmhEkN/rKX+nYd8dsNEvsInssZ5G8fN5gceCxdU6Dwzvje5u6WygJvI+faF 2ohA== X-Forwarded-Encrypted: i=1; AJvYcCXaOZYPibW314RPgFNUK84sP/Mmt6yh4DH/QZ7HG7qNX9cGtVebRUAGFCr0SuRoFIDi7e4hI93L3nYh9MUrnw==@vger.kernel.org X-Gm-Message-State: AOJu0YymKfwffvfGrT2jQTOcbfaxJTcODfG55tQBiK8BKACATzHKgyXF gM+46+aU+Ofd/V1NZwyBbHm3GzTn+ICpW8BNmzIeDsY/7i+ij+/KP+wp95XelbA= X-Gm-Gg: ASbGncsf5DqXqvosdLJgJw5EBocHOElIMb/91NRbOUVxoRfIfV8pithE7obiymvxhcC 1jdN9zPSd+mstRugXhVDMdAUs7aHYmoup4h1wXutYjP7s8rL+fK5kRSBXVD8hgmbGjRD9bCu7Nj M+rrAwF10n2nTEODFV24QYBjHYfGX/DIg4ivXLm21O2XXzGtmq/Uo1mUun48oSM6EwssGHlW3lk LsraejD2I+w8L0/Bhus7R+VDbHNVMqaOjbRuyIM2i3YBTnXnS8+meHi+srVabJC3RXdgEnAbtQj 2YsPoKyGdbKPrIR7Y/ye+30P5BI= X-Google-Smtp-Source: AGHT+IGGDNp58bJr6qYY2kJIlfhFeC89Du/2iP4Ei/5xa7Mm39ysUYRti1e2Tbipv2p0tujjvYi4wA== X-Received: by 2002:a5d:6d08:0:b0:388:c61d:4415 with SMTP id ffacd0b85a97d-38c5a99037emr6251050f8f.18.1738341679367; Fri, 31 Jan 2025 08:41:19 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:5485:d4b2:c087:b497]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c5c1b5edasm4973797f8f.80.2025.01.31.08.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2025 08:41:18 -0800 (PST) Date: Fri, 31 Jan 2025 17:41:16 +0100 From: Simona Vetter To: Danilo Krummrich Cc: Lyude Paul , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, =?iso-8859-1?Q?Ma=EDra?= Canal , "Rafael J. Wysocki" , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross Subject: Re: [PATCH 2/2] rust/kernel: Add platform::ModuleDevice Message-ID: Mail-Followup-To: Danilo Krummrich , Lyude Paul , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, =?iso-8859-1?Q?Ma=EDra?= Canal , "Rafael J. Wysocki" , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross References: <20250122235340.2145383-1-lyude@redhat.com> <20250122235340.2145383-3-lyude@redhat.com> <2025012329-candied-walk-f57d@gregkh> <0bb7270e879ae3a40d4e5500f9a7992563a68d9f.camel@redhat.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 6.12.11-amd64 On Fri, Jan 24, 2025 at 12:02:38PM +0100, Danilo Krummrich wrote: > On Thu, Jan 23, 2025 at 07:33:28PM -0500, Lyude Paul wrote: > > On Thu, 2025-01-23 at 07:23 +0100, Greg Kroah-Hartman wrote: > > > On Wed, Jan 22, 2025 at 06:49:22PM -0500, Lyude Paul wrote: > > > > > > And modules are code, not data. Let's not start to even attempt to tie > > > lifetimes of device structures to module code, that way lies madness and > > > rolls back the work we did decades ago to split the two apart :) > > > > To make sure I'm understanding you properly, by "are code not data" you're > > suggesting that resources (devices, driver registrations, etc.) should have > > their lifetime entirely managed by the kernel and not as part of the module > > data structure correct? > > I think that's two different things. > > Driver registrations are bound to the module lifetime and in Rust, where we have > a structure that represents the module lifetime, driver registrations are part > of the module structure. That's fine. > > Device are more of a concern here, since they ideally orginate from real > hardware and hence shouldn't be bound to a module lifetime. > > I think a virtual device would need to be an exception though. What else, if not > the module should define its lifetime? Yeah for virtual devices this should be possible I think. We do have plans for vkms to gain configfs support, and then maybe the current device wouldn't be needed anymore and we'd just register the configfs when loading the module. -Sima -- Simona Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch