All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Biju Das <biju.das.jz@bp.renesas.com>
Subject: [PATCH 5.10.y-cip 48/61] ravb: Fillup ravb_rx_ring_free_gbeth() stub
Date: Mon, 10 Jan 2022 12:23:18 +0000	[thread overview]
Message-ID: <20220110122331.24114-49-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20220110122331.24114-1-prabhakar.mahadev-lad.rj@bp.renesas.com>

From: Biju Das <biju.das.jz@bp.renesas.com>

commit 2458b8edb887108b8a6aae567b01e5e2a73bd8d8 upstream.

Fillup ravb_rx_ring_free_gbeth() function to support RZ/G2L.

This patch also renames ravb_rx_ring_free to ravb_rx_ring_free_rcar
to be consistent with the naming convention used in sh_eth driver.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/net/ethernet/renesas/ravb_main.c | 28 ++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 02e8a7761822..6f9065212791 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -234,10 +234,30 @@ static int ravb_tx_free(struct net_device *ndev, int q, bool free_txed_only)
 
 static void ravb_rx_ring_free_gbeth(struct net_device *ndev, int q)
 {
-	/* Place holder */
+	struct ravb_private *priv = netdev_priv(ndev);
+	unsigned int ring_size;
+	unsigned int i;
+
+	if (!priv->gbeth_rx_ring)
+		return;
+
+	for (i = 0; i < priv->num_rx_ring[q]; i++) {
+		struct ravb_rx_desc *desc = &priv->gbeth_rx_ring[i];
+
+		if (!dma_mapping_error(ndev->dev.parent,
+				       le32_to_cpu(desc->dptr)))
+			dma_unmap_single(ndev->dev.parent,
+					 le32_to_cpu(desc->dptr),
+					 GBETH_RX_BUFF_MAX,
+					 DMA_FROM_DEVICE);
+	}
+	ring_size = sizeof(struct ravb_rx_desc) * (priv->num_rx_ring[q] + 1);
+	dma_free_coherent(ndev->dev.parent, ring_size, priv->gbeth_rx_ring,
+			  priv->rx_desc_dma[q]);
+	priv->gbeth_rx_ring = NULL;
 }
 
-static void ravb_rx_ring_free(struct net_device *ndev, int q)
+static void ravb_rx_ring_free_rcar(struct net_device *ndev, int q)
 {
 	struct ravb_private *priv = netdev_priv(ndev);
 	unsigned int ring_size;
@@ -2187,7 +2207,7 @@ static int ravb_mdio_release(struct ravb_private *priv)
 }
 
 static const struct ravb_hw_info ravb_gen3_hw_info = {
-	.rx_ring_free = ravb_rx_ring_free,
+	.rx_ring_free = ravb_rx_ring_free_rcar,
 	.rx_ring_format = ravb_rx_ring_format,
 	.alloc_rx_desc = ravb_alloc_rx_desc_rcar,
 	.receive = ravb_rcar_rx,
@@ -2212,7 +2232,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
 };
 
 static const struct ravb_hw_info ravb_gen2_hw_info = {
-	.rx_ring_free = ravb_rx_ring_free,
+	.rx_ring_free = ravb_rx_ring_free_rcar,
 	.rx_ring_format = ravb_rx_ring_format,
 	.alloc_rx_desc = ravb_alloc_rx_desc_rcar,
 	.receive = ravb_rcar_rx,
-- 
2.17.1



  parent reply	other threads:[~2022-01-10 12:24 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 12:22 [PATCH 5.10.y-cip 00/61] Add Ethernet support to RZ/G2L Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 01/61] dt-bindings: net: renesas,etheravb: Add additional clocks Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 02/61] dt-bindings: net: renesas,etheravb: Fix optional second clock name Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 03/61] dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 04/61] dt-bindings: net: renesas,etheravb: Drop "int_" prefix and "_n" suffix from interrupt names Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 05/61] net: ethernet: ravb: Enable optional refclk Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 06/61] net: ethernet: ravb: Fix release of refclk Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 07/61] net: ethernet: ravb: Use devm_platform_get_and_ioremap_resource() Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 08/61] ravb: Fix a typo in comment Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 09/61] ravb: Remove checks for unsupported internal delay modes Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 10/61] ravb: Use unsigned int for num_tx_desc variable in struct ravb_private Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 11/61] ravb: Add struct ravb_hw_info to driver data Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 12/61] ravb: Add aligned_tx to struct ravb_hw_info Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 13/61] ravb: Add max_rx_len " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 14/61] ravb: Add stats_len " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 15/61] ravb: Add gstrings_stats and gstrings_size " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 16/61] ravb: Add net_features and net_hw_features " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 17/61] ravb: Add internal delay hw feature " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 18/61] ravb: Add tx_counters " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 19/61] ravb: Remove the macros NUM_TX_DESC_GEN[23] Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 20/61] ravb: Add multi_irq to struct ravb_hw_info Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 21/61] ravb: Add no_ptp_cfg_active " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 22/61] ravb: Add ptp_cfg_active " Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 23/61] ravb: Factorise ravb_ring_free function Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 24/61] ravb: Factorise ravb_ring_format function Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 25/61] ravb: Factorise ravb_ring_init function Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 26/61] ravb: Factorise ravb_rx function Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 27/61] ravb: Factorise ravb_adjust_link function Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 28/61] ravb: Factorise ravb_set_features Lad Prabhakar
