Skip to content

Commit

Permalink
add platform-mellanox-mlxreg-hotplug-driver-add-check-fo.patch (sonic…
Browse files Browse the repository at this point in the history
…-net#5)

* Mellanox system drivers backport to kernel 4.9

* path: rename: platform-mellanox-mlxreg-hotplug-driver-add-check-fo.patch

It renames platform-mellanox-mlxreg-hotplug-driver-add-check-fo.patch
from 0011 to 0012, since 0011 is already exist.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
  • Loading branch information
MellanoxBSP authored and lguohan committed Mar 19, 2018
1 parent 3639697 commit 5a72b3a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From c794f8ffa6521c47bfbff813e7f713561d7da7bd Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@mellanox.com>
Date: Mon, 11 Dec 2017 19:02:19 +0000
Subject: [v4.9 backport 09/29] platform/mellanox: mlxreg-hotplug driver add
check for low aggregation register mask

It adds verification for low aggregation register mask offset. Only
non-zero offset is considered as valid.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
drivers/platform/mellanox/mlxreg-hotplug.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c
index 94fdb6b..ba9241e 100644
--- a/drivers/platform/mellanox/mlxreg-hotplug.c
+++ b/drivers/platform/mellanox/mlxreg-hotplug.c
@@ -550,10 +550,13 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv)
goto access_error;

/* Keep low aggregation initial status as zero and unmask events. */
- ret = regmap_write(priv->regmap, pdata->cell_low +
- MLXREG_HOTPLUG_AGGR_MASK_OFF, pdata->mask_low);
- if (ret)
- goto access_error;
+ if (pdata->cell_low) {
+ ret = regmap_write(priv->regmap, pdata->cell_low +
+ MLXREG_HOTPLUG_AGGR_MASK_OFF,
+ pdata->mask_low);
+ if (ret)
+ goto access_error;
+ }

/* Invoke work handler for initializing hot plug devices setting. */
mlxreg_hotplug_work_handler(&priv->dwork_irq.work);
@@ -582,9 +585,10 @@ static void mlxreg_hotplug_unset_irq(struct mlxreg_hotplug_priv_data *priv)
disable_irq(priv->irq);
cancel_delayed_work_sync(&priv->dwork_irq);

- /* Mask low aggregation event. */
- regmap_write(priv->regmap, pdata->cell_low +
- MLXREG_HOTPLUG_AGGR_MASK_OFF, 0);
+ /* Mask low aggregation event, if defined. */
+ if (pdata->cell_low)
+ regmap_write(priv->regmap, pdata->cell_low +
+ MLXREG_HOTPLUG_AGGR_MASK_OFF, 0);

/* Mask aggregation event. */
regmap_write(priv->regmap, pdata->cell + MLXREG_HOTPLUG_AGGR_MASK_OFF,
--
2.1.4

1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
0009-platform-mellonox-introduce-mlxreg-io-driver-and-add.patch
0010-config-mellanox-configuration.patch
0011-support-Broadcom-54616-Phy-for-Intel-igb-driver.patch
0012-platform-mellanox-mlxreg-hotplug-driver-add-check-fo.patch
#
# This series applies on GIT commit 1451b36b2b0d62178e42f648d8a18131af18f7d8
# Tkernel-sched-core-fix-cgroup-fork-race.patch
Expand Down

0 comments on commit 5a72b3a

Please sign in to comment.