From patchwork Thu Sep 28 07:06:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 145933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3210492vqu; Thu, 28 Sep 2023 03:34:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErRQef+L06h2JZRKlnnWe7yshYJVBZVdw3jEVWK/EToHKtn3WK8qDyzqb5UnoARqrXY+Zr X-Received: by 2002:a17:902:c18d:b0:1c5:ce3c:c391 with SMTP id d13-20020a170902c18d00b001c5ce3cc391mr605825pld.12.1695897273436; Thu, 28 Sep 2023 03:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695897273; cv=none; d=google.com; s=arc-20160816; b=vdlXUBw7IIKlR7p0MMd5pDayXcQiUERViAJtYMKYX9mlOVIfJR+VjIADvpOtrZsi5t zKCP2MJcNwd7DVnHbTK2n7FWrZhYykMjklQE8shgk/IN1AgvoBhGUwQcmZ/bqE7mMTxG G4trSgTXJPCwldFmhzicJQzDTqFsoG21/mo/YEqhaoWwomX6P8qQ5/VuzkRVz7+a258O w0nxVnHGSp50vhSSZhWIwHLPHvKAHwvTMYQUFOojAr36R7JeR+EgyqkT3bl7bRbMunNs 7knb0LF0HqQIvP2bRl5dOWMXTn8bP2mmCo0GzqqMZidybC9rVFqjKxEHsAtv0p4ROfQb d86g== 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=o/xbDf8eMD5E6WB0NjH/5DUWVpmxRzR+EOenyt8frKM=; fh=8Kc64rxAF0/ep7JtUzveSO6N9QMBWtHyiJ9nqNn2Uww=; b=0r9eHteHsup6Kn46/SYJMTCaBCXLfx60wHXz1n6f9Ikq8Bt2NRhLQSnsM/9/7Kiw6K fWd7PUWOtpFVkHk+f2lnic4/6wQgqWbha84NWxHJjEn4IrR+vc6aFzsWOQsY4hCa8kab HRW+0bqMjkEvnJ4wgZGhvyA7SqtLn/1ruQO3ivZPvckfq7eqXKqJXKezoZyy8hXK9M27 ldwcadtryYOojuRpddCT+YJs+GzxX9ZmR9dYYC599017MDaQnBC+gGpZYSR6JyNDIdNQ PMVu43Im9OvW1hefslVEtRwNkP1wuOVUx66pUyWkdJdsYpYlHX4ME1AwBTo7T3snPKwe XbMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dGICtuvR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k5-20020a170902c40500b001b80ecdcb88si20046160plk.473.2023.09.28.03.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 03:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dGICtuvR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 6D9AA80C876F; Thu, 28 Sep 2023 00:10:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230490AbjI1HJ5 (ORCPT + 20 others); Thu, 28 Sep 2023 03:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbjI1HJh (ORCPT ); Thu, 28 Sep 2023 03:09:37 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9982A1FFB; Thu, 28 Sep 2023 00:08:03 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 95BC620009; Thu, 28 Sep 2023 07:07:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695884882; 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=o/xbDf8eMD5E6WB0NjH/5DUWVpmxRzR+EOenyt8frKM=; b=dGICtuvRjk7Hddbz3PCOogHz/QjfDd/lv87e3QspmRSY6kGl5kuGhwwt689rRtqI31dnXA t969wO06bCjVjzB2NI8Y6uj6lrbPoKKdpEnoZ4wWsUlbM+XGzrbB52F/VqQfLDc9qj+2ug lbA98bHjc6Tp1Y5UuA5L33ew+c2LbVLHeORaeUMNgtYAR5+RvMpF8bn0FXbtUw4RET2SSK Kus+UYWyxeZpLQU/wnFR8JkirfJU9TFXNMVe1Oe11nUK4JQnFhE+w7qFNivmWs8tzcjr/h bk8JDXSJU56nwBEpuRsm1EbfTKlZkG0ekZ0dyc8GCYQLf5BW85X8RF2qR4/5bw== From: Herve Codina To: Herve Codina , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , 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 v7 16/30] soc: fsl: cpm1: qmc: Check available timeslots in qmc_check_chans() Date: Thu, 28 Sep 2023 09:06:34 +0200 Message-ID: <20230928070652.330429-17-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928070652.330429-1-herve.codina@bootlin.com> References: <20230928070652.330429-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:10:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778277179745972883 X-GMAIL-MSGID: 1778277179745972883 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 1189e6076e37..269d10cd3c7a 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; } }