diff options
author | sudarsana.kalluru@cavium.com <sudarsana.kalluru@cavium.com> | 2017-04-26 12:00:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-27 16:51:33 -0400 |
commit | f470f22cfa3d42f357ed404a06ec77aa09ddb05b (patch) | |
tree | 6dcac6594740019ad70af9c746114b55e0ed19cd /drivers/net/ethernet/qlogic/qed/qed_dev.c | |
parent | 26d31ac11fa47a0ee8dc4c64136ea34feda57e3e (diff) |
qed: Add support for MFW resource locking.
The patch adds API for default initialization of the MFW resource
locking.
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_dev.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dev.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index ea7931b85879..2a3ae00bbd42 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c | |||
@@ -2347,9 +2347,6 @@ static int qed_hw_set_resc_info(struct qed_hwfn *p_hwfn) | |||
2347 | return 0; | 2347 | return 0; |
2348 | } | 2348 | } |
2349 | 2349 | ||
2350 | #define QED_RESC_ALLOC_LOCK_RETRY_CNT 10 | ||
2351 | #define QED_RESC_ALLOC_LOCK_RETRY_INTVL_US 10000 /* 10 msec */ | ||
2352 | |||
2353 | static int qed_hw_get_resc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) | 2350 | static int qed_hw_get_resc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) |
2354 | { | 2351 | { |
2355 | struct qed_resc_unlock_params resc_unlock_params; | 2352 | struct qed_resc_unlock_params resc_unlock_params; |
@@ -2366,13 +2363,8 @@ static int qed_hw_get_resc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) | |||
2366 | * needed, and proceed to the queries. Other failures, including a | 2363 | * needed, and proceed to the queries. Other failures, including a |
2367 | * failure to acquire the lock, will cause this function to fail. | 2364 | * failure to acquire the lock, will cause this function to fail. |
2368 | */ | 2365 | */ |
2369 | memset(&resc_lock_params, 0, sizeof(resc_lock_params)); | 2366 | qed_mcp_resc_lock_default_init(&resc_lock_params, &resc_unlock_params, |
2370 | resc_lock_params.resource = QED_RESC_LOCK_RESC_ALLOC; | 2367 | QED_RESC_LOCK_RESC_ALLOC, false); |
2371 | resc_lock_params.retry_num = QED_RESC_ALLOC_LOCK_RETRY_CNT; | ||
2372 | resc_lock_params.retry_interval = QED_RESC_ALLOC_LOCK_RETRY_INTVL_US; | ||
2373 | resc_lock_params.sleep_b4_retry = true; | ||
2374 | memset(&resc_unlock_params, 0, sizeof(resc_unlock_params)); | ||
2375 | resc_unlock_params.resource = QED_RESC_LOCK_RESC_ALLOC; | ||
2376 | 2368 | ||
2377 | rc = qed_mcp_resc_lock(p_hwfn, p_ptt, &resc_lock_params); | 2369 | rc = qed_mcp_resc_lock(p_hwfn, p_ptt, &resc_lock_params); |
2378 | if (rc && rc != -EINVAL) { | 2370 | if (rc && rc != -EINVAL) { |