diff mbox series

[v2,12/28] soc: fsl: cpm1: qmc: Check available timeslots in qmc_check_chans()

Message ID 20230726150225.483464-13-herve.codina@bootlin.com (mailing list archive)
State Superseded
Headers show
Series Add support for QMC HDLC, framer infrastruture and PEF2256 framer | expand

Checks

Context Check Description
netdev/series_format fail Series longer than 15 patches (and no cover letter)
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch warning WARNING: line length of 94 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Herve Codina July 26, 2023, 3:02 p.m. UTC
The timeslots checked in qmc_check_chans() are the timeslots used.
With the introduction of the available timeslots, the used timeslots
are a subset of the available timeslots. The timeslots checked during
the qmc_check_chans() call should be the available ones.

Simply update and check the available timeslots instead of the used
timeslots in qmc_check_chans().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/soc/fsl/qe/qmc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Christophe Leroy Aug. 8, 2023, 8:06 a.m. UTC | #1
Le 26/07/2023 à 17:02, Herve Codina a écrit :
> The timeslots checked in qmc_check_chans() are the timeslots used.
> With the introduction of the available timeslots, the used timeslots
> are a subset of the available timeslots. The timeslots checked during
> the qmc_check_chans() call should be the available ones.
> 
> Simply update and check the available timeslots instead of the used
> timeslots in qmc_check_chans().
> 
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>


Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>


> ---
>   drivers/soc/fsl/qe/qmc.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
> index 33761c39aee1..82405915f2a4 100644
> --- a/drivers/soc/fsl/qe/qmc.c
> +++ b/drivers/soc/fsl/qe/qmc.c
> @@ -914,13 +914,13 @@ static int qmc_check_chans(struct qmc *qmc)
>   	rx_ts_assigned_mask = info.nb_rx_ts == 64 ? U64_MAX : (((u64)1) << info.nb_rx_ts) - 1;
>   
>   	list_for_each_entry(chan, &qmc->chan_head, list) {
> -		if (chan->tx_ts_mask > tx_ts_assigned_mask) {
> -			dev_err(qmc->dev, "chan %u uses TSA unassigned Tx TS\n", chan->id);
> +		if (chan->tx_ts_mask_avail > tx_ts_assigned_mask) {
> +			dev_err(qmc->dev, "chan %u can use TSA unassigned Tx TS\n", chan->id);
>   			return -EINVAL;
>   		}
>   
> -		if (chan->rx_ts_mask > rx_ts_assigned_mask) {
> -			dev_err(qmc->dev, "chan %u uses TSA unassigned Rx TS\n", chan->id);
> +		if (chan->rx_ts_mask_avail > rx_ts_assigned_mask) {
> +			dev_err(qmc->dev, "chan %u can use TSA unassigned Rx TS\n", chan->id);
>   			return -EINVAL;
>   		}
>   	}
diff mbox series

Patch

diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
index 33761c39aee1..82405915f2a4 100644
--- a/drivers/soc/fsl/qe/qmc.c
+++ b/drivers/soc/fsl/qe/qmc.c
@@ -914,13 +914,13 @@  static int qmc_check_chans(struct qmc *qmc)
 	rx_ts_assigned_mask = info.nb_rx_ts == 64 ? U64_MAX : (((u64)1) << info.nb_rx_ts) - 1;
 
 	list_for_each_entry(chan, &qmc->chan_head, list) {
-		if (chan->tx_ts_mask > tx_ts_assigned_mask) {
-			dev_err(qmc->dev, "chan %u uses TSA unassigned Tx TS\n", chan->id);
+		if (chan->tx_ts_mask_avail > tx_ts_assigned_mask) {
+			dev_err(qmc->dev, "chan %u can use TSA unassigned Tx TS\n", chan->id);
 			return -EINVAL;
 		}
 
-		if (chan->rx_ts_mask > rx_ts_assigned_mask) {
-			dev_err(qmc->dev, "chan %u uses TSA unassigned Rx TS\n", chan->id);
+		if (chan->rx_ts_mask_avail > rx_ts_assigned_mask) {
+			dev_err(qmc->dev, "chan %u can use TSA unassigned Rx TS\n", chan->id);
 			return -EINVAL;
 		}
 	}