]> git.baikalelectronics.ru Git - kernel.git/commit
xen-netfront: wait xenbus state change when load module manually
authorXiao Liang <xiliang@redhat.com>
Fri, 27 Jul 2018 09:56:08 +0000 (17:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jul 2018 16:40:19 +0000 (09:40 -0700)
commitedbdc2b045259ee2e4e25a72892f0f558fadfb4c
tree539b7b83c59136911f1529647a46ed3bd94e7981
parent2ef44f5e193e720511087f61b06d31aa71edb00d
xen-netfront: wait xenbus state change when load module manually

When loading module manually, after call xenbus_switch_state to initializes
the state of the netfront device, the driver state did not change so fast
that may lead no dev created in latest kernel. This patch adds wait to make
sure xenbus knows the driver is not in closed/unknown state.

Current state:
[vm]# ethtool eth0
Settings for eth0:
Link detected: yes
[vm]# modprobe -r xen_netfront
[vm]# modprobe  xen_netfront
[vm]# ethtool eth0
Settings for eth0:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available

With the patch installed.
[vm]# ethtool eth0
Settings for eth0:
Link detected: yes
[vm]# modprobe -r xen_netfront
[vm]# modprobe xen_netfront
[vm]# ethtool eth0
Settings for eth0:
Link detected: yes

Signed-off-by: Xiao Liang <xiliang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netfront.c