All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: netdev@vger.kernel.org
Cc: Jose Abreu <Jose.Abreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	Vitor Soares <Vitor.Soares@synopsys.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>
Subject: [PATCH v3 net-next 06/12] net: stmmac: Remove uneeded checks for GMAC version
Date: Fri, 18 May 2018 14:56:03 +0100	[thread overview]
Message-ID: <06c7f81cabf115614a974084ed3cbb0895028f3d.1526651009.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1526651009.git.joabreu@synopsys.com>
In-Reply-To: <cover.1526651009.git.joabreu@synopsys.com>

With the introducion of callbacks check in hwif.h we only call the
callback if HW supports it so there is no longer need to check for GMAC
version.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Vitor Soares <soares@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index beb7ec1..ce6f839 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1973,11 +1973,8 @@ static void stmmac_set_dma_operation_mode(struct stmmac_priv *priv, u32 txmode,
 
 static bool stmmac_safety_feat_interrupt(struct stmmac_priv *priv)
 {
-	int ret = false;
+	int ret;
 
-	/* Safety features are only available in cores >= 5.10 */
-	if (priv->synopsys_id < DWMAC_CORE_5_10)
-		return ret;
 	ret = stmmac_safety_feat_irq_status(priv, priv->dev,
 			priv->ioaddr, priv->dma_cap.asp, &priv->sstats);
 	if (ret && (ret != -EINVAL)) {
@@ -2495,12 +2492,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
 	stmmac_core_init(priv, priv->hw, dev);
 
 	/* Initialize MTL*/
-	if (priv->synopsys_id >= DWMAC_CORE_4_00)
-		stmmac_mtl_configuration(priv);
+	stmmac_mtl_configuration(priv);
 
 	/* Initialize Safety Features */
-	if (priv->synopsys_id >= DWMAC_CORE_5_10)
-		stmmac_safety_feat_configuration(priv);
+	stmmac_safety_feat_configuration(priv);
 
 	ret = stmmac_rx_ipc(priv, priv->hw);
 	if (!ret) {
@@ -3054,10 +3049,9 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (enh_desc)
 		is_jumbo = stmmac_is_jumbo_frm(priv, skb->len, enh_desc);
 
-	if (unlikely(is_jumbo) && likely(priv->synopsys_id <
-					 DWMAC_CORE_4_00)) {
+	if (unlikely(is_jumbo)) {
 		entry = stmmac_jumbo_frm(priv, tx_q, skb, csum_insertion);
-		if (unlikely(entry < 0))
+		if (unlikely(entry < 0) && (entry != -EINVAL))
 			goto dma_map_err;
 	}
 
-- 
1.7.1

  parent reply	other threads:[~2018-05-18 13:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 13:55 [PATCH v3 net-next 00/12] net: stmmac: Clean-up and tune-up Jose Abreu
2018-05-18 13:55 ` [PATCH v3 net-next 01/12] net: stmmac: Enable OSP for GMAC4 Jose Abreu
2018-05-18 13:55 ` [PATCH v3 net-next 02/12] net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit Jose Abreu
2018-08-17  7:32   ` [v3, net-next, " Jerome Brunet
2018-08-17  7:32     ` Jerome Brunet
2018-08-23 18:42     ` Martin Blumenstingl
2018-08-23 18:42       ` Martin Blumenstingl
2018-05-18 13:56 ` [PATCH v3 net-next 03/12] net: stmmac: Let descriptor code set skbuff address Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 04/12] net: stmmac: Let descriptor code clear the descriptor Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 05/12] net: stmmac: Uniformize the use of dma_{rx/tx}_mode callbacks Jose Abreu
2018-05-18 13:56 ` Jose Abreu [this message]
2018-05-18 13:56 ` [PATCH v3 net-next 07/12] net: stmmac: Move PTP and MMC base address calculation to hwif.c Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 08/12] net: stmmac: Uniformize the use of dma_init_* callbacks Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 09/12] net: stmmac: Remove uneeded check for GMAC version in stmmac_xmit Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 10/12] net: stmmac: Uniformize set_rx_owner() Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 11/12] net: stmmac: Let descriptor code get skbuff address Jose Abreu
2018-05-18 13:56 ` [PATCH v3 net-next 12/12] net: stmmac: Remove if condition by taking advantage of hwif return code Jose Abreu
2018-05-18 14:12 ` [PATCH v3 net-next 00/12] net: stmmac: Clean-up and tune-up Corentin Labbe
2018-05-18 14:23   ` Jose Abreu
2018-05-18 14:28     ` Corentin Labbe
2018-05-18 15:09 ` David Miller

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=06c7f81cabf115614a974084ed3cbb0895028f3d.1526651009.git.joabreu@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Vitor.Soares@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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.