From 28ea21aef0faffd04655962d82f5d07af6b8410c Mon Sep 17 00:00:00 2001 From: byu343 Date: Sat, 21 Mar 2020 18:32:57 -0700 Subject: [PATCH] Fix kernel panic for irq after fast-reboot (#823) After the change in master branch updating SAI from 3.5.3.1m-25 to 3.7.3.2, we always found kernel panic after running fast-reboot command in testing SONiC with traffic. In the up path of fast-reboot, we can find warning messages like "unhandled irq 16 error" before kernel panic, which implies that some components are not properly closed in the down path. This fix will unload certain kernel modules by stopping opennsl before fast-reboot, which is suggested by BRCM. Note that another part of the fix is to add 'ExecStop=-/etc/init.d/opennsl-modules stop' to sonic-buildimage:platform/broadcom/saibcm-modules/systemd/opennsl-modules.service, which will be included in another pull request. --- scripts/fast-reboot | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 66309fa85e7e..02c035001b64 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -529,6 +529,13 @@ then systemctl stop nps-modules-`uname -r`.service || debug "Ignore stopping nps service error $?" fi +# Stop opennsl modules for Broadcom platform +if [[ "$sonic_asic_type" = 'broadcom' ]]; +then + service_name=$(systemctl list-units --plain --no-pager --no-legend --type=service | grep opennsl | cut -f 1 -d' ') + systemctl stop "$service_name" +fi + # Update the reboot cause file to reflect that user issued this script # Upon next boot, the contents of this file will be used to determine the # cause of the previous reboot