[PATCH f26] Add fix for potential mlxsw firmware incompatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case the firmware shipped with the device is new, it is possible for
the mlxsw driver to fail during initialization.

The patch allows the driver to load with both new and old firmware
versions.

Signed-off-by: Ido Schimmel <idosch@xxxxxxxxxxxx>
---
Patch is against f26 branch since that's what I'm using. However, it's
relevant for f25 and f27 as well.
---
 ...g-Add-high-and-low-temperature-thresholds.patch | 71 ++++++++++++++++++++++
 kernel.spec                                        |  3 +
 2 files changed, 74 insertions(+)
 create mode 100644 0001-mlxsw-reg-Add-high-and-low-temperature-thresholds.patch

diff --git a/0001-mlxsw-reg-Add-high-and-low-temperature-thresholds.patch b/0001-mlxsw-reg-Add-high-and-low-temperature-thresholds.patch
new file mode 100644
index 00000000..8f1752d7
--- /dev/null
+++ b/0001-mlxsw-reg-Add-high-and-low-temperature-thresholds.patch
@@ -0,0 +1,71 @@
+From 62b0e9243fca257217ef72f383bd38ed5a542b5e Mon Sep 17 00:00:00 2001
+From: Ido Schimmel <idosch@xxxxxxxxxxxx>
+Date: Mon, 30 Oct 2017 10:51:18 +0100
+Subject: [PATCH] mlxsw: reg: Add high and low temperature thresholds
+
+The ASIC has the ability to generate events whenever a sensor indicates
+the temperature goes above or below its high or low thresholds,
+respectively.
+
+In new firmware versions the firmware enforces a minimum of 5
+degrees Celsius difference between both thresholds. Make the driver
+conform to this requirement.
+
+Note that this is required even when the events are disabled, as in
+certain systems interrupts are generated via GPIO based on these
+thresholds.
+
+Fixes: 85926f877040 ("mlxsw: reg: Add definition of temperature management registers")
+Signed-off-by: Ido Schimmel <idosch@xxxxxxxxxxxx>
+Signed-off-by: Jiri Pirko <jiri@xxxxxxxxxxxx>
+Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
+---
+ drivers/net/ethernet/mellanox/mlxsw/reg.h | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
+index 4afc8486eb9a..5acfbe5b8b9d 100644
+--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
+@@ -5827,6 +5827,29 @@ MLXSW_ITEM32(reg, mtmp, mtr, 0x08, 30, 1);
+  */
+ MLXSW_ITEM32(reg, mtmp, max_temperature, 0x08, 0, 16);
+ 
++/* reg_mtmp_tee
++ * Temperature Event Enable.
++ * 0 - Do not generate event
++ * 1 - Generate event
++ * 2 - Generate single event
++ * Access: RW
++ */
++MLXSW_ITEM32(reg, mtmp, tee, 0x0C, 30, 2);
++
++#define MLXSW_REG_MTMP_THRESH_HI 0x348	/* 105 Celsius */
++
++/* reg_mtmp_temperature_threshold_hi
++ * High threshold for Temperature Warning Event. In 0.125 Celsius.
++ * Access: RW
++ */
++MLXSW_ITEM32(reg, mtmp, temperature_threshold_hi, 0x0C, 0, 16);
++
++/* reg_mtmp_temperature_threshold_lo
++ * Low threshold for Temperature Warning Event. In 0.125 Celsius.
++ * Access: RW
++ */
++MLXSW_ITEM32(reg, mtmp, temperature_threshold_lo, 0x10, 0, 16);
++
+ #define MLXSW_REG_MTMP_SENSOR_NAME_SIZE 8
+ 
+ /* reg_mtmp_sensor_name
+@@ -5843,6 +5866,8 @@ static inline void mlxsw_reg_mtmp_pack(char *payload, u8 sensor_index,
+ 	mlxsw_reg_mtmp_sensor_index_set(payload, sensor_index);
+ 	mlxsw_reg_mtmp_mte_set(payload, max_temp_enable);
+ 	mlxsw_reg_mtmp_mtr_set(payload, max_temp_reset);
++	mlxsw_reg_mtmp_temperature_threshold_hi_set(payload,
++						    MLXSW_REG_MTMP_THRESH_HI);
+ }
+ 
+ static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp,
+-- 
+2.13.6
+
diff --git a/kernel.spec b/kernel.spec
index e1a88cbb..e3416d1b 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -688,6 +688,9 @@ Patch630: Input-synaptics---Disable-kernel-tracking-on-SMBus-devices.patch
 # Headed upstream
 Patch631: drm-i915-boost-GPU-clocks-if-we-miss-the-pageflip.patch
 
+# http://patchwork.ozlabs.org/patch/831938/
+Patch632: 0001-mlxsw-reg-Add-high-and-low-temperature-thresholds.patch
+
 # END OF PATCH DEFINITIONS
 
 %endif
-- 
2.13.6
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux