Skip to content

Commit cb725b9

Browse files
committed
hw-mgmt: scripts: Skip loading minimal driver if it is disabled
On certain platforms minimal driver is disabled. Make sure to skip loading it on such platforms. Signed-off-by: Felix Radensky <[email protected]>
1 parent 8fec589 commit cb725b9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

usr/usr/bin/hw-management-thermal-events.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,10 @@ if [ "$1" == "add" ]; then
739739
else
740740
asic_num=$(< $config_path/asic_num)
741741
fi
742-
if [ ! -d /sys/module/mlxsw_minimal ]; then
742+
if [ -f "$config_path"/minimal_unsupported ]; then
743+
minimal_unsupported=$(< $config_path/minimal_unsupported)
744+
fi
745+
if [ ${minimal_unsupported} -eq 0 ] && [ ! -d /sys/module/mlxsw_minimal ]; then
743746
modprobe mlxsw_minimal
744747
fi
745748
for ((i=1; i<=asic_num; i+=1)); do
@@ -1101,7 +1104,10 @@ if [ "$1" == "add" ]; then
11011104

11021105
fi
11031106
if [ "$2" == "sxcore" ]; then
1104-
if [ ! -d /sys/module/mlxsw_minimal ]; then
1107+
if [ -f "$config_path"/minimal_unsupported ]; then
1108+
minimal_unsupported=$(< $config_path/minimal_unsupported)
1109+
fi
1110+
if [ ${minimal_unsupported} -eq 0 ] && [ ! -d /sys/module/mlxsw_minimal ]; then
11051111
modprobe mlxsw_minimal
11061112
fi
11071113
/usr/bin/hw-management.sh chipup 0 "$4/$5"
@@ -1164,7 +1170,10 @@ elif [ "$1" == "change" ]; then
11641170
exit 0
11651171
fi
11661172
if [ "$3" == "up" ]; then
1167-
if [ ! -d /sys/module/mlxsw_minimal ]; then
1173+
if [ -f "$config_path"/minimal_unsupported ]; then
1174+
minimal_unsupported=$(< $config_path/minimal_unsupported)
1175+
fi
1176+
if [ ${minimal_unsupported} -eq 0 ] && [ ! -d /sys/module/mlxsw_minimal ]; then
11681177
modprobe mlxsw_minimal
11691178
fi
11701179
# Run automatic chipup based on ASIC health event only in special CI/verification OSes.

0 commit comments

Comments
 (0)