Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2231940/?format=api
{ "id": 2231940, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2231940/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260501155421.3329862-5-elder@riscstar.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/1.1/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260501155421.3329862-5-elder@riscstar.com>", "date": "2026-05-01T15:54:12", "name": "[net-next,04/12] net: stmmac: dma: create a separate dma_device pointer", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "67eb817040bbe20b408101933a0b011c4db21870", "submitter": { "id": 89551, "url": "http://patchwork.ozlabs.org/api/1.1/people/89551/?format=api", "name": "Alex Elder", "email": "elder@riscstar.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260501155421.3329862-5-elder@riscstar.com/mbox/", "series": [ { "id": 502478, "url": "http://patchwork.ozlabs.org/api/1.1/series/502478/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=502478", "date": "2026-05-01T15:54:09", "name": "net: enable TC956x support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502478/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2231940/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231940/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-gpio+bounces-35956-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=riscstar-com.20251104.gappssmtp.com\n header.i=@riscstar-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=YW7RYBQF;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35956-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com\n header.i=@riscstar-com.20251104.gappssmtp.com header.b=\"YW7RYBQF\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.219.54", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=riscstar.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=riscstar.com" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6bKj3CrPz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 02 May 2026 01:58:01 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 22EEE3020D37\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 1 May 2026 15:55:25 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 910673D88F8;\n\tFri, 1 May 2026 15:54:46 +0000 (UTC)", "from mail-qv1-f54.google.com (mail-qv1-f54.google.com\n [209.85.219.54])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DDF03D7D77\n\tfor <linux-gpio@vger.kernel.org>; Fri, 1 May 2026 15:54:42 +0000 (UTC)", "by mail-qv1-f54.google.com with SMTP id\n 6a1803df08f44-8a032383008so21417426d6.1\n for <linux-gpio@vger.kernel.org>;\n Fri, 01 May 2026 08:54:42 -0700 (PDT)", "from zippy.localdomain (c-75-72-117-212.hsd1.mn.comcast.net.\n [75.72.117.212])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b539aa7293sm26615406d6.22.2026.05.01.08.54.38\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 01 May 2026 08:54:41 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777650886; cv=none;\n b=gWYeeQXR0cfQj9uj/bCsjJ3A7YDgU/z3xeZ6MCvfKtzFgllnTwgJYyIcpqkUDAGndlyVsRRyboXfAJwtGQnOktuYt6uAP7CJsaqIUXAIo0/9qUkwGk7hoy5yMKRfMtyo+VqOYXoKIkG4aT8yJ/hk6s4AoJt66DKp2GpvnYg/peU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777650886; c=relaxed/simple;\n\tbh=U/lTa+D6+IKoY+zUK905qn/IpLu9A+D8/9j9HczZJc0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=L4/DMPGRMcmHiB+ZrWvw2nAuHtwk+VC52PDX4dkp7w0IXbPyFwuNFG6qz0RNI+fj+gGTfp7ZnWGCDUTC7Lv6moX3KrMUsEqMV1rvSmoiDZoW7t/ih8U4k8QBT/BfrX7DlOn9+oKK9x0XQIGlmkq/je0AE8caEXSVWer1H3x6S0A=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=riscstar.com;\n spf=pass smtp.mailfrom=riscstar.com;\n dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com\n header.i=@riscstar-com.20251104.gappssmtp.com header.b=YW7RYBQF;\n arc=none smtp.client-ip=209.85.219.54", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1777650882;\n x=1778255682; darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=POapwciysOoUJcDyvw+AuP0OuBg91wKnl5ReneTvDn8=;\n b=YW7RYBQFNjf2Xvlg8AjQu3Zu0w53akdt9v2NMOyP8jd8jwYAN/VLagHLZ4P+b/q5kt\n 28WP+LDmwE0Ys608VXqnv6k9E2dfUAPbTyWslcbqa01xaYIYDNkxCkx+kwhALESI7cSa\n Nxac1t6tYSD3gMNYvu+Q1r9mL+aFP9sBG4XgOytYzWh1P7nDzwu1j8qi6qM7ttWUtoHg\n PVtvZzmE1wXCzPgEsTRaRL2GON87uojpEyVYbO+t2L9QnA0FLjZaniGaISbryqdwF4VZ\n Bxn+gtBkCoI7hVroi0oBm9/3EZg0aNVlSkiwtGLX7Vf06fIKYtW7N4zBbvyOgZL72pS/\n 0LIw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777650882; x=1778255682;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=POapwciysOoUJcDyvw+AuP0OuBg91wKnl5ReneTvDn8=;\n b=RU2p1RFaEVxP51Dk5gAo65lEh9JaYOnvk91zw+qOFhWjSyxKbUlrUz4XRQIRdCIDVU\n OZQRYk1+walhUk+frB3q0ZI+mBj0k5Bvo5BpSa6QV1ws7W8OLFUFmKb2oxuq77VkX1oQ\n 7uuYms5EI9Mm0cMwOzIcvVVcsk6GSzJo8zBPAvBNgXA7sRDk+0HVzjMFUlKVhwG+4dNb\n cbUJVPz/i0MtQjPok9WsztbTZA3mSM46vxpng2C0P8AUenO0I4+wMskhZcGHxb6gWMTW\n 2Rk4mqqhPpWD5Nf534LvkXanVjfw3Nwp8DyhEWO6RuE/MgRL3uxTkJVf8Hq1eniGD2XG\n dOcA==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ98ZCIC6wXkdFd0WzumUcwovsmUlPBEQDmL1qSBk3VCcBBK2DEmKj8pSxKSZl3Z5rAHlH7cC6cRCu9f@vger.kernel.org", "X-Gm-Message-State": "AOJu0YzPz3n6QjIwjEoUf+EZR1d+GKyfLhIbCBmWU1uTPsywTdDP5K5r\n\ttrGrbBKvYmW/+V3UTJOA9tHs3cHItJ8Z0UDMeZM09c89XvgUMvEZ7sCx/Yws0MjSQR4=", "X-Gm-Gg": "AeBDiev6zpdDlm5rGZHsXFp1u6HspZ7R+SxYKpghdeV73iw11zrFnaXfoHZZI7Y/HDz\n\tAg7qZyRICuHVoxqWW/pmDoVVTbV5+0DvGTz6d9v6mQTSRiwZEIq0jyY+eNRWiKDpMtHkfna1o0u\n\tIwRXYjoFcvUngvFkRp5gjC/p8x8IAPAkJVCS/fKAxHHidd2Ux9AV0UhcCHlVs3R8T8BmT1OefAk\n\tHw7pJMF1IUGsHKce3XzF1Bkc+kIgL6ykqirPRh3zKWt1T6FRuUeahuOnS6q3X7gnWoG8yNL5aAi\n\togmTbNeY35YKqYdBMuwJo1lw/zcr0sd3Thd/eCsBLe9L9vf8ynnNQeC9wFFJSVOfs2XsRZi3DXL\n\tA+eTfjOeLGaoDzxyESDBGwEhxjJ4LCncnVEkx2weBUovtMMKh7VMcnJCLYw6xnVBO1wS75Nqvp1\n\t0Kqcn8F5wm1TlXRVNqRMxHLw8RBeDLbOJmctwdGqhRCifzYh6YqLeUhHV8WHOHRSeFved9d0BAe\n\tWPXIDNXf4vWUk2d", "X-Received": "by 2002:a05:6214:f62:b0:8ac:ba63:a1b1 with SMTP id\n 6a1803df08f44-8b669ac6336mr335536d6.49.1777650881517;\n Fri, 01 May 2026 08:54:41 -0700 (PDT)", "From": "Alex Elder <elder@riscstar.com>", "To": "andrew+netdev@lunn.ch,\n\tdavem@davemloft.net,\n\tedumazet@google.com,\n\tkuba@kernel.org,\n\tpabeni@redhat.com,\n\tmaxime.chevallier@bootlin.com,\n\trmk+kernel@armlinux.org.uk,\n\tandersson@kernel.org,\n\tkonradybcio@kernel.org,\n\trobh@kernel.org,\n\tkrzk+dt@kernel.org,\n\tconor+dt@kernel.org,\n\tlinusw@kernel.org,\n\tbrgl@kernel.org,\n\tarnd@arndb.de,\n\tgregkh@linuxfoundation.org", "Cc": "daniel@riscstar.com,\n\telder@riscstar.com,\n\tmohd.anwar@oss.qualcomm.com,\n\ta0987203069@gmail.com,\n\talexandre.torgue@foss.st.com,\n\tast@kernel.org,\n\tboon.khai.ng@altera.com,\n\tchenchuangyu@xiaomi.com,\n\tchenhuacai@kernel.org,\n\tdaniel@iogearbox.net,\n\thawk@kernel.org,\n\thkallweit1@gmail.com,\n\tinochiama@gmail.com,\n\tjohn.fastabend@gmail.com,\n\tjulianbraha@gmail.com,\n\tlivelycarpet87@gmail.com,\n\tmatthew.gerlach@altera.com,\n\tmcoquelin.stm32@gmail.com,\n\tme@ziyao.cc,\n\tprabhakar.mahadev-lad.rj@bp.renesas.com,\n\trichardcochran@gmail.com,\n\trohan.g.thomas@altera.com,\n\tsdf@fomichev.me,\n\tsiyanteng@cqsoftware.com.cn,\n\tweishangjuan@eswincomputing.com,\n\twens@kernel.org,\n\tnetdev@vger.kernel.org,\n\tbpf@vger.kernel.org,\n\tlinux-arm-msm@vger.kernel.org,\n\tdevicetree@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org,\n\tlinux-stm32@st-md-mailman.stormreply.com,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org", "Subject": "[PATCH net-next 04/12] net: stmmac: dma: create a separate dma_device\n pointer", "Date": "Fri, 1 May 2026 10:54:12 -0500", "Message-ID": "<20260501155421.3329862-5-elder@riscstar.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260501155421.3329862-1-elder@riscstar.com>", "References": "<20260501155421.3329862-1-elder@riscstar.com>", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "The Toshiba TC956x Ethernet bridge chip is an Ethernet AVN/TSN bridge\nthat is essentially a small but specialized SoC. It provides two XGMAC\nEthernet interfaces along with a number of internal IP blocks, some of\nwhich are used by both eMACs.\n\nThe chip implements two internal PCIe functions, and one of these is\nused to manage the common internal IPs. Both of the PCIe functions\nuse an auxiliary bus device to represent an XGMAC Ethernet interface.\nSeparating the PCIe function from the XGMAC IP this way helps in\nmanaging the life cycle for various objects (common and per-MAC).\n\nHowever this separation means that the MAC device is no longer the\nproper device to use for DMA. To address this, we add support for\na second \"DMA device\" pointer in the stmmac_priv structure. The DMA\ndevice pointer is used for all DMA operations, while the \"normal\"\ndevice pointer is used for log messages, memory allocation, runtime\npower management, and a few other things.\n\nTo set up the DMA device pointer, we add a new device structure pointer\nto the plat_stmmacenet_data structure. If set, it will be assigned as\nthe (new) dma_device pointer field in the stmmac_priv structure. If\nthe plat_stmmacenet_data field is NULL, the \"normal\" device pointer is\nassigned as the dma_device pointer instead (preserving existing behavior).\n\nSigned-off-by: Alex Elder <elder@riscstar.com>\n---\n .../net/ethernet/stmicro/stmmac/chain_mode.c | 12 ++--\n .../net/ethernet/stmicro/stmmac/ring_mode.c | 12 ++--\n drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 +\n .../net/ethernet/stmicro/stmmac/stmmac_main.c | 59 ++++++++++---------\n .../net/ethernet/stmicro/stmmac/stmmac_xdp.c | 2 +-\n include/linux/stmmac.h | 1 +\n 6 files changed, 46 insertions(+), 41 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c\nindex fc04a23342cfc..331e6523ee018 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c\n@@ -34,10 +34,10 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,\n \tbuf_len = min_t(unsigned int, nopaged_len, bmax);\n \tlen = nopaged_len - buf_len;\n \n-\tdes2 = dma_map_single(priv->device, skb->data,\n+\tdes2 = dma_map_single(priv->dma_device, skb->data,\n \t\t\t buf_len, DMA_TO_DEVICE);\n \tdesc->des2 = cpu_to_le32(des2);\n-\tif (dma_mapping_error(priv->device, des2))\n+\tif (dma_mapping_error(priv->dma_device, des2))\n \t\treturn -1;\n \ttx_q->tx_skbuff_dma[entry].buf = des2;\n \ttx_q->tx_skbuff_dma[entry].len = buf_len;\n@@ -51,11 +51,11 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,\n \t\tdesc = tx_q->dma_tx + entry;\n \n \t\tif (len > bmax) {\n-\t\t\tdes2 = dma_map_single(priv->device,\n+\t\t\tdes2 = dma_map_single(priv->dma_device,\n \t\t\t\t\t (skb->data + bmax * i),\n \t\t\t\t\t bmax, DMA_TO_DEVICE);\n \t\t\tdesc->des2 = cpu_to_le32(des2);\n-\t\t\tif (dma_mapping_error(priv->device, des2))\n+\t\t\tif (dma_mapping_error(priv->dma_device, des2))\n \t\t\t\treturn -1;\n \t\t\ttx_q->tx_skbuff_dma[entry].buf = des2;\n \t\t\ttx_q->tx_skbuff_dma[entry].len = bmax;\n@@ -64,11 +64,11 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,\n \t\t\tlen -= bmax;\n \t\t\ti++;\n \t\t} else {\n-\t\t\tdes2 = dma_map_single(priv->device,\n+\t\t\tdes2 = dma_map_single(priv->dma_device,\n \t\t\t\t\t (skb->data + bmax * i), len,\n \t\t\t\t\t DMA_TO_DEVICE);\n \t\t\tdesc->des2 = cpu_to_le32(des2);\n-\t\t\tif (dma_mapping_error(priv->device, des2))\n+\t\t\tif (dma_mapping_error(priv->dma_device, des2))\n \t\t\t\treturn -1;\n \t\t\ttx_q->tx_skbuff_dma[entry].buf = des2;\n \t\t\ttx_q->tx_skbuff_dma[entry].len = len;\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c\nindex 78fc6aa5bbe95..0d334c51fc1c2 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c\n@@ -37,10 +37,10 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,\n \n \tif (nopaged_len > BUF_SIZE_8KiB) {\n \n-\t\tdes2 = dma_map_single(priv->device, skb->data, bmax,\n+\t\tdes2 = dma_map_single(priv->dma_device, skb->data, bmax,\n \t\t\t\t DMA_TO_DEVICE);\n \t\tdesc->des2 = cpu_to_le32(des2);\n-\t\tif (dma_mapping_error(priv->device, des2))\n+\t\tif (dma_mapping_error(priv->dma_device, des2))\n \t\t\treturn -1;\n \n \t\ttx_q->tx_skbuff_dma[entry].buf = des2;\n@@ -58,10 +58,10 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,\n \t\telse\n \t\t\tdesc = tx_q->dma_tx + entry;\n \n-\t\tdes2 = dma_map_single(priv->device, skb->data + bmax, len,\n+\t\tdes2 = dma_map_single(priv->dma_device, skb->data + bmax, len,\n \t\t\t\t DMA_TO_DEVICE);\n \t\tdesc->des2 = cpu_to_le32(des2);\n-\t\tif (dma_mapping_error(priv->device, des2))\n+\t\tif (dma_mapping_error(priv->dma_device, des2))\n \t\t\treturn -1;\n \t\ttx_q->tx_skbuff_dma[entry].buf = des2;\n \t\ttx_q->tx_skbuff_dma[entry].len = len;\n@@ -72,10 +72,10 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,\n \t\t\t\tSTMMAC_RING_MODE, 1, !skb_is_nonlinear(skb),\n \t\t\t\tskb->len);\n \t} else {\n-\t\tdes2 = dma_map_single(priv->device, skb->data,\n+\t\tdes2 = dma_map_single(priv->dma_device, skb->data,\n \t\t\t\t nopaged_len, DMA_TO_DEVICE);\n \t\tdesc->des2 = cpu_to_le32(des2);\n-\t\tif (dma_mapping_error(priv->device, des2))\n+\t\tif (dma_mapping_error(priv->dma_device, des2))\n \t\t\treturn -1;\n \t\ttx_q->tx_skbuff_dma[entry].buf = des2;\n \t\ttx_q->tx_skbuff_dma[entry].len = nopaged_len;\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h\nindex 8ba8f03e1ce03..76c8551687998 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h\n@@ -278,6 +278,7 @@ struct stmmac_priv {\n \tvoid __iomem *ioaddr;\n \tstruct net_device *dev;\n \tstruct device *device;\n+\tstruct device *dma_device;\n \tstruct mac_device_info *hw;\n \tint (*hwif_quirks)(struct stmmac_priv *priv);\n \tstruct mutex lock;\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c\nindex ca68248dbc781..1104cf750295b 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c\n@@ -1730,12 +1730,12 @@ static void stmmac_free_tx_buffer(struct stmmac_priv *priv,\n \tif (tx_q->tx_skbuff_dma[i].buf &&\n \t tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {\n \t\tif (tx_q->tx_skbuff_dma[i].map_as_page)\n-\t\t\tdma_unmap_page(priv->device,\n+\t\t\tdma_unmap_page(priv->dma_device,\n \t\t\t\t tx_q->tx_skbuff_dma[i].buf,\n \t\t\t\t tx_q->tx_skbuff_dma[i].len,\n \t\t\t\t DMA_TO_DEVICE);\n \t\telse\n-\t\t\tdma_unmap_single(priv->device,\n+\t\t\tdma_unmap_single(priv->dma_device,\n \t\t\t\t\t tx_q->tx_skbuff_dma[i].buf,\n \t\t\t\t\t tx_q->tx_skbuff_dma[i].len,\n \t\t\t\t\t DMA_TO_DEVICE);\n@@ -2166,7 +2166,7 @@ static void __free_dma_rx_desc_resources(struct stmmac_priv *priv,\n \n \tsize = stmmac_get_rx_desc_size(priv) * dma_conf->dma_rx_size;\n \n-\tdma_free_coherent(priv->device, size, addr, rx_q->dma_rx_phy);\n+\tdma_free_coherent(priv->dma_device, size, addr, rx_q->dma_rx_phy);\n \n \tif (xdp_rxq_info_is_reg(&rx_q->xdp_rxq))\n \t\txdp_rxq_info_unreg(&rx_q->xdp_rxq);\n@@ -2214,7 +2214,7 @@ static void __free_dma_tx_desc_resources(struct stmmac_priv *priv,\n \n \tsize = stmmac_get_tx_desc_size(priv, tx_q) * dma_conf->dma_tx_size;\n \n-\tdma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);\n+\tdma_free_coherent(priv->dma_device, size, addr, tx_q->dma_tx_phy);\n \n \tkfree(tx_q->tx_skbuff_dma);\n \tkfree(tx_q->tx_skbuff);\n@@ -2266,8 +2266,8 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv,\n \tpp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;\n \tpp_params.pool_size = dma_conf->dma_rx_size;\n \tpp_params.order = order_base_2(num_pages);\n-\tpp_params.nid = dev_to_node(priv->device);\n-\tpp_params.dev = priv->device;\n+\tpp_params.nid = dev_to_node(priv->dma_device);\n+\tpp_params.dev = priv->dma_device;\n \tpp_params.dma_dir = xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;\n \tpp_params.offset = stmmac_rx_offset(priv);\n \tpp_params.max_len = dma_conf->dma_buf_sz;\n@@ -2290,7 +2290,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv,\n \n \tsize = stmmac_get_rx_desc_size(priv) * dma_conf->dma_rx_size;\n \n-\taddr = dma_alloc_coherent(priv->device, size, &rx_q->dma_rx_phy,\n+\taddr = dma_alloc_coherent(priv->dma_device, size, &rx_q->dma_rx_phy,\n \t\t\t\t GFP_KERNEL);\n \tif (!addr)\n \t\treturn -ENOMEM;\n@@ -2369,7 +2369,7 @@ static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv,\n \n \tsize = stmmac_get_tx_desc_size(priv, tx_q) * dma_conf->dma_tx_size;\n \n-\taddr = dma_alloc_coherent(priv->device, size,\n+\taddr = dma_alloc_coherent(priv->dma_device, size,\n \t\t\t\t &tx_q->dma_tx_phy, GFP_KERNEL);\n \tif (!addr)\n \t\treturn -ENOMEM;\n@@ -2898,12 +2898,12 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue,\n \t\tif (likely(tx_q->tx_skbuff_dma[entry].buf &&\n \t\t\t tx_q->tx_skbuff_dma[entry].buf_type != STMMAC_TXBUF_T_XDP_TX)) {\n \t\t\tif (tx_q->tx_skbuff_dma[entry].map_as_page)\n-\t\t\t\tdma_unmap_page(priv->device,\n+\t\t\t\tdma_unmap_page(priv->dma_device,\n \t\t\t\t\t tx_q->tx_skbuff_dma[entry].buf,\n \t\t\t\t\t tx_q->tx_skbuff_dma[entry].len,\n \t\t\t\t\t DMA_TO_DEVICE);\n \t\t\telse\n-\t\t\t\tdma_unmap_single(priv->device,\n+\t\t\t\tdma_unmap_single(priv->dma_device,\n \t\t\t\t\t\t tx_q->tx_skbuff_dma[entry].buf,\n \t\t\t\t\t\t tx_q->tx_skbuff_dma[entry].len,\n \t\t\t\t\t\t DMA_TO_DEVICE);\n@@ -4569,9 +4569,9 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)\n \tfirst = desc;\n \n \t/* first descriptor: fill Headers on Buf1 */\n-\tdes = dma_map_single(priv->device, skb->data, skb_headlen(skb),\n+\tdes = dma_map_single(priv->dma_device, skb->data, skb_headlen(skb),\n \t\t\t DMA_TO_DEVICE);\n-\tif (dma_mapping_error(priv->device, des))\n+\tif (dma_mapping_error(priv->dma_device, des))\n \t\tgoto dma_map_err;\n \n \tstmmac_set_desc_addr(priv, first, des);\n@@ -4597,10 +4597,10 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)\n \tfor (i = 0; i < nfrags; i++) {\n \t\tconst skb_frag_t *frag = &skb_shinfo(skb)->frags[i];\n \n-\t\tdes = skb_frag_dma_map(priv->device, frag, 0,\n+\t\tdes = skb_frag_dma_map(priv->dma_device, frag, 0,\n \t\t\t\t skb_frag_size(frag),\n \t\t\t\t DMA_TO_DEVICE);\n-\t\tif (dma_mapping_error(priv->device, des))\n+\t\tif (dma_mapping_error(priv->dma_device, des))\n \t\t\tgoto dma_map_err;\n \n \t\tstmmac_tso_allocator(priv, des, skb_frag_size(frag),\n@@ -4825,9 +4825,9 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)\n \t} else {\n \t\tbool last_segment = (nfrags == 0);\n \n-\t\tdma_addr = dma_map_single(priv->device, skb->data,\n+\t\tdma_addr = dma_map_single(priv->dma_device, skb->data,\n \t\t\t\t\t nopaged_len, DMA_TO_DEVICE);\n-\t\tif (dma_mapping_error(priv->device, dma_addr))\n+\t\tif (dma_mapping_error(priv->dma_device, dma_addr))\n \t\t\tgoto dma_map_err;\n \n \t\tstmmac_set_tx_skb_dma_entry(tx_q, first_entry, dma_addr,\n@@ -4876,9 +4876,9 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)\n \n \t\tdesc = stmmac_get_tx_desc(priv, tx_q, entry);\n \n-\t\tdma_addr = skb_frag_dma_map(priv->device, frag, 0, frag_size,\n-\t\t\t\t\t DMA_TO_DEVICE);\n-\t\tif (dma_mapping_error(priv->device, dma_addr))\n+\t\tdma_addr = skb_frag_dma_map(priv->dma_device, frag, 0,\n+\t\t\t\t\t frag_size, DMA_TO_DEVICE);\n+\t\tif (dma_mapping_error(priv->dma_device, dma_addr))\n \t\t\tgoto dma_map_err; /* should reuse desc w/o issues */\n \n \t\tstmmac_set_tx_skb_dma_entry(tx_q, entry, dma_addr, frag_size,\n@@ -5188,9 +5188,9 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,\n \n \ttx_desc = stmmac_get_tx_desc(priv, tx_q, entry);\n \tif (dma_map) {\n-\t\tdma_addr = dma_map_single(priv->device, xdpf->data,\n+\t\tdma_addr = dma_map_single(priv->dma_device, xdpf->data,\n \t\t\t\t\t xdpf->len, DMA_TO_DEVICE);\n-\t\tif (dma_mapping_error(priv->device, dma_addr))\n+\t\tif (dma_mapping_error(priv->dma_device, dma_addr))\n \t\t\treturn STMMAC_XDP_CONSUMED;\n \n \t\tbuf_type = STMMAC_TXBUF_T_XDP_NDO;\n@@ -5199,7 +5199,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,\n \n \t\tdma_addr = page_pool_get_dma_addr(page) + sizeof(*xdpf) +\n \t\t\t xdpf->headroom;\n-\t\tdma_sync_single_for_device(priv->device, dma_addr,\n+\t\tdma_sync_single_for_device(priv->dma_device, dma_addr,\n \t\t\t\t\t xdpf->len, DMA_BIDIRECTIONAL);\n \n \t\tbuf_type = STMMAC_TXBUF_T_XDP_TX;\n@@ -5781,7 +5781,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)\n \t\tif (!skb) {\n \t\t\tunsigned int pre_len, sync_len;\n \n-\t\t\tdma_sync_single_for_cpu(priv->device, buf->addr,\n+\t\t\tdma_sync_single_for_cpu(priv->dma_device, buf->addr,\n \t\t\t\t\t\tbuf1_len, dma_dir);\n \t\t\tnet_prefetch(page_address(buf->page) +\n \t\t\t\t buf->page_offset);\n@@ -5860,7 +5860,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)\n \t\t\tskb_mark_for_recycle(skb);\n \t\t\tbuf->page = NULL;\n \t\t} else if (buf1_len) {\n-\t\t\tdma_sync_single_for_cpu(priv->device, buf->addr,\n+\t\t\tdma_sync_single_for_cpu(priv->dma_device, buf->addr,\n \t\t\t\t\t\tbuf1_len, dma_dir);\n \t\t\tskb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,\n \t\t\t\t\tbuf->page, buf->page_offset, buf1_len,\n@@ -5869,7 +5869,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)\n \t\t}\n \n \t\tif (buf2_len) {\n-\t\t\tdma_sync_single_for_cpu(priv->device, buf->sec_addr,\n+\t\t\tdma_sync_single_for_cpu(priv->dma_device, buf->sec_addr,\n \t\t\t\t\t\tbuf2_len, dma_dir);\n \t\t\tskb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,\n \t\t\t\t\tbuf->sec_page, 0, buf2_len,\n@@ -7810,6 +7810,7 @@ static int __stmmac_dvr_probe(struct device *device,\n \n \tpriv = netdev_priv(ndev);\n \tpriv->device = device;\n+\tpriv->dma_device = plat_dat->dma_device ? : device;\n \tpriv->dev = ndev;\n \n \tfor (i = 0; i < MTL_MAX_RX_QUEUES; i++)\n@@ -7938,8 +7939,9 @@ static int __stmmac_dvr_probe(struct device *device,\n \t\tpriv->dma_cap.host_dma_width = priv->dma_cap.addr64;\n \n \tif (priv->dma_cap.host_dma_width) {\n-\t\tret = dma_set_mask_and_coherent(device,\n-\t\t\t\tDMA_BIT_MASK(priv->dma_cap.host_dma_width));\n+\t\tu64 mask = DMA_BIT_MASK(priv->dma_cap.host_dma_width);\n+\n+\t\tret = dma_set_mask_and_coherent(priv->dma_device, mask);\n \t\tif (!ret) {\n \t\t\tdev_info(priv->device, \"Using %d/%d bits DMA host/device width\\n\",\n \t\t\t\t priv->dma_cap.host_dma_width, priv->dma_cap.addr64);\n@@ -7951,7 +7953,8 @@ static int __stmmac_dvr_probe(struct device *device,\n \t\t\tif (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT))\n \t\t\t\tpriv->plat->dma_cfg->eame = true;\n \t\t} else {\n-\t\t\tret = dma_set_mask_and_coherent(device, DMA_BIT_MASK(32));\n+\t\t\tret = dma_set_mask_and_coherent(priv->dma_device,\n+\t\t\t\t\t\t\tDMA_BIT_MASK(32));\n \t\t\tif (ret) {\n \t\t\t\tdev_err(priv->device, \"Failed to set DMA Mask\\n\");\n \t\t\t\tgoto error_hw_init;\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.c\nindex d7e4db7224b0c..7ba068f1ca88d 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.c\n@@ -25,7 +25,7 @@ static int stmmac_xdp_enable_pool(struct stmmac_priv *priv,\n \tif (frame_size < ETH_FRAME_LEN + VLAN_HLEN * 2)\n \t\treturn -EOPNOTSUPP;\n \n-\terr = xsk_pool_dma_map(pool, priv->device, STMMAC_RX_DMA_ATTR);\n+\terr = xsk_pool_dma_map(pool, priv->dma_device, STMMAC_RX_DMA_ATTR);\n \tif (err) {\n \t\tnetdev_err(priv->dev, \"Failed to map xsk pool\\n\");\n \t\treturn err;\ndiff --git a/include/linux/stmmac.h b/include/linux/stmmac.h\nindex 4430b967abdeb..02ae177d5c27d 100644\n--- a/include/linux/stmmac.h\n+++ b/include/linux/stmmac.h\n@@ -245,6 +245,7 @@ struct plat_stmmacenet_data {\n \tstruct stmmac_mdio_bus_data *mdio_bus_data;\n \tstruct device_node *phy_node;\n \tstruct device_node *mdio_node;\n+\tstruct device *dma_device;\n \tstruct stmmac_dma_cfg *dma_cfg;\n \tstruct stmmac_safety_feature_cfg *safety_feat_cfg;\n \tint clk_csr;\n", "prefixes": [ "net-next", "04/12" ] }