1 From a16c80c305b2e11fe3efd0905bbe7db8388bf545 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 19/32] ivshmem-net: Switch to reset state on each net stop and
7 Improves the state signaling to the remote side after ifconfig down and
10 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 drivers/net/ivshmem-net.c | 5 ++++-
13 1 file changed, 4 insertions(+), 1 deletion(-)
15 diff --git a/drivers/net/ivshmem-net.c b/drivers/net/ivshmem-net.c
16 index cff6aa0be71d..09484d652add 100644
17 --- a/drivers/net/ivshmem-net.c
18 +++ b/drivers/net/ivshmem-net.c
19 @@ -554,6 +554,8 @@ static void ivshm_net_do_stop(struct net_device *ndev)
21 struct ivshm_net *in = netdev_priv(ndev);
23 + ivshm_net_set_state(in, IVSHM_NET_STATE_RESET);
25 if (!test_and_clear_bit(IVSHM_NET_FLAG_RUN, &in->flags))
28 @@ -593,7 +595,6 @@ static void ivshm_net_state_change(struct work_struct *work)
30 netif_carrier_off(ndev);
31 ivshm_net_do_stop(ndev);
32 - ivshm_net_set_state(in, IVSHM_NET_STATE_RESET);
36 @@ -899,6 +900,8 @@ static void ivshm_net_remove(struct pci_dev *pdev)
37 struct net_device *ndev = pci_get_drvdata(pdev);
38 struct ivshm_net *in = netdev_priv(ndev);
40 + writel(IVSHM_NET_STATE_RESET, &in->ivshm_regs->lstate);
43 free_irq(in->msix.vector, ndev);
44 pci_disable_msix(pdev);