From patchwork Fri Sep 22 07:58:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 143404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5531054vqi; Fri, 22 Sep 2023 05:28:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGTdmvn1RVOFeTkkbP7hSBAFGCxOq5PySEs4/JLTGfxT1cVazREeu+3KKrv8hdqnkcQL/U X-Received: by 2002:a05:6a20:8f23:b0:15d:a247:d20c with SMTP id b35-20020a056a208f2300b0015da247d20cmr2520694pzk.6.1695385699211; Fri, 22 Sep 2023 05:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695385699; cv=none; d=google.com; s=arc-20160816; b=Rt+Bj5TgdeIA0rpnrpmaD+RhtNIb6WW8HAqow7FdhfY0+KzBM/rD59yXU7RINUTpC7 URAbhvXwjengQJeGtNRViixZbayvTMXGbplU2jMbZMLykjoXKGxX3qKQxICnrP8Sfr39 m55Brdw9j6/nY+gkM21D9LXiY0sM0eLglLZaRu1KuJCQxOtSvjMIa/DpcJHgPsTxoRU2 smhyWGXAVZ0af6PND1HePk3yPRbbepfm5cyRTeFLWhu2SJ4n4F3ZoCOZ+de7a/YlJYnQ uLEM2T2Ak3SW9HISKP0IVm3nHA+CcL8igTT64m9OYSHXud76bszONnCzx2zZv5rZSQl2 BYgw== 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=6W9oVhEO6bMU8YfnlBol3aSpzYKADclXRgrQd2t+5FA=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=Y6VzWiSHJ5AUsRXCu8KNhkitpnXaAwTCig4WZjsTF+oYtY8fB3SCF42k+8+D8k6+Xa xTsOJq9ax96yQRWWhEj2K3cQhpvyMRfjTkFM9c8Gr6mER05joXmquLKEeJlI/a+pbb73 FVC7S6lKfVWRZL1pctHSVbQT5hGLHX1nW/kaWwEprijOV+8ng5mNB3ffZ5wPGENmGG/N 1hygDHXe8Nl7cb4JzcEuVApAYtNv+KKIsxTwtketbCEdfkfACyIeLS6NBkLPX2vg937y NgrM+nnIFLzD0uDdWPj5pIaGaj0voHbEIrywMhmUsesbo+PlY4Y/NvzZfz3HF1I2vSjL vnAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Yor/n7xG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bz14-20020a056a02060e00b00569465f387dsi4347947pgb.161.2023.09.22.05.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 05:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Yor/n7xG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 06ADB82F08FF; Fri, 22 Sep 2023 01:01:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232091AbjIVIBf (ORCPT + 30 others); Fri, 22 Sep 2023 04:01:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbjIVIBG (ORCPT ); Fri, 22 Sep 2023 04:01:06 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA7FD1999; Fri, 22 Sep 2023 01:00:24 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id A7EFC1BF216; Fri, 22 Sep 2023 08:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695369623; 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=6W9oVhEO6bMU8YfnlBol3aSpzYKADclXRgrQd2t+5FA=; b=Yor/n7xGZdLQcJp6ER/JjiWnt7s5zrlnCnJxQAT49zDwFT7e/gV5E/sLL5EXnd2SeT1Byu CWROpFgR34bTVDfRFTpSM7wa9mnYF8wmOBo/5T/aahTrNfvKJm9m+DZFbDlPDbRMEhHVEx SU8BR/+HVHc99eQSvgZvcTChkxXVTViQnWPoIp2rEIhPDK2RcrETWT8IGLVx/6RcBmHEfD QIJWf4xJIYVZFrbQLAUMP8JcmoswtaY642hwxUnMvpxzKdRoZev7aA/hE7p75ray7ztdit +DpUT2YR9CKtIDLo7z2KaKXnJ3qP9o/idrZDXwCUoCRIQEwy/62LSGNO9UPOtg== 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 v6 15/30] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Fri, 22 Sep 2023 09:58:50 +0200 Message-ID: <20230922075913.422435-16-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922075913.422435-1-herve.codina@bootlin.com> References: <20230922075913.422435-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 01:01:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777740754960327552 X-GMAIL-MSGID: 1777740754960327552 The newly introduced qmc_chan_setup_tsa* functions check that the channel entries are not already used. These checks are also performed by qmc_check_chans() and are no more needed. Remove them from qmc_check_chans(). Signed-off-by: Herve Codina Reviewed-by: Christophe Leroy --- drivers/soc/fsl/qe/qmc.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index 8e8bd1942c08..1189e6076e37 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -884,10 +884,7 @@ EXPORT_SYMBOL(qmc_chan_reset); static int qmc_check_chans(struct qmc *qmc) { struct tsa_serial_info info; - bool is_one_table = false; struct qmc_chan *chan; - u64 tx_ts_mask = 0; - u64 rx_ts_mask = 0; u64 tx_ts_assigned_mask; u64 rx_ts_assigned_mask; int ret; @@ -911,7 +908,6 @@ static int qmc_check_chans(struct qmc *qmc) dev_err(qmc->dev, "Number of TSA Tx/Rx TS assigned are not equal\n"); return -EINVAL; } - is_one_table = true; } tx_ts_assigned_mask = info.nb_tx_ts == 64 ? U64_MAX : (((u64)1) << info.nb_tx_ts) - 1; @@ -922,27 +918,11 @@ static int qmc_check_chans(struct qmc *qmc) dev_err(qmc->dev, "chan %u uses TSA unassigned Tx TS\n", chan->id); return -EINVAL; } - if (tx_ts_mask & chan->tx_ts_mask) { - dev_err(qmc->dev, "chan %u uses an already used 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); return -EINVAL; } - if (rx_ts_mask & chan->rx_ts_mask) { - dev_err(qmc->dev, "chan %u uses an already used Rx TS\n", chan->id); - return -EINVAL; - } - - if (is_one_table && (chan->tx_ts_mask != chan->rx_ts_mask)) { - dev_err(qmc->dev, "chan %u uses different Rx and Tx TS\n", chan->id); - return -EINVAL; - } - - tx_ts_mask |= chan->tx_ts_mask; - rx_ts_mask |= chan->rx_ts_mask; } return 0;