Loading
net: hns3: use appropriate barrier function after setting a bit value
mainline inclusion from mainline-v6.9-rc4 commit 094c281228529d333458208fd02fcac3b139d93b category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9QYBA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=094c281228529d333458208fd02fcac3b139d93b ---------------------------------------------------- There is a memory barrier in followed case. When set the port down, hclgevf_set_timmer will set DOWN in state. Meanwhile, the service task has different behaviour based on whether the state is DOWN. Thus, to make sure service task see DOWN, use smp_mb__after_atomic after calling set_bit(). CPU0 CPU1 ========================== =================================== hclgevf_set_timer_task() hclgevf_periodic_service_task() set_bit(DOWN,state) test_bit(DOWN,state) pf also has this issue. Fixes: ff200099 ("net: hns3: remove unnecessary work in hclgevf_main") Fixes: 1c6dfe6f ("net: hns3: remove mailbox and reset work in hclge_main") Signed-off-by:Peiyang Wang <wangpeiyang1@huawei.com> Signed-off-by:
Jijie Shao <shaojijie@huawei.com> Reviewed-by:
Simon Horman <horms@kernel.org> Signed-off-by:
Paolo Abeni <pabeni@redhat.com> Signed-off-by:
chenyi <chenyi211@huawei.com>