Return an error from ioctl(MLX5_FW_RESET) if reset was rejected in mlx5core.
Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies
This commit is contained in:
parent
96425f44c9
commit
3e40712eb0
@ -110,7 +110,7 @@ void mlx5e_cleanup(void);
|
|||||||
int mlx5_ctl_init(void);
|
int mlx5_ctl_init(void);
|
||||||
void mlx5_ctl_fini(void);
|
void mlx5_ctl_fini(void);
|
||||||
void mlx5_fwdump_prep(struct mlx5_core_dev *mdev);
|
void mlx5_fwdump_prep(struct mlx5_core_dev *mdev);
|
||||||
void mlx5_fwdump(struct mlx5_core_dev *mdev);
|
int mlx5_fwdump(struct mlx5_core_dev *mdev);
|
||||||
void mlx5_fwdump_clean(struct mlx5_core_dev *mdev);
|
void mlx5_fwdump_clean(struct mlx5_core_dev *mdev);
|
||||||
|
|
||||||
struct mlx5_crspace_regmap {
|
struct mlx5_crspace_regmap {
|
||||||
|
@ -148,7 +148,7 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev)
|
|||||||
mlx5_vsc_unlock(mdev);
|
mlx5_vsc_unlock(mdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
mlx5_fwdump(struct mlx5_core_dev *mdev)
|
mlx5_fwdump(struct mlx5_core_dev *mdev)
|
||||||
{
|
{
|
||||||
const struct mlx5_crspace_regmap *r;
|
const struct mlx5_crspace_regmap *r;
|
||||||
@ -157,12 +157,15 @@ mlx5_fwdump(struct mlx5_core_dev *mdev)
|
|||||||
|
|
||||||
mlx5_core_info(mdev, "Issuing FW dump\n");
|
mlx5_core_info(mdev, "Issuing FW dump\n");
|
||||||
mtx_lock(&mdev->dump_lock);
|
mtx_lock(&mdev->dump_lock);
|
||||||
if (mdev->dump_data == NULL)
|
if (mdev->dump_data == NULL) {
|
||||||
|
error = EIO;
|
||||||
goto failed;
|
goto failed;
|
||||||
|
}
|
||||||
if (mdev->dump_valid) {
|
if (mdev->dump_valid) {
|
||||||
/* only one dump */
|
/* only one dump */
|
||||||
mlx5_core_warn(mdev,
|
mlx5_core_warn(mdev,
|
||||||
"Only one FW dump can be captured aborting FW dump\n");
|
"Only one FW dump can be captured aborting FW dump\n");
|
||||||
|
error = EEXIST;
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +190,7 @@ mlx5_fwdump(struct mlx5_core_dev *mdev)
|
|||||||
mlx5_vsc_unlock(mdev);
|
mlx5_vsc_unlock(mdev);
|
||||||
failed:
|
failed:
|
||||||
mtx_unlock(&mdev->dump_lock);
|
mtx_unlock(&mdev->dump_lock);
|
||||||
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -400,7 +404,7 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
|
|||||||
error = mlx5_dbsf_to_core(devaddr, &mdev);
|
error = mlx5_dbsf_to_core(devaddr, &mdev);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
break;
|
break;
|
||||||
mlx5_fwdump(mdev);
|
error = mlx5_fwdump(mdev);
|
||||||
break;
|
break;
|
||||||
case MLX5_FW_UPDATE:
|
case MLX5_FW_UPDATE:
|
||||||
if ((fflag & FWRITE) == 0) {
|
if ((fflag & FWRITE) == 0) {
|
||||||
|
@ -300,7 +300,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force)
|
|||||||
|
|
||||||
/* Execute cr-dump and SW reset */
|
/* Execute cr-dump and SW reset */
|
||||||
if (lock != -EBUSY) {
|
if (lock != -EBUSY) {
|
||||||
mlx5_fwdump(dev);
|
(void)mlx5_fwdump(dev);
|
||||||
reset_fw_if_needed(dev);
|
reset_fw_if_needed(dev);
|
||||||
delay_ms = MLX5_FW_RESET_WAIT_MS;
|
delay_ms = MLX5_FW_RESET_WAIT_MS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user