]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: mdiobus: Disable preemption upon u64_stats update
authorAhmed S. Darwish <a.darwish@linutronix.de>
Wed, 3 Jun 2020 14:49:47 +0000 (16:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:30 +0000 (17:48 +0200)
commitaeadf66a5db6de978dc94f99b8a10c0c34f05a48
tree47ebc81b22db141e188dc840320e431cc7ee075e
parent8dd312267f27d6cee54d177b788691d20f677917
net: mdiobus: Disable preemption upon u64_stats update

[ Upstream commit c7e261d81783387a0502878cd229327e7c54322e ]

The u64_stats mechanism uses sequence counters to protect against 64-bit
values tearing on 32-bit architectures. Updating u64_stats is thus a
sequence counter write side critical section where preemption must be
disabled.

For mdiobus_stats_acct(), disable preemption upon the u64_stats update.
It is called from process context through mdiobus_read() and
mdiobus_write().

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mdio_bus.c