2022-01-10 12:22 ` [PATCH 5.10.y-cip 29/61] ravb: Factorise ravb_dmac_init function Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 30/61] ravb: Factorise ravb_emac_init function Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 31/61] ravb: Add reset support Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 32/61] ravb: Rename "ravb_set_features_rx_csum" function to "ravb_set_features_rcar" Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 33/61] ravb: Rename "no_ptp_cfg_active" and "ptp_cfg_active" variables Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 34/61] ravb: Add nc_queue to struct ravb_hw_info Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 35/61] ravb: Add support for RZ/G2L SoC Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 36/61] ravb: Initialize GbEthernet DMAC Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 37/61] ravb: remove APSR_DM Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 38/61] ravb: Exclude gPTP feature support for RZ/G2L Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 39/61] ravb: Add tsrq to struct ravb_hw_info Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 40/61] ravb: Add magic_pkt " Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 41/61] ravb: Add half_duplex " Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 42/61] ravb: update "undocumented" annotations Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 43/61] ravb: Remove extra TAB Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 44/61] ravb: Initialize GbEthernet E-MAC Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 45/61] ravb: Add rx_max_buf_size to struct ravb_hw_info Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 46/61] ravb: Use ALIGN macro for max_rx_len Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 47/61] ravb: Fillup ravb_alloc_rx_desc_gbeth() stub Lad Prabhakar
2022-01-10 12:23 ` Lad Prabhakar [this message]
2022-01-10 12:23 ` [PATCH 5.10.y-cip 49/61] ravb: Fillup ravb_rx_ring_format_gbeth() stub Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 50/61] ravb: Fillup ravb_rx_gbeth() stub Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 51/61] ravb: Add carrier_counters to struct ravb_hw_info Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 52/61] ravb: Add support to retrieve stats for GbEthernet Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 53/61] ravb: Rename "tsrq" variable Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 54/61] ravb: Optimize ravb_emac_init_gbeth function Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 55/61] ravb: Rename "nc_queue" feature bit Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 56/61] ravb: Update ravb_emac_init_gbeth() Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 57/61] ravb: Fix typo AVB->DMAC Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 58/61] clk: renesas: r9a07g044: Add ethernet clock sources Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 59/61] clk: renesas: r9a07g044: Add GbEthernet clock/reset Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 60/61] arm64: dts: renesas: r9a07g044: Add GbEthernet nodes Lad Prabhakar
2022-01-10 12:23 ` [PATCH 5.10.y-cip 61/61] arm64: dts: renesas: rzg2l-smarc-som: Enable Ethernet Lad Prabhakar
2022-01-11 11:54 ` [cip-dev] [PATCH 5.10.y-cip 00/61] Add Ethernet support to RZ/G2L Pavel Machek
     [not found] ` <16C93537A1693B9B.28404@lists.cip-project.org>
2022-01-12  9:45   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220110122331.24114-49-prabhakar.mahadev-lad.rj@bp.renesas.com \
    --to=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.