From patchwork Wed Nov 15 14:39:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 165433 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2583786vqg; Wed, 15 Nov 2023 06:44:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBK4onvHaNmFw8WeeIJ3bW/x1yPCGeu/enzoLPkPLgvwPNHnxsF0O136XJoCWwB0mwvyFW X-Received: by 2002:a17:902:ea10:b0:1cc:4073:88a1 with SMTP id s16-20020a170902ea1000b001cc407388a1mr7074662plg.0.1700059458374; Wed, 15 Nov 2023 06:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700059458; cv=none; d=google.com; s=arc-20160816; b=sfHQVEKYR6cIxTVIxDsyeUkQIPTWUnit4r6zNGiwoimJLox3cBUugzY0DSbi/K2CIc h8W55R2mjfUFAd1ikailQZ9wOfuJpn/nZpeq0u82CsJoAJCvOUwn+jf5zQAsP3/K1v+a cxOK0+aFnw4sV7payn0MnrDO23+H4OO3C+FvDlQF2TS/a0IcoAiDHX9e1AtKhHAe5q53 Ms9MtyhO1sVf5is3sZJh8nT8QoVh51FedfRPoTPpTXmGpzxyymOoB/uk+uPbHy3fayT5 KHPDaPu8OjjxTsPj+N0Ohv11Da7pafdNWPZ9tMige7rBj8EgT9OregTusCj9UWkIwUhu LgmQ== 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=Lh9pPS+jQCHhQyqizvMNEPc1YPfb2o7BPfYkbfXINT0=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=e++OEdr9GiHSGjQSakXLPLGRAX5Woo+QFQySM8EJWd7TlmpiE4jIdTcVclfSrji4L6 kFObssL7Kl4jwL5eRXOOB8ugWfD6DuJCf0cLxoKE7fDYhYjmE4igRRyASIFHxjIW9K9z 2CbBGDJPsm2pEzd5yMxSJtAj1VRjvI9qmBknLFXDzIFakyi6rfzaCXvvxGTWGpbFm1SV WntayFyOANojl/muXI1C1BUUpq4Pb3ARdzNhsjJ8J0cU2yGs1PnEP89S+Yf7pAKJ9eip jVWU4BxqWhsjT+v6OPDIus9R1vzQTQuoTSDf0ahN79gfhExfU8fgGr/Jl+HSdbNkO6bo X8aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ctxSa+Gh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id d16-20020a170902b71000b001cc259278a5si9700144pls.647.2023.11.15.06.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ctxSa+Gh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 831D3801F963; Wed, 15 Nov 2023 06:44:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344362AbjKOOlf (ORCPT + 29 others); Wed, 15 Nov 2023 09:41:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344291AbjKOOlE (ORCPT ); Wed, 15 Nov 2023 09:41:04 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7424C1BCE; Wed, 15 Nov 2023 06:40:38 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id 5FC01FF809; Wed, 15 Nov 2023 14:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700059236; 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=Lh9pPS+jQCHhQyqizvMNEPc1YPfb2o7BPfYkbfXINT0=; b=ctxSa+GhCJ+4cxBCz+PeN/N+hHdbHgihBsYSey2iHNI2btKTKrVw6SAg6qVcFfHPkMaMiM oWr/PpA51cAzyYB9vryXjLErxsW7RwzXQpaf8R2rgReVBKjCHhZxqoxsFja/BbWqnSSPDO 0/4iSVISNyQRIVpCBHTaK/tuezqKnqbbnWGoAM5vwi4qpYtB+BIhhVD7P8t+TEFqixy2iZ OQdamXVolCytolaBt88udQEnSblF7sWZQyLLLlBfto1yMimOJBZhyC53ToGtMwO8EYDCeZ rYRqfRZpSZ4igZIM0Pemmb3mfVmagAOW23zuEroitSZVUR/Dw12x6glEHFYYdA== From: Herve Codina To: Herve Codina , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap 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, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: [PATCH v9 13/27] soc: fsl: cpm1: qmc: Check available timeslots in qmc_check_chans() Date: Wed, 15 Nov 2023 15:39:49 +0100 Message-ID: <20231115144007.478111-14-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115144007.478111-1-herve.codina@bootlin.com> References: <20231115144007.478111-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 06:44:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782641546500693279 X-GMAIL-MSGID: 1782641546500693279 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 Reviewed-by: Christophe Leroy --- 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 f2a71a140db7..8d71e63d0f21 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; } }