@@ -604,7 +604,7 @@ cleanup() {
604604 fi
605605
606606 # Restore the original binding states for PF0 and PF1
607- if [ -n " ${pcie_bd} " -a ${deferred} -eq 0 ]; then
607+ if [ $nic_mode -eq 1 -a -n " ${pcie_bd} " -a ${deferred} -eq 0 ]; then
608608 for i in 0 1; do
609609 if eval " [ \$ {pf${i} _bound} -eq 0 ]" ; then
610610 [ $verbose -eq 1 ] && echo " Re-binding: skipping originally unbound pf${i} (${pcie_bd} .${i} )"
@@ -1039,20 +1039,18 @@ fi
10391039# Check BF chip version and adjust register offsets.
10401040apply_chip_settings
10411041
1042- # Check NIC mode and unbind mlx5_core driver as needed .
1042+ # Check NIC mode and unbind mlx5_core driver in NIC mode .
10431043check_nic_mode
10441044
10451045# clear SP2 BITs to handle the case when ACPI events have been triggered before.
10461046clear_sp2_267
10471047
1048- if [ -n " ${pcie_bd} " -a ${deferred} -eq 0 ]; then
1049- if [ ${nic_mode} -eq 1 ]; then
1050- # Set BREADCRUMB.BIT32 to indicate NIC mode.
1051- breadcrumb1=$( ${BF_REG} $( basename ${rshim_node} ) ${RSH_BREADCRUMB1} .64 | awk ' {print $3}' )
1052- breadcrumb1=$(( breadcrumb1 | (0x1 << 32 )) )
1053- breadcrumb1=$( printf " 0x%x\n" $breadcrumb1 )
1054- ${BF_REG} $( basename ${rshim_node} ) ${RSH_BREADCRUMB1} .64 ${breadcrumb1} > /dev/null
1055- fi
1048+ if [ ${nic_mode} -eq 1 -a -n " ${pcie_bd} " -a ${deferred} -eq 0 ]; then
1049+ # Set BREADCRUMB.BIT32 to indicate NIC mode.
1050+ breadcrumb1=$( ${BF_REG} $( basename ${rshim_node} ) ${RSH_BREADCRUMB1} .64 | awk ' {print $3}' )
1051+ breadcrumb1=$(( breadcrumb1 | (0x1 << 32 )) )
1052+ breadcrumb1=$( printf " 0x%x\n" $breadcrumb1 )
1053+ ${BF_REG} $( basename ${rshim_node} ) ${RSH_BREADCRUMB1} .64 ${breadcrumb1} > /dev/null
10561054
10571055 for i in 0 1; do
10581056 if [[ ! -e /sys/bus/pci/drivers/mlx5_core/${pcie_bd} .${i} ]]; then
@@ -1155,3 +1153,4 @@ if [ ${deferred} -eq 1 ]; then
11551153 done
11561154 echo " Upgrade Finished"
11571155fi
1156+
0 commit comments