diff options
author | Laurentiu Tudor <laurentiu.tudor@nxp.com> | 2019-04-27 10:10:24 +0300 |
---|---|---|
committer | Li Yang <leoyang.li@nxp.com> | 2019-05-20 14:28:16 -0500 |
commit | 5d1d046e2868fc876a69231eb2f24f000b521f1c (patch) | |
tree | 0167f1d24f1bec27a959feb8d1da515c337c2814 /include/soc | |
parent | d9ebd99d9a2ff7857b8dbfebd4604f80064d749c (diff) | |
download | lwn-5d1d046e2868fc876a69231eb2f24f000b521f1c.tar.gz lwn-5d1d046e2868fc876a69231eb2f24f000b521f1c.zip |
soc: fsl: qbman_portals: add APIs to retrieve the probing status
Add a couple of new APIs to check the probing status of the required
cpu bound qman and bman portals:
'int bman_portals_probed()' and 'int qman_portals_probed()'.
They return the following values.
* 1 if qman/bman portals were all probed correctly
* 0 if qman/bman portals were not yet probed
* -1 if probing of qman/bman portals failed
Portals are considered successful probed if no error occurred during
the probing of any of the portals and if enough portals were probed
to have one available for each cpu.
The error handling paths were slightly rearranged in order to fit this
new functionality without being too intrusive.
Drivers that use qman/bman portal driver services are required to use
these APIs before calling any functions exported by these drivers or
otherwise they will crash the kernel.
First user will be the dpaa1 ethernet driver, coming in a subsequent
patch.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/fsl/bman.h | 8 | ||||
-rw-r--r-- | include/soc/fsl/qman.h | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/soc/fsl/bman.h b/include/soc/fsl/bman.h index 5b99cb2ea5ef..173e4049d963 100644 --- a/include/soc/fsl/bman.h +++ b/include/soc/fsl/bman.h @@ -133,5 +133,13 @@ int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num); * failed to probe or 0 if the bman driver did not probed yet. */ int bman_is_probed(void); +/** + * bman_portals_probed - Check if all cpu bound bman portals are probed + * + * Returns 1 if all the required cpu bound bman portals successfully probed, + * -1 if probe errors appeared or 0 if the bman portals did not yet finished + * probing. + */ +int bman_portals_probed(void); #endif /* __FSL_BMAN_H */ diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index 5cc7af06c1ba..aa31c05a103a 100644 --- a/include/soc/fsl/qman.h +++ b/include/soc/fsl/qman.h @@ -1195,6 +1195,15 @@ int qman_release_cgrid(u32 id); int qman_is_probed(void); /** + * qman_portals_probed - Check if all cpu bound qman portals are probed + * + * Returns 1 if all the required cpu bound qman portals successfully probed, + * -1 if probe errors appeared or 0 if the qman portals did not yet finished + * probing. + */ +int qman_portals_probed(void); + +/** * qman_dqrr_get_ithresh - Get coalesce interrupt threshold * @portal: portal to get the value for * @ithresh: threshold pointer |