Skip to content

Commit b33c007

Browse files
Jack Morgensteingregkh
authored andcommitted
IB/mlx4: Fix race condition between catas error reset and aliasguid flows
[ Upstream commit 587443e ] 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 <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0a2741c commit b33c007

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
@@ -805,8 +805,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)
805805
unsigned long flags;
806806

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

0 commit comments

Comments
 (0)