From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796217775; b=KxqDbQP5lZ6FhpgWcJKS/icKLDRouRM3ys/XI9Cn5JTgTrfurYXzPVxipZRvywqjFZl2 rw1NGdsmDEE2p0wB8OBFispkMPSILmw3f0zP2ftd7Sh/iUUEpFAkmP95uJKbOmAFfUMJM QWfmTHXjZK1E8WCbOSk3gSOE3AkBo0gWSLjk9lCIeFU68npscKtQU53olwXuzA9YdWAHf upeenz+otPddhs+T2I0T8NxFkqn5KDupDZ6hQjKsTzhBVF6s9ZZjTh4yhB0QfVEzb+IN4 gd7t8k5hvceMyWRdXI/PrSEpis00gBGjK1BWZjlm5HREU8mS6x0at72MBU2sUMHMyGA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796217775; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition; bh=6NqNy2zqAdnBB1zBUiGCieEkpzdRkKR+c/6bpWMf5xQ=; b=LBXhUq1s/DQhF+5hSdNNw9Y3rB95XLjrD1MZ5NopnGIjfOV94JmaTrl9yX7tyzTswqBU 5gm1+9INrzjB2qAc23lEd5BKx6cTXZew52rkhLPSr/umPfsCVzk5F9Jp37N301PjXlxGd OGn+EhOSMjJUkAAg9tDcmhv4XFhmwGKPyvHZmfzJmSKYLrrDHhXbZx4fAT4CkjBtP+8/i 6ILN66nb1nhNg5X7qHeCRsntdcAb9mWXWz2u+a2Cz1q0PLTFuPpjDwIPs1kx2QrAGebYT x5Q35B3MT46iUlrAemqA7qDDK45mPeVwO/dL3JqQ84jsaU67an3SUGWqYNPvjhdWZdA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ns0vuMSm; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CF2A606A31A; Wed, 2 Dec 2026 13:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ns0vuMSm Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5BBB1F000C1; Wed, 2 Dec 2026 13:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796217775; bh=6NqNy2zqAdnBB1zBUiGCieEkpzdRkKR+c/6bpWMf5xQ=; h=Date:From:To:Cc:Subject; b=ns0vuMSmjW2Nhgzseu1XLFyqc2JlzDcs2Ux4GHGUWUMMB+mJTVh7Q1LMOk3DkJ7oK LoatxNkNlqbBkqWt5GhPbWkh9/SneDIcGrL1S9KAbHf46m1qSOiImSMjX5YsS0qy2e r1BXEJ+KSGhaVfoIMjjOtZjEoLckUWfGom4hSAG+cq0JiGPzsLU4qYBb7KWUtJU8jt gM3Kh0iW+NFvvpEn+4yiPky1WDuJx354jMCzXG55x1259GJ+1ENCmZU3OxbxATEF14 ISKOYnrLVZDexbO+NKYTN6fPJAuFG/QAvV+098XLsQBum51iN8OiHuT3GbqOVK3wui HnbCYixVpWfUw== Date: Wed, 2 Dec 2026 13:22:49 +0000 From: Mark Brown To: Alice Ryhl , Danilo Krummrich Cc: Alexandre Courbot , Daniel Almeida , Linux Kernel Mailing List , Linux Next Mailing List , Miguel Ojeda Subject: linux-next: manual merge of the drm-rust tree with the rust tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6JgSxeepB2x+4CKB" Content-Disposition: inline --6JgSxeepB2x+4CKB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the drm-rust tree got a conflict in: drivers/gpu/drm/tyr/regs.rs between commit: b34220a599aab ("rust: bitfield: add conversions to Bounded of matching wi= dth") =66rom the rust tree and commit: 63be871b54a4f ("drm/tyr: replace lossless `as` casts with From and FromSa= feCast") =66rom the drm-rust tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --combined drivers/gpu/drm/tyr/regs.rs index 0392869adc5ab,76892a9112275..0000000000000 --- a/drivers/gpu/drm/tyr/regs.rs +++ b/drivers/gpu/drm/tyr/regs.rs @@@ -32,6 -32,18 +32,18 @@@ pub(crate) fn join_u64(lo: u32, hi: u32 (u64::from(lo)) | ((u64::from(hi)) << 32) } =20 + /// Split a 64-bit value into its low and high 32-bit halves. + pub(crate) fn split_u64(value: u64) -> (u32, u32) { + // CAST: The upper 32 bits are dropped on purpose. They are returned = in `hi`. + #[expect(clippy::as_conversions)] + let lo =3D value as u32; + // CAST: After the shift, the value fits in 32 bits. + #[expect(clippy::as_conversions)] + let hi =3D (value >> 32) as u32; +=20 + (lo, hi) + } +=20 /// Read a logical 64-bit value from split 32-bit registers without teari= ng. pub(crate) fn read_u64_no_tearing(lo_read: impl Fn() -> u32, hi_read: imp= l Fn() -> u32) -> u64 { loop { @@@ -251,7 -263,9 +263,9 @@@ pub(crate) mod gpu_control=20 } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(cmd: GpuCommand) -> Self { + // CAST: `GpuCommand` is `#[repr(u8)]`, so the cast is lossle= ss. (cmd as u8).into() } } @@@ -279,7 -293,9 +293,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(mode: ResetMode) -> Self { + // CAST: `ResetMode` is `#[repr(u8)]`, so the cast is lossles= s. Bounded::try_new(mode as u32).unwrap() } } @@@ -313,7 -329,9 +329,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(mode: FlushMode) -> Self { + // CAST: `FlushMode` is `#[repr(u8)]`, so the cast is lossles= s. Bounded::try_new(mode as u32).unwrap() } } @@@ -434,7 -452,9 +452,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(exc: ExceptionType) -> Self { + // CAST: `ExceptionType` is `#[repr(u8)]`, so the cast is los= sless. (exc as u8).into() } } @@@ -465,7 -485,9 +485,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(access: AccessType) -> Self { + // CAST: `AccessType` is `#[repr(u8)]`, so the cast is lossle= ss. Bounded::try_new(access as u32).unwrap() } } @@@ -751,11 -773,11 +773,11 @@@ #[repr(u8)] pub(crate) enum CoherencyMode { /// ACE-Lite coherency protocol. - AceLite =3D uapi::drm_panthor_gpu_coherency_DRM_PANTHOR_GPU_COHER= ENCY_ACE_LITE as u8, + AceLite =3D cv!(uapi::drm_panthor_gpu_coherency_DRM_PANTHOR_GPU_C= OHERENCY_ACE_LITE =3D> u8), /// ACE coherency protocol. - Ace =3D uapi::drm_panthor_gpu_coherency_DRM_PANTHOR_GPU_COHERENCY= _ACE as u8, + Ace =3D cv!(uapi::drm_panthor_gpu_coherency_DRM_PANTHOR_GPU_COHER= ENCY_ACE =3D> u8), /// No coherency protocol. - None =3D uapi::drm_panthor_gpu_coherency_DRM_PANTHOR_GPU_COHERENC= Y_NONE as u8, + None =3D cv!(uapi::drm_panthor_gpu_coherency_DRM_PANTHOR_GPU_COHE= RENCY_NONE =3D> u8), } =20 impl TryFrom> for CoherencyMode { @@@ -772,7 -794,9 +794,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(mode: CoherencyMode) -> Self { + // CAST: `CoherencyMode` is `#[repr(u8)]`, so the cast is los= sless. (mode as u8).into() } } @@@ -814,7 -838,9 +838,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(mode: McuControlMode) -> Self { + // CAST: `McuControlMode` is `#[repr(u8)]`, so the cast is lo= ssless. Bounded::try_new(mode as u32).unwrap() } } @@@ -857,7 -883,9 +883,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(status: McuStatus) -> Self { + // CAST: `McuStatus` is `#[repr(u8)]`, so the cast is lossles= s. Bounded::try_new(status as u32).unwrap() } } @@@ -1050,7 -1078,9 +1078,9 @@@ pub(crate) mod mmu_control=20 } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(val: AllocPolicySelect) -> Self { + // CAST: `AllocPolicySelect` is `#[repr(u8)]`, so the cas= t is lossless. Bounded::try_new(val as u8).unwrap() } } @@@ -1095,7 -1125,9 +1125,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(val: Coherency) -> Self { + // CAST: `Coherency` is `#[repr(u8)]`, so the cast is los= sless. Bounded::try_new(val as u8).unwrap() } } @@@ -1126,7 -1158,9 +1158,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(val: MemoryType) -> Self { + // CAST: `MemoryType` is `#[repr(u8)]`, so the cast is lo= ssless. Bounded::try_new(val as u8).unwrap() } } @@@ -1150,6 -1184,20 +1184,6 @@@ } } =20 - impl TryFrom> for MMU_MEMATTR_STAGE1 { - type Error =3D Error; - - fn try_from(val: Bounded) -> Result { - Ok(Self::from_raw(u8::from(val))) - } - } - - impl From for Bounded { - fn from(val: MMU_MEMATTR_STAGE1) -> Self { - Bounded::try_new(u64::from(val.into_raw())).unwrap() - } - } - register! { base: TyrRegisters; =20 @@@ -1158,14 -1206,14 +1192,14 @@@ /// Each address space can configure up to 8 different memory= attribute profiles. /// Each attribute profile follows the MMU_MEMATTR_STAGE1 lay= out. pub(crate) MEMATTR(u64)[MAX_AS, stride =3D STRIDE] @ 0x2408 { - 7:0 attribute0 ?=3D> MMU_MEMATTR_STAGE1; - 15:8 attribute1 ?=3D> MMU_MEMATTR_STAGE1; - 23:16 attribute2 ?=3D> MMU_MEMATTR_STAGE1; - 31:24 attribute3 ?=3D> MMU_MEMATTR_STAGE1; - 39:32 attribute4 ?=3D> MMU_MEMATTR_STAGE1; - 47:40 attribute5 ?=3D> MMU_MEMATTR_STAGE1; - 55:48 attribute6 ?=3D> MMU_MEMATTR_STAGE1; - 63:56 attribute7 ?=3D> MMU_MEMATTR_STAGE1; + 7:0 attribute0 =3D> MMU_MEMATTR_STAGE1; + 15:8 attribute1 =3D> MMU_MEMATTR_STAGE1; + 23:16 attribute2 =3D> MMU_MEMATTR_STAGE1; + 31:24 attribute3 =3D> MMU_MEMATTR_STAGE1; + 39:32 attribute4 =3D> MMU_MEMATTR_STAGE1; + 47:40 attribute5 =3D> MMU_MEMATTR_STAGE1; + 55:48 attribute6 =3D> MMU_MEMATTR_STAGE1; + 63:56 attribute7 =3D> MMU_MEMATTR_STAGE1; } =20 // MEMATTR is a logical 64-bit register, but it is laid out i= n hardware as two @@@ -1365,7 -1413,9 +1399,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(cmd: MmuCommand) -> Self { + // CAST: `MmuCommand` is `#[repr(u8)]`, so the cast is lo= ssless. (cmd as u8).into() } } @@@ -1462,7 -1512,9 +1498,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(exc: MmuExceptionType) -> Self { + // CAST: `MmuExceptionType` is `#[repr(u8)]`, so the cast= is lossless. (exc as u8).into() } } @@@ -1494,7 -1546,9 +1532,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(access: MmuAccessType) -> Self { + // CAST: `MmuAccessType` is `#[repr(u8)]`, so the cast is= lossless. Bounded::try_new(access as u32).unwrap() } } @@@ -1561,7 -1615,9 +1601,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(mode: AddressSpaceMode) -> Self { + // CAST: `AddressSpaceMode` is `#[repr(u8)]`, so the cast= is lossless. Bounded::try_new(mode as u64).unwrap() } } @@@ -1658,7 -1714,9 +1700,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(bits: InaBits) -> Self { + // CAST: `InaBits` is `#[repr(u8)]`, so the cast is lossl= ess. Bounded::try_new(bits as u64).unwrap() } } @@@ -1689,7 -1747,9 +1733,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(attr: PtwMemattr) -> Self { + // CAST: `PtwMemattr` is `#[repr(u8)]`, so the cast is lo= ssless. Bounded::try_new(attr as u64).unwrap() } } @@@ -1721,7 -1781,9 +1767,9 @@@ } =20 impl From for Bounded { + #[expect(clippy::as_conversions)] fn from(sh: PtwShareability) -> Self { + // CAST: `PtwShareability` is `#[repr(u8)]`, so the cast = is lossless. Bounded::try_new(sh as u64).unwrap() } } --6JgSxeepB2x+4CKB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmsQG6gACgkQJNaLcl1U h9BB0wf/d1JWKvyCl8vaQIXUipqb5LP3doES0Cl/3XOhUZ3O+Jm/7UvWsjhFAMAc P06SNdn6OnnwLMPAxZ9biOSkEl7GISRpvRwVHOANGFbahl0QRtNYIAd3o1KUzfMv qqr5/Cq7I+mP9vHGV3+RaniNNcj5S+R765B52wsew3e4U1+8+X/EnHbl5agrB92D w/rjVso9NyNxQLIETtUZlWx0vDElDnE6kJZCc5Lm0VYkW36fVbWiJ+GYrylRaHMt 7V7WEeMgNSKx1fN6AAMd6gJAkuet64zLNEED0KgjJckUGvNzKO3OFJ20oo+yf/Uj 0tPtqXENQVtbKOmL8H8RTa8UoUo3oA== =hyWy -----END PGP SIGNATURE----- --6JgSxeepB2x+4CKB--