]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
i40e: Implement debug macro hw_dbg using dev_dbg
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Tue, 3 Sep 2019 19:20:21 +0000 (16:20 -0300)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 9 Sep 2019 18:22:20 +0000 (11:22 -0700)
There are several uses of hw_dbg in the code, producing no output. This
patch implements it using dev_debug.

Initially the intention was to implement it using netdev_dbg, analogously
to what is done in ixgbe for instance. That approach was avoided due to
some early usages of hw_dbg, like i40e_pf_reset, before the VSI structure
initialization causing NULL pointer dereference during the driver probe if
the debug messages were turned on as soon as the module is probed.

v2:
 - Use dev_dbg instead of pr_debug, and take advantage of dev_name
instead of crafting pretty much the same device name locally as suggested
by Jakub Kicinski.

Signed-off-by: "Mauro S. M. Rodrigues" <maurosr@linux.vnet.ibm.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_hmc.c
drivers/net/ethernet/intel/i40e/i40e_osdep.h

index 46e649c09f72c92d085836c212fca5bab67ae4f3..d37c6e0e5f088eed43c429136182dc203b4e04c9 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 2013 - 2018 Intel Corporation. */
 
+#include "i40e.h"
 #include "i40e_type.h"
 #include "i40e_adminq.h"
 #include "i40e_prototype.h"
index 19ce93d7fd0a900f07fa606f79eca07c2bd0f9f8..163ee8c6311cc863f4fc5f77c59bf5f814b8cfc8 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 2013 - 2018 Intel Corporation. */
 
+#include "i40e.h"
 #include "i40e_osdep.h"
 #include "i40e_register.h"
 #include "i40e_status.h"
index a07574bff5508bd7c606f8010b0e96fd5345d8e4..c302ef2524f8476c3a367bbc1787670ffbe12d73 100644 (file)
  * actual OS primitives
  */
 
-#define hw_dbg(hw, S, A...)    do {} while (0)
+#define hw_dbg(hw, S, A...)                                                    \
+do {                                                                           \
+       dev_dbg(&((struct i40e_pf *)hw->back)->pdev->dev, S, ##A);              \
+} while (0)
 
 #define wr32(a, reg, value)    writel((value), ((a)->hw_addr + (reg)))
 #define rd32(a, reg)           readl((a)->hw_addr + (reg))