1 From 869dce4a7f48b0642e4c902c5d142503dbd37dda Mon Sep 17 00:00:00 2001
2 From: Jan Kiszka <jan.kiszka@siemens.com>
3 Date: Sun, 1 Jan 2017 15:43:37 +0100
4 Subject: [PATCH] ivshmem-net: Switch to reset state on each net stop and on
7 Improves the state signaling to the remote side after ifconfig down and
10 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 (cherry picked from commit d0f632b2830146d9892a2b1ab93f866f072412bb)
13 drivers/net/ivshmem-net.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
16 --- a/drivers/net/ivshmem-net.c
17 +++ b/drivers/net/ivshmem-net.c
18 @@ -554,6 +554,8 @@ static void ivshm_net_do_stop(struct net
20 struct ivshm_net *in = netdev_priv(ndev);
22 + ivshm_net_set_state(in, IVSHM_NET_STATE_RESET);
24 if (!test_and_clear_bit(IVSHM_NET_FLAG_RUN, &in->flags))
27 @@ -593,7 +595,6 @@ static void ivshm_net_state_change(struc
29 netif_carrier_off(ndev);
30 ivshm_net_do_stop(ndev);
31 - ivshm_net_set_state(in, IVSHM_NET_STATE_RESET);
35 @@ -899,6 +900,8 @@ static void ivshm_net_remove(struct pci_
36 struct net_device *ndev = pci_get_drvdata(pdev);
37 struct ivshm_net *in = netdev_priv(ndev);
39 + writel(IVSHM_NET_STATE_RESET, &in->ivshm_regs->lstate);
42 free_irq(in->msix.vector, ndev);
43 pci_disable_msix(pdev);