netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 net-next] stmmac: fix DMA channel hang in half-duplex mode
@ 2018-06-13  4:30 Bhadram Varka
  2018-06-15  0:06 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Bhadram Varka @ 2018-06-13  4:30 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu; +Cc: netdev, narayanr

HW does not support Half-duplex mode in multi-queue
scenario. Fix it by not advertising the Half-Duplex
mode if multi-queue enabled.

Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 11fb7c7..07e748c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -928,6 +928,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
 static int stmmac_init_phy(struct net_device *dev)
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
+	u32 tx_cnt = priv->plat->tx_queues_to_use;
 	struct phy_device *phydev;
 	char phy_id_fmt[MII_BUS_ID_SIZE + 3];
 	char bus_id[MII_BUS_ID_SIZE];
@@ -969,6 +970,15 @@ static int stmmac_init_phy(struct net_device *dev)
 					 SUPPORTED_1000baseT_Full);
 
 	/*
+	 * Half-duplex mode not supported with multiqueue
+	 * half-duplex can only works with single queue
+	 */
+	if (tx_cnt > 1)
+		phydev->supported &= ~(SUPPORTED_1000baseT_Half |
+				       SUPPORTED_100baseT_Half |
+				       SUPPORTED_10baseT_Half);
+
+	/*
 	 * Broken HW is sometimes missing the pull-up resistor on the
 	 * MDIO line, which results in reads to non-existent devices returning
 	 * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 net-next] stmmac: fix DMA channel hang in half-duplex mode
  2018-06-13  4:30 [PATCH v1 net-next] stmmac: fix DMA channel hang in half-duplex mode Bhadram Varka
@ 2018-06-15  0:06 ` David Miller
  2018-06-15 15:32   ` Bhadram Varka
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2018-06-15  0:06 UTC (permalink / raw)
  To: vbhadram; +Cc: peppe.cavallaro, alexandre.torgue, joabreu, netdev, narayanr

From: Bhadram Varka <vbhadram@nvidia.com>
Date: Wed, 13 Jun 2018 10:00:48 +0530

> HW does not support Half-duplex mode in multi-queue
> scenario. Fix it by not advertising the Half-Duplex
> mode if multi-queue enabled.
> 
> Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>

Bug fixes should be submitted against net, not net-next.  And
net-next is closed for submissions at this time.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 net-next] stmmac: fix DMA channel hang in half-duplex mode
  2018-06-15  0:06 ` David Miller
@ 2018-06-15 15:32   ` Bhadram Varka
  0 siblings, 0 replies; 3+ messages in thread
From: Bhadram Varka @ 2018-06-15 15:32 UTC (permalink / raw)
  To: David Miller, peppe.cavallaro, alexandre.torgue, joabreu; +Cc: netdev, narayanr

Hi,

On 6/15/2018 5:36 AM, David Miller wrote:
> From: Bhadram Varka <vbhadram@nvidia.com>
> Date: Wed, 13 Jun 2018 10:00:48 +0530
>
>> HW does not support Half-duplex mode in multi-queue
>> scenario. Fix it by not advertising the Half-Duplex
>> mode if multi-queue enabled.
>>
>> Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
> Bug fixes should be submitted against net, not net-next.  And
> net-next is closed for submissions at this time.
>
> Thanks.
Thanks David. Will submit patch against net.

Jose/Alexander/Peppe,
Please review this patch. Will submit patch to net if there is no concerns.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-15 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-13  4:30 [PATCH v1 net-next] stmmac: fix DMA channel hang in half-duplex mode Bhadram Varka
2018-06-15  0:06 ` David Miller
2018-06-15 15:32   ` Bhadram Varka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).