Article View: linux.kernel.netdev
Article #21902linux-next: manual merge of the drm-misc tree with the net-next tree
From: Mark Brown
Date: Tue, 24 Nov 2026 15:22
Date: Tue, 24 Nov 2026 15:22
149 lines
12565 bytes
12565 bytes
--SJSvMh+EHNwmA8Q2
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-misc tree got a conflict in:
net/core/devmem.c
between commits:
ede1618064a9b ("net: devmem: detach TX bindings on NETDEV_UNREGISTER")
c4466d2c3e776 ("net: devmem: unmap dma_buf synchronously on queue uninsta=
ll")
=66rom the net-next tree and commit:
77e0b2d2f4f37 ("treewide: Rename dma_buf_(un)map_attachment() to dma_buf_=
(un)map_sgt()")
=66rom the drm-misc tree. I'm not sure this is an ideal time to be doing
tree wide refactorings...
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 --cc net/core/devmem.c
index 3714364b5d9a5,a638aa3e806b7..0000000000000
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@@ -67,84 -64,6 +67,84 @@@ static void net_devmem_dmabuf_binding_r
schedule_work(&binding->unbind_w);
}
=20
+static void
+net_devmem_dmabuf_binding_unmap(struct net_devmem_dmabuf_binding *binding)
+{
+ mutex_lock(&binding->lock);
+ if (binding->sgt) {
+ dma_resv_lock(binding->dmabuf->resv, NULL);
- dma_buf_unmap_attachment(binding->attachment, binding->sgt,
- binding->direction);
++ dma_buf_unmap_sgt(binding->attachment, binding->sgt,
++ binding->direction);
+ dma_buf_unpin(binding->attachment);
+ dma_resv_unlock(binding->dmabuf->resv);
+ dma_buf_detach(binding->dmabuf, binding->attachment);
+ binding->sgt =3D NULL;
+ binding->attachment =3D NULL;
+ }
+ mutex_unlock(&binding->lock);
+}
+
+/**
+ * net_devmem_lock_dev() - lock a binding's net_device if still alive
+ * @binding: devmem binding whose @dev pointer to lock
+ * @dev_tracker: reftracker for the held net_device reference
+ *
+ * Safely dereference @binding->dev, acquire netdev_lock() on the device,=
and
+ * verify that @binding->dev has not been cleared while waiting for the l=
ock.
+ *
+ * Invariant: @binding->dev is set once at bind time and is only ever cle=
ared to
+ * NULL while holding netdev_lock(dev) (in mp_dmabuf_devmem_uninstall(),
+ * net_devmem_unbind_dmabuf(), or net_devmem_dev_unregister() during
+ * NETDEV_UNREGISTER before synchronize_net() and netdev_run_todo() free =
the
+ * net_device).
+ *
+ * Taking rcu_read_lock() guarantees that a non-NULL @dev read from
+ * @binding->dev has not yet completed unregister_netdevice_many_notify()
+ * (which waits for an RCU grace period via synchronize_net() after
+ * NETDEV_UNREGISTER before freeing the net_device), so netdev_hold() can
+ * safely acquire a reference before sleeping on netdev_lock(). Once
+ * netdev_lock(dev) is held, re-checking that READ_ONCE(binding->dev) =3D=
=3D dev
+ * guarantees that the device has not yet been detached from @binding and
+ * cannot finish unregistering until net_devmem_unlock_dev().
+ *
+ * Return: The locked and held net_device if @binding->dev is still non-N=
ULL,
+ * or NULL if already cleared.
+ */
+struct net_device *
+net_devmem_lock_dev(struct net_devmem_dmabuf_binding *binding,
+ netdevice_tracker *dev_tracker)
+{
+ struct net_device *dev;
+
+ rcu_read_lock();
+ dev =3D READ_ONCE(binding->dev);
+ if (!dev) {
+ rcu_read_unlock();
+ return NULL;
+ }
+ netdev_hold(dev, dev_tracker, GFP_ATOMIC);
+ rcu_read_unlock();
+
+ netdev_lock(dev);
+ if (READ_ONCE(binding->dev) !=3D dev) {
+ netdev_unlock(dev);
+ netdev_put(dev, dev_tracker);
+ return NULL;
+ }
+
+ return dev;
+}
+
+void net_devmem_unlock_dev(struct net_device *dev,
+ netdevice_tracker *dev_tracker)
+{
+ if (!dev)
+ return;
+
+ netdev_unlock(dev);
+ netdev_put(dev, dev_tracker);
+}
+
void __net_devmem_dmabuf_binding_free(struct work_struct *wq)
{
struct net_devmem_dmabuf_binding *binding =3D container_of(wq, typeof(*b=
inding), unbind_w);
--SJSvMh+EHNwmA8Q2
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmsFq7oACgkQJNaLcl1U
h9BoaQf+Pf2MBlTrwHV7LBf1OK0NKLZZ6D71LmfJW3avr2B84OhEJ4s0OYiP5954
SNQ2YIjyn8f8xrpjFEYIHv2NkgJExHFozNC1b3khRJzqX6ExBmCW33qYD+U7shl7
LCQDCDt8cn6sBLUkcpVhiDd9RitUK17eLV9F9gVvJ4tp743jvNxmr77+eOe8RwWV
4JDCZdcAJaEaK55z6ckJ69FpzNC0wDmALaO+S8Bz3rde4bREMFWeu5dsQ+GsQCuS
QxyQenExXFTstHnMpyAJFOX5HF7edmjO9Bgmsl2yyjn5M3g8rZZs7foweX4bxJLq
Vbq910CKZXddl8pkrXteumQzeUUlNw==
=aNOo
-----END PGP SIGNATURE-----
--SJSvMh+EHNwmA8Q2--
Technical Details
Message-ID:
<awWru6py7DqF3xJD@sirena.org.uk>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370511-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370511-linux-kernel-netdev=dewy.ru From: broonie@kernel.org (Mark Brown) Newsgroups: linux.kernel.netdev Subject: linux-next: manual merge of the drm-misc tree with the net-next tree Date: Tue, 24 Nov 2026 15:22:35 +0000 Organization: Usenet Network Message-ID: <awWru6py7DqF3xJD@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SJSvMh+EHNwmA8Q2" Injection-Info: usenet.network; logging-data="4168468"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4Fqsizqme5dwmLxQw1qhkxuQxoU= sha256:K6IUyjOaz0zfnrnaw5VaB/RAGf33LxrqjFnqSYonNRY= sha1:dIOjbRLBsIEhuouHwpnIOErgsoM= sha256:h3lQWmMRgtc/9VkrXpRx1G//RKz0v7H0SQytdGAuQNs= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id ADEA0125E1E; Tue, 24 Nov 2026 18:22:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rjMkAvD11tGN; Tue, 24 Nov 2026 18:22:53 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370511-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 63A45125E1D; Tue, 24 Nov 2026 18:22:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id CBDE83525C; Tue, 24 Nov 2026 15:22:42 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795533761; b=xR027cleqBvouzeb0xZ5+HCIxTkmbYJfXurMe9XeSfih8tlfJZO23Ej3Nu/l3wZd10OZ ERab6pqfGSnZ0d2HqWB7klmUcR8qTcBMKkAW13cO4bA9PqGfaYvtA50mYXmEzO5NkS+Kq no3yRZkvHElK+/nT5Mh6K8z1pmIStWs6oUh9pWgGBX8m6UfcRHnBVdJ45JtM6tEisV7oY 48Lkc0SRoCVDiJmx2KuzQWhL+Bd+fKulktj63bgUTbXJKAer8OdQGfrHAlxqcxtRc0IJM ahyVRFQP1TvwKKcUAt7R8FNk70zaavoJx5fYB+S33q/T53hWETvs7XRaXLYSjgL1y3g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795533761; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition; bh=rUSlWiMmTskfVsgOz0LZI6AW1duqwGYirj3vzlmXmVI=; b=SunPmB7GPbgaVkiuizAV3TFswQvp1VKRQXMuDF/GARliv/dxiq4CxwzasUWMI8wLTaZj UKdV12lb2CmL82uUZnEs6cSc0WpmgU03va0X2NfwdrS2B+ugQmOgLLoHIkOOuGaJ3DWsp YKCRys3aF2VSRQzv6Rih8IVAG5bdJS0dkVwFl4kinq39lxVhX40x5eELhMrOifsCPvSX/ tm4zSbLbkgliFAtmIrnWVBANG/Or1lVE622GD1dJOvPh/eG1UhNdDh/WqSBB8nqMV8ZkV /2nEcaxIm9KhdGAZ0XPuHC8hld0Qcqw7GbEA+lUmEaPogaLPpav2ehkYsxLDhiEAGUw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Fozh/1pp"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7C1B606A32E; Tue, 24 Nov 2026 15:22:41 +0000 (UTC) X-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=Fozh/1pp X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795533761; b=vR/e1sQDKpPUXkq8RBTwyOQmP3tsKbn8DbgVoPmtY8YqVeBOIMJHhv/wg3HiaVlOnLgu 58l9lPsbhk/OMehZ0sX/NyLSNjdEvZSNO0DqI1Fr2WJ8l4dRoopLLAcR/BEmvrBNKY404 YYrWWQ8At1wv//imXGKMto5/8aOjYwS/TQVs9El1edM+HUixV8vwVOUF9EGstL8KlVTsw Jd5MCUyua5rGUt/KCz+xR1GePHlL153mwp2AsSdBsY6gJEbLxmai7iwwZzEobdlYfmnfB EERbJ+TkQoTkOf5/JFljhB/xPIYKELNaE0nkrHQIwHT3lP4MLzHJp539XAVYp84aYUQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795533761; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition; bh=rUSlWiMmTskfVsgOz0LZI6AW1duqwGYirj3vzlmXmVI=; b=4grocQHLY9RqYtfmNgfcTYkoVGNcypiCWXR8imM0dD4xgJZquZHNCWwhkrIz+IslWiYK pzj15Vw0Y8MUSQMzWIJHtgngIAHz1v+D50wQ7GOVFvCkocS+8L2hdfYltHpQkI414cqi9 EGAg681CBdqUfKwDkmeFCBTm6OxNKNE9Cq9t8+tTMttDiTwdmBEY+dcdqvavXihN0L/AW QgCGBbUYt+oOl4ZOPF2AWfuwIqpxBcLKpqGeG9UBJYc3pJ2G/X6rFcB7zfzXzt4Cp7MvQ Folis8rdv2WdcqEKrnDeMCu81/ECcTtvkrthOA39YEVLPDBDBfBcrvwjK2TTHrezkeA== X-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="Fozh/1pp"; arc=none smtp.remote-ip=100.103.45.18 X-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 E1F7A606A31E; Tue, 24 Nov 2026 15:22:40 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4F041F000C4; Tue, 24 Nov 2026 15:22:37 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795533760; bh=rUSlWiMmTskfVsgOz0LZI6AW1duqwGYirj3vzlmXmVI=; h=Date:From:To:Cc:Subject; b=Fozh/1ppPOZIjOLvZ4jQwv5GNDwhUO6hZJ/G8o4gnpjp056vsYtbm/lQze2umuPnR anb3ubJYaduQOlKDkKoGsyFcWa9v+1D3j7/1RH6pX2xxaSdIVg++zM4cRDG1o4FQqp yVCr5Nz2s19NUeWO12HDY4Y9FWK6TmKx8FBuf5rlaSW4HGVNdXyOTscr0QZ0TqwdKE utGWZElK4N/eNRMuIbnUcBfclqGcBkN4YH7QK8NZs7HsGRxg6W/JYXLZfEXO/McRMm 6kii3T0JuNsPFwC2PHTeWIBr4yKxStqEvmGKHgkjibvEWiMLzixcUycl0KVci4pywe 0nVAEoDDJVf/g== X-Cc: Alistair Popple <apopple@nvidia.com>, Christian Kรถnig <christian.koenig@amd.com>, David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Jason Gunthorpe <jgg@nvidia.com>, Jason Gunthorpe <jgg@ziepe.ca>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Next Mailing List <linux-next@vger.kernel.org>, Mina Almasry <almasrymina@google.com>, Networking <netdev@vger.kernel.org>, Paolo Abeni <pabeni@redhat.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list