From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 5A4D2325729 for ; Fri, 6 Feb 2026 16:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770395467; cv=none; b=kWU7SvmQXifIduKJ3tf/tQ2teIdGpxCVwton19id7BiL1tvscStAOugKogEVP0yQUqk4yfdDTmCZxkEWW7JqGgn3RIFAz+v5E+ddzmdSQfmO/IfwR2St9dKqORd3IJgQXN29BoW3dITRImedOeVdAtESgc+NE1oVDiR1f5weXF4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770395467; c=relaxed/simple; bh=2wwgwWCzkU1/uJtgqBNz6l48jquoQD3I3uL/trcljCc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ZXk+ybLPvO0buamwSXClzxgzxYSIotKkEoy4vGMndePx+bELYRdY6ixTufJ6WoT029uMOztfg5JMu4pSUYYEu/zCu0xjus2m796V4rd8/h7pQALH8Quf+n6KrAoDBf/1bdXkhFZ17fkWWwMR9wTMgOf/hwKtUE+U/gIXXeqtJnA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=d6fenC/H; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d6fenC/H" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-482eec44485so19369495e9.3 for ; Fri, 06 Feb 2026 08:31:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770395466; x=1771000266; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ExqTOkqsO8eK7E0o5abiZmMLMVjxuERqrY13GtOt0ak=; b=d6fenC/HQ0F93MBggZCZGIzndN5dFscRpWGYDPhg8KKTuuetADn7WAIcPFoRNyzkUS yhQy9oEPHDw3z40tjf5aLBBH8dsAKShqcZEkpPiOiwgO74Zz1XWbc9wKmCg8l3or81Y7 EZLUPue5EVVrk458mlaRQqE1UJCiy8hKBnApvzjtWfsynASK/1T7n7OIByEYqLvrj0Jv Z2XjiZC5NAp4Pil/UfWMAYZSMu/Cujt4nJkX0K1rKjNeZ/p5EplBSjACbEWx1le17t6Z R4YJxBz8Zlb2taH1hv/x0rZqGrQxyfRbPXI9UuC1rHoe8bXfJsKQI2kaYGpVgraf2tM4 7Esg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770395466; x=1771000266; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ExqTOkqsO8eK7E0o5abiZmMLMVjxuERqrY13GtOt0ak=; b=aK/1mq4n9bYZosK9nc3K8QFkpJEJXWFccjOINHgV4WO85dZV9NypmjUioLaLPPiHb3 aJBREkofRbuk+2x6jrMBSL91N5ELABxvS9gtnaXmZRarVX2vI2s/NL6/5c7q6SgaqBhO 7o1MBvkZ+WomIuifQsMNltJmdiJ9m2syYpnTMMB3L52b2w9hevXl6MmKmUyqZW+qRy2B Xju6lMNvrEUyn8gU/YGoolEnqTGhcX2CfTE7Z9CqdQWNQU+UuHgHfOBcFrJm2OnSA9Cd 0TGhc01yc/aF45mL4Feyp/sETIoVr5/mJlhReEb4huefPlo8a8mCZlS/nt9CJNer9H9V kryA== X-Forwarded-Encrypted: i=1; AJvYcCWttK5+Q+/YYhiowhLHqoV0IMmSsA5ZwQffhcfoH2xJwkNbHhwLqn90VA386Ref/FNlRLtvfLKfxMZi76I=@vger.kernel.org X-Gm-Message-State: AOJu0YxpDI72ezy3C1UT1Rk6m5qoSd1E7lKlDHRUfGH7/M+9k/Kf7J7D wyOfERqxxSQZEPMRr4BmaSjivOOKsviw0d3mdiVdsurqLrhybWf4TmUoV81PCF5V4G7OYUecFAr tc5GUct7HrfNCWGR+7A== X-Received: from wmjf11.prod.google.com ([2002:a7b:cd0b:0:b0:47a:8fa6:6a57]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8489:b0:477:73e9:dc17 with SMTP id 5b1f17b1804b1-48320229cdamr51034695e9.35.1770395465775; Fri, 06 Feb 2026 08:31:05 -0800 (PST) Date: Fri, 6 Feb 2026 16:31:04 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <2026020633-democrat-moisten-631a@gregkh> <2026020642-consent-showman-25a8@gregkh> <2026020616-hardhat-french-4dac@gregkh> <2026020633-foe-etching-e464@gregkh> Message-ID: Subject: Re: [PATCH 2/5] devres: export devres_node_init() and devres_node_add() From: Alice Ryhl To: Greg KH Cc: Danilo Krummrich , Matthew Maurer , rafael@kernel.org, ojeda@kernel.org, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Fri, Feb 06, 2026 at 03:09:09PM +0000, Alice Ryhl wrote: > On Fri, Feb 06, 2026 at 02:55:50PM +0100, Greg KH wrote: > > On Fri, Feb 06, 2026 at 01:33:53PM +0000, Alice Ryhl wrote: > > > On Fri, Feb 06, 2026 at 02:22:42PM +0100, Greg KH wrote: > > > > On Fri, Feb 06, 2026 at 02:16:05PM +0100, Danilo Krummrich wrote: > > > > > However, sprinkling "raw" EXPORT_SYMBOL_GPL() due to that is not great at all. > > > > > Hence, we could do something like in [1] instead. I don't know if there are > > > > > other options that may be better though. > > > > > > > > > > [1] https://lore.kernel.org/all/DG7UR3WWZB4V.2MYMJJH1VDHH@kernel.org/ > > > > > > > > That's a start, but still messy. There's no compiler options to prevent > > > > this "lifting" of the code out of devres.rs? If not, this is not going > > > > to be the only problem that drivers run into like this in the future. > > > > > > Because of how monomorphisation, as-is the code actually lives in the > > > module to begin with. > > > > Ok, but again, that is going to cause all sorts of "the symbol is > > undefined" type of problems going forward as a developers just "assumes" > > that the place where the symbol is exported will actually have the > > symbol exported from it, not that this place will be copied inline into > > somewhere else. > > > > Think about the interaction between module symbol namespaces here. This > > isn't going to scale, and will trip people up and cause us to be forced > > to export way more than we really want to (like this patch series shows, > > I don't want to export any of these...) > > Hmm. I don't know how to reconcile namespaces operating on symbols with > monomorphisation. > > We should probably think about what to do about ... :) Matthew Maurer pointed out to me that behavior-wise exporting and namespaces behave almost exactly the same as how Rust handles unstable language features. In the Rust standard library, all functions are marked with one of: #[unstable(feature = "feature_name_here")] #[stable] when you use a #[stable] method, all is good. But if you use an unstable method, then that's a compiler error unless you have #![feature(feature_name_here)] at the crate root. This seems equivalent to our situation here, if we consider: * EXPORT_SYMBOL_GPL symbols are #[stable] * un-exported symbols are #[unstable(feature = "core_kernel")] * other namespaces are #[unstable(feature = "namespace_name_here")] Of course the way this is enforced is through an entirely different mechanism than symbol exports. Alice