Skip to content

Commit 793d4bf

Browse files
Yishai Hadasawilliam
authored andcommitted
vfio/mlx5: Handle the EREMOTEIO error upon the SAVE command
The SAVE command uses the async command interface over the PF. Upon a failure in the firmware -EREMOTEIO is returned. In that case call mlx5_cmd_out_err() to let it print the command failure details including the firmware syndrome. Note: The other commands in the driver use the sync command interface in a way that a firmware syndrome is printed upon an error inside mlx5_core. Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Leon Romanovsky <leon@kernel.org> Link: https://lore.kernel.org/r/20240205124828.232701-4-yishaih@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent f886473 commit 793d4bf

File tree

1 file changed

+6
-1
lines changed
  • drivers/vfio/pci/mlx5

1 file changed

+6
-1
lines changed

drivers/vfio/pci/mlx5/cmd.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,13 @@ static void mlx5vf_save_callback(int status, struct mlx5_async_work *context)
614614

615615
err:
616616
/* The error flow can't run from an interrupt context */
617-
if (status == -EREMOTEIO)
617+
if (status == -EREMOTEIO) {
618618
status = MLX5_GET(save_vhca_state_out, async_data->out, status);
619+
/* Failed in FW, print cmd out failure details */
620+
mlx5_cmd_out_err(migf->mvdev->mdev, MLX5_CMD_OP_SAVE_VHCA_STATE, 0,
621+
async_data->out);
622+
}
623+
619624
async_data->status = status;
620625
queue_work(migf->mvdev->cb_wq, &async_data->work);
621626
}

0 commit comments

Comments
 (0)