Skip to content

Commit 587443e

Browse files
Jack Morgensteinjgunthorpe
authored andcommitted
IB/mlx4: Fix race condition between catas error reset and aliasguid flows
Code review revealed a race condition which could allow the catas error flow to interrupt the alias guid query post mechanism at random points. Thiis is fixed by doing cancel_delayed_work_sync() instead of cancel_delayed_work() during the alias guid mechanism destroy flow. Fixes: a0c64a1 ("mlx4: Add alias_guid mechanism") Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent 9e98c67 commit 587443e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/mlx4/alias_GUID.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)
804804
unsigned long flags;
805805

806806
for (i = 0 ; i < dev->num_ports; i++) {
807-
cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work);
808807
det = &sriov->alias_guid.ports_guid[i];
808+
cancel_delayed_work_sync(&det->alias_guid_work);
809809
spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags);
810810
while (!list_empty(&det->cb_list)) {
811811
cb_ctx = list_entry(det->cb_list.next,

0 commit comments

Comments
 (0)