aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qed/qed_mcp.h
diff options
context:
space:
mode:
authorTomer Tayar <Tomer.Tayar@cavium.com>2018-08-20 00:01:45 +0300
committerDavid S. Miller <davem@davemloft.net>2018-08-20 11:34:39 -0700
commitb310974e041913231b6e3d5d475d4df55c312301 (patch)
treed0d052630cf2201ade7ef0590bf11ceeb8c77873 /drivers/net/ethernet/qlogic/qed/qed_mcp.h
parentqed: Prevent a possible deadlock during driver load and unload (diff)
downloadlinux-dev-b310974e041913231b6e3d5d475d4df55c312301.tar.xz
linux-dev-b310974e041913231b6e3d5d475d4df55c312301.zip
qed: Avoid sending mailbox commands when MFW is not responsive
Keep sending mailbox commands to the MFW when it is not responsive ends up with a redundant amount of timeout expiries. This patch prints the MCP status on the first command which is not responded, and blocks the following commands. Since the (un)load request commands might be not responded due to other PFs, the patch also adds the option to skip the blocking upon a failure. Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com> Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_mcp.h')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_mcp.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h
index b9d3ecf7aad6..85e6b3989e7a 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h
@@ -635,11 +635,14 @@ struct qed_mcp_info {
*/
spinlock_t cmd_lock;
+ /* Flag to indicate whether sending a MFW mailbox command is blocked */
+ bool b_block_cmd;
+
/* Spinlock used for syncing SW link-changes and link-changes
* originating from attention context.
*/
spinlock_t link_lock;
- bool block_mb_sending;
+
u32 public_base;
u32 drv_mb_addr;
u32 mfw_mb_addr;
@@ -670,6 +673,7 @@ struct qed_mcp_mb_params {
u32 mcp_param;
u32 flags;
#define QED_MB_FLAG_CAN_SLEEP (0x1 << 0)
+#define QED_MB_FLAG_AVOID_BLOCK (0x1 << 1)
#define QED_MB_FLAGS_IS_SET(params, flag) \
({ typeof(params) __params = (params); \
(__params && (__params->flags & QED_MB_FLAG_ ## flag)); })