]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: register MAC address earlier
authorJulian Wiedmann <jwi@linux.ibm.com>
Fri, 25 Jan 2019 14:44:19 +0000 (15:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Jan 2019 05:23:55 +0000 (21:23 -0800)
commit60cfb9c6c15bb7baf02fbc99009b68fd81c6527b
treef479a8f00f98e951be4f7e0ad765cc16be0171f8
parentb59c37f49582d71b6f4345b17d0e5f0e0723678b
s390/qeth: register MAC address earlier

commit 4c9ca32df9ac ("s390/qeth: fix race when setting MAC address")
resolved a race where our initial programming of dev_addr into the HW
and a call to ndo_set_mac_address() could run concurrently. In this
case, we could end up getting confused about which address was actually
set in the HW.

The quick fix was to introduce additional locking that blocks any
ndo_set_mac_address() while the device is being set online. But the race
primarily originated from the fact that we first register the netdevice,
and only then program its dev_addr. By re-ordering this sequence,
userspace will only be able to change the MAC address _after_ we have
finished with setting the initial dev_addr.

Still, the same MAC address race can also occur during a subsequent call
to qeth_l2_set_online(). So keep around the locking for now, until a
follow-up patch fully resolves this.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l2_main.c