From patchwork Tue Sep 12 10:13:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 138103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp333523vqx; Tue, 12 Sep 2023 04:21:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9QIfFENRIyrxleUpDSCLJ5n2XBFPpq3cjSym/D2iUj43MbTNFe8qc+mHKWRDDMyrdxxiw X-Received: by 2002:a05:6a20:7d83:b0:14c:def0:dadc with SMTP id v3-20020a056a207d8300b0014cdef0dadcmr12670347pzj.30.1694517679765; Tue, 12 Sep 2023 04:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694517679; cv=none; d=google.com; s=arc-20160816; b=PDqLmpiWitECuo/kc0g3HYGlt+VFBiDteJMy0JstuP6UxhbcwZlyVT8HzwoKl3rvPy MQQHTiFHpm0YSCYuM9SSY3z4NlNpbeMA22wY3fYByzsImGfUrEqqaMCo4RoP+vAXoKzA eFHfKhMM0b6ai69UCbWPGEdnKWdkq8Un42MHmbZ1/TznOSemQuFLz9ra9rgSWfoPBwvn LxB00PhEvUQUtj/OxgIxZrvv+QdrvvSDp3c+OqSUZz5WNKYSrWrVSM8WLtEeo+iGroPQ 0BQUFjn0AzHIkjnviAnNRG3BZBwwvLpyMWqCby0shmjw4ROpPDY7lrBaEvx2AlAKW6R+ mmDw== 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=GfKXqceCJRcdJy8GVo/qvxOxSxxXVg9uDZ8RcdLStV4=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=WG+rtOVhCo8ScZhy4ldK+ejB5LsUEEEKlLgEsS6wIyvf3rjXRah/dC7neG5RT9qfG8 xfx3GFE+uxC4cHTRu68x4ZTmkSBdBaJNQLs4zqBICHTfzPwAw5yy/V2SEUbypXOK/G4i j6L9/FkdBxy9yBKPMC/rooHmHjzaaFlTK4elGV6wLR9ZT4TR3iCTCGBNjHpd/XkVQH3J eu7aNQIryBeilG5BqpBTdvssJJ1XMl+mDufYp0r2QqQ2MdertLMeOf5dhwVKWoqOZkYn MEjW4qp23VQjOx6q77dbb+WbqOWnT+/mp3cx9ag2oX/UtS1jtuJHyITcEAFnOi2aSEnO 3irQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BpFZPjk8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id t13-20020a056a00138d00b0068ff659af62si92961pfg.106.2023.09.12.04.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 04:21:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BpFZPjk8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 9FC7082664A4; Tue, 12 Sep 2023 03:14:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233977AbjILKN6 (ORCPT + 37 others); Tue, 12 Sep 2023 06:13:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233960AbjILKNu (ORCPT ); Tue, 12 Sep 2023 06:13:50 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C3E19AB; Tue, 12 Sep 2023 03:13:44 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 7F809240012; Tue, 12 Sep 2023 10:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1694513623; 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=GfKXqceCJRcdJy8GVo/qvxOxSxxXVg9uDZ8RcdLStV4=; b=BpFZPjk88vC3dCTL9ZT8v/dJcorZosIrlcJ1y/TqzK3C5fS+ZWMYI2jbjDb4UTuweXdRli 7eIVxQq/4B7MBQzN+K9IYJYPN4MSF+aLdu/BI6d65aYqLNs/9pvBTywCfkzaHuQ7b0x0hJ PzaBzPr2TGRCte+TxXmCZLsy0mGHqYRLHBvgOC2ugWgJpiCuZ0UHksFmoyWek7M8WyM2z2 LmXMVdTLEQnQSvaqG9oIOsLlzEvitF5flikgeKgmVdBcT6x5uf9+fIpVKvVTp+XFk5wMf/ IRpnrXxhA8ZLgbFJ+r/x3I6N3MDgac7UwQE+oGftUSTMlAu1u/+/tsCfb2C9GA== 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 v5 16/31] soc: fsl: cpm1: qmc: Check available timeslots in qmc_check_chans() Date: Tue, 12 Sep 2023 12:13:40 +0200 Message-ID: <20230912101340.225575-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230912081527.208499-1-herve.codina@bootlin.com> References: <20230912081527.208499-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com 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 (groat.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:14:23 -0700 (PDT) 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 groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776830570952543683 X-GMAIL-MSGID: 1776830570952543683 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 Signed-off-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; } }