summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qed/qed_dev_api.h
diff options
context:
space:
mode:
authorRahul Verma2017-04-06 14:58:29 +0200
committerDavid S. Miller2017-04-06 23:26:31 +0200
commit1558296251207bb0def2ae7cc045f8159ee0c204 (patch)
tree78dfe47aa021d543d3e12b5fb4df12796a8dee87 /drivers/net/ethernet/qlogic/qed/qed_dev_api.h
parentqed: Warn PTT usage by wrong hw-function (diff)
downloadkernel-qcow2-linux-1558296251207bb0def2ae7cc045f8159ee0c204.tar.gz
kernel-qcow2-linux-1558296251207bb0def2ae7cc045f8159ee0c204.tar.xz
kernel-qcow2-linux-1558296251207bb0def2ae7cc045f8159ee0c204.zip
qed: Don't use main-ptt in unrelated flows
In order to access HW registers driver needs to acquire a PTT entry [mapping between bar memory and internal chip address]. Since acquiring PTT entries could fail [at least in theory] as their number is finite and other flows can hold them, we reserve special PTT entries for 'important' enough flows - ones we want to guarantee that would not be susceptible to such issues. One such special entry is the 'main' PTT which is meant to be used in flows such as chip initialization and de-initialization. However, there are other flows that are also using that same entry for their own purpose, and might run concurrently with the original flows [notice that for most cases using the main-ptt by mistake, such a race is still impossible, at least today]. This patch re-organizes the various functions that currently use the main_ptt in one of two ways: - If a function shouldn't use the main_ptt it starts acquiring and releasing it's own PTT entry and use it instead. Notice if those functions previously couldn't fail, they now can [as acquisition might fail]. - Change the prototypes so that the main_ptt would be received as a parameter [instead of explicitly accessing it]. This prevents the future risk of adding codes that introduces new use-cases for flows using the main_ptt, ones that might be in race with the actual 'main' flows. Signed-off-by: Rahul Verma <Rahul.Verma@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_api.h')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_dev_api.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev_api.h b/drivers/net/ethernet/qlogic/qed/qed_dev_api.h
index 2c6637fd7ef6..341636da9964 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev_api.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev_api.h
@@ -165,17 +165,19 @@ int qed_hw_stop(struct qed_dev *cdev);
*
* @param cdev
*
+ * @return int
*/
-void qed_hw_stop_fastpath(struct qed_dev *cdev);
+int qed_hw_stop_fastpath(struct qed_dev *cdev);
/**
* @brief qed_hw_start_fastpath -restart fastpath traffic,
* only if hw_stop_fastpath was called
*
- * @param cdev
+ * @param p_hwfn
*
+ * @return int
*/
-void qed_hw_start_fastpath(struct qed_hwfn *p_hwfn);
+int qed_hw_start_fastpath(struct qed_hwfn *p_hwfn);
/**