Message ID | 20230726150225.483464-13-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp483514vqo; Wed, 26 Jul 2023 08:33:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlFTc1xH4MC9W9NgC+jzuQbf5n6VOWY0A9qJHFgRijfv4lfM5SOroGAPFe9mVcJpk6Uj13cs X-Received: by 2002:a05:6a20:734c:b0:126:9539:ec30 with SMTP id v12-20020a056a20734c00b001269539ec30mr2005366pzc.19.1690385615777; Wed, 26 Jul 2023 08:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690385615; cv=none; d=google.com; s=arc-20160816; b=agVWVk3IRdGjTSyilEgFH0S7pvaoH39fepbRKnS8zJ9uuOEjb1z5+2N5kl5mxEmAz6 yC1jqHTgva3GcpcqekDEZoOukVb7sUIFnVifm2ChG9kDyHUkGH63C1Pf8+RVPjxvutEu uhKLQcvyytLCp8CjTlDnfY9xE9AMua9jScYqVlDDNiGXwXSlIfR+LiuzJDHgGl99jDR3 gyDKMswGfiTbCHZhyGDDJjhrFelSFm0B+H9DMq29eP5Dbflri4WOwyKR/9WADrY3acmU JmfmmG3VtVBy6XF0vgEZ18wvT7M3ijQwe+2nSxdvX73lTjNzEc7K4XW+s7+H/07qaW+z 4x/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c62JTij9qXsa4Bb0xZr4pmmcZkl5oze5t/WoxnT8+UU=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=oCjB+d2US0B9ahIx/UeMhJXsZli6mKKY0sTdbuQ1E38rNpOFOPFvR9X8HtOal9cHJ7 ltFGGPVB9T71uvEnFc0ER4NiW7IEidQKZttfGo9aItkpxMi+6LYWpTdFKg1Vtf51MUsc 5IFHhSWfz0Z/VRfFz1lNAa4Ddx6QbbjBbWlN09njjKTuCwGS4kSwR0za7V37r3bj0gKO 5NExDJI0qRLuH44B4mqBIYq2ygMXqO0KUBD5I3vxqV3B8TWczDb+zuNORdVc8xLt2Ra/ WCfz28ce+2R9nIvSeTlUv4rI407ivBDgLca1uiEfEMsOG9P5RZBXoMFZS2CPfI9LvO/G HHmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jif3hMBa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dw15-20020a056a00368f00b0066c72802132si13374188pfb.369.2023.07.26.08.33.21; Wed, 26 Jul 2023 08:33:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jif3hMBa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234703AbjGZPEI (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Wed, 26 Jul 2023 11:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234699AbjGZPDa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Jul 2023 11:03:30 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1A82719; Wed, 26 Jul 2023 08:03:23 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 968A61C0008; Wed, 26 Jul 2023 15:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690383802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c62JTij9qXsa4Bb0xZr4pmmcZkl5oze5t/WoxnT8+UU=; b=jif3hMBaRYRD+UzDUcpsU0B9A3hIVCsgreX4QCSmrxt9w07MHfxJRYzfFzXW5dcCfaj0iz j/vOmR2XYNqSpqmnX6v0trnz+DDHm9sXGtm1bE25fYWDHXh5q4FmrvUOQDpy1lgwHKv5W/ OJSt5Y0JN2BdeQmoMWjv+zXtKmcoZD1sBFAloZs6b4ixvnazpo0E/PI6Wr2btzDkPA6hdi Hveg/EOU4p9BgalgUc2Y1SdNyNKBuTs3qAmEmHyuRzJVfebt4yTo8h/VU6LsFA7jaQvBqh OW3znwheuYVrtHEL9hgo1ez8dhwsi//dgvY/nBIsLoYLzD0oqMOmiTBd5XUhJA== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Shengjiu Wang <shengjiu.wang@gmail.com>, Xiubo Li <Xiubo.Lee@gmail.com>, Fabio Estevam <festevam@gmail.com>, Nicolin Chen <nicoleotsuka@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Randy Dunlap <rdunlap@infradead.org> Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v2 12/28] soc: fsl: cpm1: qmc: Check available timeslots in qmc_check_chans() Date: Wed, 26 Jul 2023 17:02:08 +0200 Message-ID: <20230726150225.483464-13-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230726150225.483464-1-herve.codina@bootlin.com> References: <20230726150225.483464-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772497787372503405 X-GMAIL-MSGID: 1772497787372503405 |
Series |
Add support for QMC HDLC, framer infrastruture and PEF2256 framer
|
|
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
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 --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; } }