From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (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 7B83D349AF5 for ; Fri, 10 Apr 2026 14:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.67.36.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775833045; cv=none; b=IOdyo8i8ktn6ZRQQEOluXEXRF9BeWbLQ/Rxd29CEr4757NtT8UfSbxB0Fb51fFvO5akNT5MELaFDE0W+es3EEelVDmCBuFhyx5Yh8yZlPmgxnPR2f1LDQNniObYhdYXxfqrjDIHeFaeH+Dpyxl4mbkg40DFMIY2JP0Il27amqvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775833045; c=relaxed/simple; bh=BBCyDm6ZOScKgHBSmWujAr9ZbowcP5MVOPw0e/pzp/o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Pva6lOit5t/x0gt/6AKHhv+23c1Z1ASw/fdxMiczl44t0ZOfO2Wxz6mKapz65Wis5n3taaAlDsxZeVAsfUlba/B0XcBisz/quTeQxqFiu2BHnG0ILXeqpoW14/4bkFtbWrwy/9edYm4LpC1+dToCZVLJ1Dy7PqzN075eTf3SxVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=posteo.de; spf=pass smtp.mailfrom=posteo.de; dkim=pass (2048-bit key) header.d=posteo.de header.i=@posteo.de header.b=SH0hoAPJ; arc=none smtp.client-ip=185.67.36.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=posteo.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=posteo.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=posteo.de header.i=@posteo.de header.b="SH0hoAPJ" Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B451C240027 for ; Fri, 10 Apr 2026 16:57:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.de; s=2017; t=1775833035; bh=50IaxMfYb7aroQWQsATCxQ2AIuqB50Wsug3UV/yX5r0=; h=Message-ID:Subject:From:To:Cc:Date:Autocrypt:Content-Type: MIME-Version:OpenPGP:From; b=SH0hoAPJWm/RN+2EslAeV1OqA24xKSQIeE1fB9HpuRgjReh0ZfwCirLieMYD9gB2B 8hD7sKc5oupr/+KPhyYesa9d0qMl9iIrxfbedMlrKYWkpM8bSD3kppDne2h/iSOFmw UvL0swjtJdj30856ZxZ6FmGk9d1Dv4LDwBavJJ5GtXhCUdeWdxAG3Lk+CUHrrt9PKg dOUG6eNR3FqSslBi86DDSEofXfKCT4RfEzF6mA7o5uBLJkBASjDkZmqbYWAKFSXSG3 fY28mBNr4GEwnKl7O5pvYKpPy8P3XUnKhzmU/ubcq7cQqet9vElFAYwzaa24P3tZdo RtiR4FJgFxJqw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4fsfzD6VBWz9rxD; Fri, 10 Apr 2026 16:57:12 +0200 (CEST) Message-ID: Subject: Re: [PATCH v3] rust: ACPI: fix missing match data for PRP0001 From: Markus Probst To: Danilo Krummrich Cc: "Rafael J. Wysocki" , Len Brown , Miguel Ojeda , Boqun Feng , Gary Guo , =?ISO-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Greg Kroah-Hartman , Robert Moore , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev, acpica-devel@lists.linux.dev Date: Fri, 10 Apr 2026 14:57:14 +0000 In-Reply-To: References: <20260407-rust_acpi_prp0001-v3-1-c5b24590c273@posteo.de> <4d5cd9887e67007f4dabfed0986861a60e395ae6.camel@posteo.de> Autocrypt: addr=markus.probst@posteo.de; prefer-encrypt=mutual; keydata=mQINBGiDvXgBEADAXUceKafpl46S35UmDh2wRvvx+UfZbcTjeQOlSwKP7YVJ4JOZrVs93 qReNLkOWguIqPBxR9blQ4nyYrqSCV+MMw/3ifyXIm6Pw2YRUDg+WTEOjTixRCoWDgUj1nOsvJ9tVA m76Ww+/pAnepVRafMID0rqEfD9oGv1YrfpeFJhyE2zUw3SyyNLIKWD6QeLRhKQRbSnsXhGLFBXCqt 9k5JARhgQof9zvztcCVlT5KVvuyfC4H+HzeGmu9201BVyihJwKdcKPq+n/aY5FUVxNTgtI9f8wIbm fAjaoT1pjXSp+dszakA98fhONM98pOq723o/1ZGMZukyXFfsDGtA3BB79HoopHKujLGWAGskzClwT jRQxBqxh/U/lL1pc+0xPWikTNCmtziCOvv0KA0arDOMQlyFvImzX6oGVgE4ksKQYbMZ3Ikw6L1Rv1 J+FvN0aNwOKgL2ztBRYscUGcQvA0Zo1fGCAn/BLEJvQYShWKeKqjyncVGoXFsz2AcuFKe1pwETSsN 6OZncjy32e4ktgs07cWBfx0v62b8md36jau+B6RVnnodaA8++oXl3FRwiEW8XfXWIjy4umIv93tb8 8ekYsfOfWkTSewZYXGoqe4RtK80ulMHb/dh2FZQIFyRdN4HOmB4FYO5sEYFr9YjHLmDkrUgNodJCX CeMe4BO4iaxUQARAQABtCdNYXJrdXMgUHJvYnN0IDxtYXJrdXMucHJvYnN0QHBvc3Rlby5kZT6JAl QEEwEIAD4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AWIQSCdBjE9KxY53IwxHM0dh/4561 D0gUCaIZ9HQIZAQAKCRA0dh/4561D0pKmD/92zsCfbD+SrvBpNWtbit7J9wFBNr9qSFFm2n/65qen NNWKDrCzDsjRbALMHSO8nigMWzjofbVjj8Nf7SDcdapRjrMCnidS0DuW3pZBo6W0sZqV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qDkXhlXLsGmdaDTtu4R21PkToX dQNGrZ91M9nlIBKw8Y7c7xZ4098qX2b8JX/CxD+gC1r4C8vuA3GkhFLx+KlkON7LyiJPkrePp6Qky jfGillcaQOqFZ3WwVqyzG1BUfTow== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-vQ4DsA9o3Evk1s4cnEPc" Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 OpenPGP: url=https://posteo.de/keys/markus.probst@posteo.de.asc; preference=encrypt --=-vQ4DsA9o3Evk1s4cnEPc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2026-04-09 at 00:07 +0200, Danilo Krummrich wrote: > On Wed Apr 8, 2026 at 11:42 PM CEST, Markus Probst wrote: > > On Wed, 2026-04-08 at 21:59 +0200, Danilo Krummrich wrote: > > > On Wed Apr 8, 2026 at 9:40 PM CEST, Markus Probst wrote: > > > > On Wed, 2026-04-08 at 18:03 +0200, Danilo Krummrich wrote: > > > > > On Tue Apr 7, 2026 at 11:41 PM CEST, Markus Probst wrote: > > > > > > diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h > > > > > > index aad1a95e6863..d0098f24346f 100644 > > > > > > --- a/include/acpi/acpi_bus.h > > > > > > +++ b/include/acpi/acpi_bus.h > > > > > > @@ -187,6 +187,10 @@ struct acpi_driver { > > > > > > * ----------- > > > > > > */ > > > > > > =20 > > > > > > +bool acpi_of_match_device(const struct acpi_device *adev, > > > > > > + const struct of_device_id *of_match_table, > > > > > > + const struct of_device_id **of_id); > > > > >=20 > > > > > This also has to be defined for !CONFIG_ACPI, otherwise we run in= to the > > > > > following compatible error. > > > > >=20 > > > > > error[E0425]: cannot find function `acpi_of_match_device` in cra= te `bindings` > > > > > --> rust/kernel/driver.rs:295:24 > > > > > | > > > > > 295 | unsafe { bindings::acpi_of_match_device(adev, of_= match_table, of_id) } > > > > > | ^^^^^^^^^^^^^^^^^^^^ > > > > > | > > > > > ::: /mnt/nvme/work/projects/linux/driver-core/driver-core-= testing/rust/bindings/bindings_generated.rs:118713:5 > > > > >=20 > > > > > There is an > > > > >=20 > > > > > #else /* CONFIG_ACPI */ > > > > >=20 > > > > > block at the end of acpi_bus.h for this. > > > > I don't think the function exists in that case and bindgen can't > > > > generate inline functions, so I will just add a `#[cfg(CONFIG_ACPI)= ]` > > > > condition on top of the function. > > >=20 > > > Usually we provide a stub instead of conditionalize the callers; this= case might > > > be a bit special, but I'd still follow the usual pattern. > > The usual C pattern would be > >=20 > > static inline bool acpi_of_match_device(const struct acpi_device *adev, > > const struct of_device_id *of_match_table, > > const struct of_device_id **of_id); > >=20 > > , which is ignored by bindgen (i. e. same error). >=20 > That's where you define a Rust helper; we have lots of cases where we onl= y have > the Rust helper to deal with the inline function stub used when the > corresponding CONFIG_* is disabled. According to git commit msg [1], __rust_helper is needed to inline these helpers into Rust code. Does this mean we could omit the extra function declaration with #[inline(never)] and just use a helper without __rust_helper? [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?= id=3Da9aabb3b839aba094ed80861054993785c61462c Thanks - Markus Probst --=-vQ4DsA9o3Evk1s4cnEPc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEEgnQYxPSsWOdyMMRzNHYf+OetQ9IFAmnZD8gbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyAAoJEDR2H/jnrUPSjTgQAJxzmgET7ENUYshXpn8f OQo7nKxHlBxDTDb/C+h9tV3LH/AlKQ4c1xcxfIxinrW/8N3/XwHpCZEi/mgx4PG5 pmthLwQFscaChQD/jMyscKKqZjDxddHpR2KuOqR4J7OD/EBM7yEi+niXAzg3IEjw GIZEtc3xKIk7m4hLAqNNqUXj5vO6XX4cpgTBvwkNGXVGRwHnsB4kB3XgfeJkJYjT l3sK/w8dnhQJ8LGrmJfAKE3MLOe6SREP4Bb5ZSXaAc0/CA347cMf13NLKV8Zi8VF I19TrBIxotc/WhvEc1jXJ0TANZ8tVmdKufaAcMmMXVbgUZCa4cvlP4hPMOO2+Vr/ MwixyugodZkyaO9d+RSTdBjduGmYuGdL7nmL4Fgchpw8QpDuDu3knldf9qOM3kU0 8TjLDdIIA9/fVYsTqb0rSPQ5onoKXiOLeNjKxiLqGYDwkeDlCr1SCZl0e0BLEbWM tAwmb/e1uVKwgIRAj1tYV5jWlctoDofhOt356qilNT83kqpBrJoGvzFX2eZa164M k4kso+djELpWsS4FA/ppJncxWhokjhHt6s+rqzQDeXkB56+9DLaQGajY+1i1h2Po 9R64BBAg8qE4xnTKnQMYQ6QLGUBR5EsTW4i5qIVUMT66v8PpeBratgGWZN53ySqQ oo4cqp+8nQhxKrIc6IRy1M7f =9POa -----END PGP SIGNATURE----- --=-vQ4DsA9o3Evk1s4cnEPc--