svn commit: r353246 - stable/11/sys/dev/mlx5/mlx5_core
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Oct 7 09:54:09 UTC 2019
Author: hselasky
Date: Mon Oct 7 09:54:08 2019
New Revision: 353246
URL: https://svnweb.freebsd.org/changeset/base/353246
Log:
MFC r352986:
Return an error from ioctl(MLX5_FW_RESET) if reset was rejected in mlx5core.
Submitted by: kib@
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h
stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c
stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Oct 7 09:53:12 2019 (r353245)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Oct 7 09:54:08 2019 (r353246)
@@ -110,7 +110,7 @@ void mlx5e_cleanup(void);
int mlx5_ctl_init(void);
void mlx5_ctl_fini(void);
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);
struct mlx5_crspace_regmap {
Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Oct 7 09:53:12 2019 (r353245)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Mon Oct 7 09:54:08 2019 (r353246)
@@ -148,7 +148,7 @@ unlock_vsc:
mlx5_vsc_unlock(mdev);
}
-void
+int
mlx5_fwdump(struct mlx5_core_dev *mdev)
{
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");
mtx_lock(&mdev->dump_lock);
- if (mdev->dump_data == NULL)
+ if (mdev->dump_data == NULL) {
+ error = EIO;
goto failed;
+ }
if (mdev->dump_valid) {
/* only one dump */
mlx5_core_warn(mdev,
"Only one FW dump can be captured aborting FW dump\n");
+ error = EEXIST;
goto failed;
}
@@ -187,6 +190,7 @@ unlock_vsc:
mlx5_vsc_unlock(mdev);
failed:
mtx_unlock(&mdev->dump_lock);
+ return (error);
}
void
@@ -400,7 +404,7 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d
error = mlx5_dbsf_to_core(devaddr, &mdev);
if (error != 0)
break;
- mlx5_fwdump(mdev);
+ error = mlx5_fwdump(mdev);
break;
case MLX5_FW_UPDATE:
if ((fflag & FWRITE) == 0) {
Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Mon Oct 7 09:53:12 2019 (r353245)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Mon Oct 7 09:54:08 2019 (r353246)
@@ -300,7 +300,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev,
/* Execute cr-dump and SW reset */
if (lock != -EBUSY) {
- mlx5_fwdump(dev);
+ (void)mlx5_fwdump(dev);
reset_fw_if_needed(dev);
delay_ms = MLX5_FW_RESET_WAIT_MS;
}
More information about the svn-src-stable-11
mailing list