diff mbox series

[v2] bnxt_en: use new module_firmware_crashed()

Message ID 1589617529-24009-1-git-send-email-vasundhara-v.volam@broadcom.com
State Changes Requested
Delegated to: David Miller
Headers show
Series [v2] bnxt_en: use new module_firmware_crashed() | expand

Commit Message

Vasundhara Volam May 16, 2020, 8:25 a.m. UTC
This makes use of the new module_firmware_crashed() to help
annotate when firmware for device drivers crash. When firmware
crashes devices can sometimes become unresponsive, and recovery
sometimes requires a driver unload / reload and in the worst cases
a reboot.

Using a taint flag allows us to annotate when this happens clearly.

Cc: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
v2: Move call module_firmware_crashed() to bnxt_fw_fatal_recover().
This will optimize to make the call at one central place.

Please append to the patchset:
("[PATCH v2 00/15] net: taint when the device driver firmware crashes")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 1 +
 1 file changed, 1 insertion(+)

Comments

kernel test robot May 16, 2020, 12:55 p.m. UTC | #1
Hi Vasundhara,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on sparc-next/master]
[also build test ERROR on linus/master v5.7-rc5 next-20200515]
[cannot apply to ipvs/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Vasundhara-Volam/bnxt_en-use-new-module_firmware_crashed/20200516-163022
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next.git master
config: ia64-randconfig-r013-20200515 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c: In function 'bnxt_fw_fatal_recover':
>> drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:124:2: error: implicit declaration of function 'module_firmware_crashed' [-Werror=implicit-function-declaration]
124 |  module_firmware_crashed();
|  ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/module_firmware_crashed +124 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

   112	
   113	static int bnxt_fw_fatal_recover(struct devlink_health_reporter *reporter,
   114					 void *priv_ctx,
   115					 struct netlink_ext_ack *extack)
   116	{
   117		struct bnxt *bp = devlink_health_reporter_priv(reporter);
   118		struct bnxt_fw_reporter_ctx *fw_reporter_ctx = priv_ctx;
   119		unsigned long event;
   120	
   121		if (!priv_ctx)
   122			return -EOPNOTSUPP;
   123	
 > 124		module_firmware_crashed();
   125		bp->fw_health->fatal = true;
   126		event = fw_reporter_ctx->sp_event;
   127		if (event == BNXT_FW_RESET_NOTIFY_SP_EVENT)
   128			bnxt_fw_reset(bp);
   129		else if (event == BNXT_FW_EXCEPTION_SP_EVENT)
   130			bnxt_fw_exception(bp);
   131	
   132		return -EINPROGRESS;
   133	}
   134	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot May 16, 2020, 1:30 p.m. UTC | #2
Hi Vasundhara,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on sparc-next/master]
[also build test ERROR on linus/master v5.7-rc5 next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Vasundhara-Volam/bnxt_en-use-new-module_firmware_crashed/20200516-163022
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next.git master
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 13d44b2a0c7ef404b13b16644765977cd5310fe2)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:124:2: error: implicit declaration of function 'module_firmware_crashed' [-Werror,-Wimplicit-function-declaration]
module_firmware_crashed();
^
1 error generated.

vim +/module_firmware_crashed +124 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

   112	
   113	static int bnxt_fw_fatal_recover(struct devlink_health_reporter *reporter,
   114					 void *priv_ctx,
   115					 struct netlink_ext_ack *extack)
   116	{
   117		struct bnxt *bp = devlink_health_reporter_priv(reporter);
   118		struct bnxt_fw_reporter_ctx *fw_reporter_ctx = priv_ctx;
   119		unsigned long event;
   120	
   121		if (!priv_ctx)
   122			return -EOPNOTSUPP;
   123	
 > 124		module_firmware_crashed();
   125		bp->fw_health->fatal = true;
   126		event = fw_reporter_ctx->sp_event;
   127		if (event == BNXT_FW_RESET_NOTIFY_SP_EVENT)
   128			bnxt_fw_reset(bp);
   129		else if (event == BNXT_FW_EXCEPTION_SP_EVENT)
   130			bnxt_fw_exception(bp);
   131	
   132		return -EINPROGRESS;
   133	}
   134	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index a812beb..1e37938 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -121,6 +121,7 @@  static int bnxt_fw_fatal_recover(struct devlink_health_reporter *reporter,
 	if (!priv_ctx)
 		return -EOPNOTSUPP;
 
+	module_firmware_crashed();
 	bp->fw_health->fatal = true;
 	event = fw_reporter_ctx->sp_event;
 	if (event == BNXT_FW_RESET_NOTIFY_SP_EVENT)