512bcaf27a8098be997f01a9ca0780a5b2924760
[AGL/meta-agl-devel.git] /
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
5  on driver removal
6
7 Improves the state signaling to the remote side after ifconfig down and
8 driver removal.
9
10 Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 ---
12  drivers/net/ivshmem-net.c | 5 ++++-
13  1 file changed, 4 insertions(+), 1 deletion(-)
14
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)
20  {
21         struct ivshm_net *in = netdev_priv(ndev);
22  
23 +       ivshm_net_set_state(in, IVSHM_NET_STATE_RESET);
24 +
25         if (!test_and_clear_bit(IVSHM_NET_FLAG_RUN, &in->flags))
26                 return;
27  
28 @@ -593,7 +595,6 @@ static void ivshm_net_state_change(struct work_struct *work)
29                 } else {
30                         netif_carrier_off(ndev);
31                         ivshm_net_do_stop(ndev);
32 -                       ivshm_net_set_state(in, IVSHM_NET_STATE_RESET);
33                 }
34                 break;
35         }
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);
39  
40 +       writel(IVSHM_NET_STATE_RESET, &in->ivshm_regs->lstate);
41 +
42         if (in->using_msix)  {
43                 free_irq(in->msix.vector, ndev);
44                 pci_disable_msix(pdev);
45 -- 
46 2.11.0
47