[PATCH][unstable][Artful][SRU Zesty] net: hns: Bugfix for Tx timeout handling in hns driver

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH][unstable][Artful][SRU Zesty] net: hns: Bugfix for Tx timeout handling in hns driver

dann frazier-4
From: Lin Yun Sheng <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1704146

When hns port type is not debug mode, netif_tx_disable is called
when there is a tx timeout, which requires system reboot to return
to normal state. This patch fix this problem by resetting the net
dev.

Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support")
Signed-off-by: Lin Yun Sheng <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 76b825ab870be3281edac4ae8a414da6e54b0d3a)
Signed-off-by: dann frazier <[hidden email]>
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index bdedea75ddab..34dd3c6f1976 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -1375,13 +1375,20 @@ void hns_nic_net_reset(struct net_device *ndev)
 void hns_nic_net_reinit(struct net_device *netdev)
 {
  struct hns_nic_priv *priv = netdev_priv(netdev);
+ enum hnae_port_type type = priv->ae_handle->port_type;
 
  netif_trans_update(priv->netdev);
  while (test_and_set_bit(NIC_STATE_REINITING, &priv->state))
  usleep_range(1000, 2000);
 
  hns_nic_net_down(netdev);
- hns_nic_net_reset(netdev);
+
+ /* Only do hns_nic_net_reset in debug mode
+ * because of hardware limitation.
+ */
+ if (type == HNAE_PORT_DEBUG)
+ hns_nic_net_reset(netdev);
+
  (void)hns_nic_net_up(netdev);
  clear_bit(NIC_STATE_REINITING, &priv->state);
 }
@@ -2002,13 +2009,8 @@ static void hns_nic_reset_subtask(struct hns_nic_priv *priv)
  rtnl_lock();
  /* put off any impending NetWatchDogTimeout */
  netif_trans_update(priv->netdev);
+ hns_nic_net_reinit(priv->netdev);
 
- if (type == HNAE_PORT_DEBUG) {
- hns_nic_net_reinit(priv->netdev);
- } else {
- netif_carrier_off(priv->netdev);
- netif_tx_disable(priv->netdev);
- }
  rtnl_unlock();
 }
 
--
2.13.2


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK: [PATCH][SRU Zesty] net: hns: Bugfix for Tx timeout handling in hns driver

Stefan Bader-2
On 13.07.2017 17:34, dann frazier wrote:

> From: Lin Yun Sheng <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1704146
>
> When hns port type is not debug mode, netif_tx_disable is called
> when there is a tx timeout, which requires system reboot to return
> to normal state. This patch fix this problem by resetting the net
> dev.
>
> Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support")
> Signed-off-by: Lin Yun Sheng <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit 76b825ab870be3281edac4ae8a414da6e54b0d3a)
> Signed-off-by: dann frazier <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  drivers/net/ethernet/hisilicon/hns/hns_enet.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> index bdedea75ddab..34dd3c6f1976 100644
> --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> @@ -1375,13 +1375,20 @@ void hns_nic_net_reset(struct net_device *ndev)
>  void hns_nic_net_reinit(struct net_device *netdev)
>  {
>   struct hns_nic_priv *priv = netdev_priv(netdev);
> + enum hnae_port_type type = priv->ae_handle->port_type;
>  
>   netif_trans_update(priv->netdev);
>   while (test_and_set_bit(NIC_STATE_REINITING, &priv->state))
>   usleep_range(1000, 2000);
>  
>   hns_nic_net_down(netdev);
> - hns_nic_net_reset(netdev);
> +
> + /* Only do hns_nic_net_reset in debug mode
> + * because of hardware limitation.
> + */
> + if (type == HNAE_PORT_DEBUG)
> + hns_nic_net_reset(netdev);
> +
>   (void)hns_nic_net_up(netdev);
>   clear_bit(NIC_STATE_REINITING, &priv->state);
>  }
> @@ -2002,13 +2009,8 @@ static void hns_nic_reset_subtask(struct hns_nic_priv *priv)
>   rtnl_lock();
>   /* put off any impending NetWatchDogTimeout */
>   netif_trans_update(priv->netdev);
> + hns_nic_net_reinit(priv->netdev);
>  
> - if (type == HNAE_PORT_DEBUG) {
> - hns_nic_net_reinit(priv->netdev);
> - } else {
> - netif_carrier_off(priv->netdev);
> - netif_tx_disable(priv->netdev);
> - }
>   rtnl_unlock();
>  }
>  
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK / APPLIED[artful]: [PATCH][unstable][Artful][SRU Zesty] net: hns: Bugfix for Tx timeout handling in hns driver

Seth Forshee
In reply to this post by dann frazier-4
On Thu, Jul 13, 2017 at 09:34:31AM -0600, dann frazier wrote:

> From: Lin Yun Sheng <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1704146
>
> When hns port type is not debug mode, netif_tx_disable is called
> when there is a tx timeout, which requires system reboot to return
> to normal state. This patch fix this problem by resetting the net
> dev.
>
> Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support")
> Signed-off-by: Lin Yun Sheng <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit 76b825ab870be3281edac4ae8a414da6e54b0d3a)
> Signed-off-by: dann frazier <[hidden email]>

Clean cherry pick, affects only a single, platform-specific driver.

Acked-by: Seth Forshee <[hidden email]>

Applied to artful/master-next and unstable/master, thanks.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

APPLIED: [PATCH][unstable][Artful][SRU Zesty] net: hns: Bugfix for Tx timeout handling in hns driver

Thadeu Lima de Souza Cascardo-3
In reply to this post by dann frazier-4
Applied to zesty master-next branch.

Thanks.
Cascardo.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Loading...