From patchwork Wed Oct 11 06:14:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 151131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp335253vqb; Tue, 10 Oct 2023 23:17:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJOh9ccz67uk3aCsEQiGio1mNXXDSBAvC5doetpayGSGQZKDUjAFglAh7+7Fbm8WJNVpC+ X-Received: by 2002:a05:6a20:8f01:b0:163:d382:ba99 with SMTP id b1-20020a056a208f0100b00163d382ba99mr24707362pzk.5.1697005022289; Tue, 10 Oct 2023 23:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697005022; cv=none; d=google.com; s=arc-20160816; b=d7fLO9TqiDg+iIe3UgKc9FySaUj/R9aAOruOgFnDH3DVj9eBRbVKzxdh/IoDHEuvt3 wl/AcFPkPXnUsOH1s+IaZh0QotPxVgNgsqXWDCZqDlr++S7cbTMhbVGn7uLaQpf4sFBF /iQFBwe2RV2VYgzZDtxXotv+i8s3u4Ro3i0tfozPdHKrP7gIUME8bV71PkI6qJskZEZ0 LqQGNNrCL+gGoGgLNluN2kIglveVdYDI7XQXrnFbxKqkkIXcrwUrBJO+f8hRNj0XleZu v1qefHvEF9RQhWgdesMvMitkMQnek/bi8zgLIZY7YRIX9AGRvBiq53j0yezuY1nON6al a/7g== 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=KuSM2Z1y7iiizVF+Cwpa8pfdY0Fi/frSPvBRsMqS4dHdgSSFJ+F7DYJ/B6253uiqDP eb8IDjGFQMYZMtT47uSrHINhwdOIL+45EfFh1UyFbvliPllwgizHclnVAm6TgQ2KuVue ArfzlTMmiLNz0ujjb595CdlMK1UZliniUpV25KXSF1EvF4ZA/VE+pSYEHoxwko9Drql/ 53yWcQQAG/xbTwfEA8fk8RFfX6HQX8uuA/rb59kNoP42I4GA8U20e85XYRZXVKBtc+V6 +yhjGdOA4JieT3pIlbWWlQUQ9QpnffrD0tBvEslDlYLJrfS3//csU0aGoT6pVxSS4F2Z SAjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BoGmOsqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id n9-20020a170902d2c900b001c1fe58a1e8si15297886plc.576.2023.10.10.23.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BoGmOsqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 381AB8076140; Tue, 10 Oct 2023 23:17:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345232AbjJKGQe (ORCPT + 19 others); Wed, 11 Oct 2023 02:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345334AbjJKGQE (ORCPT ); Wed, 11 Oct 2023 02:16:04 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 109C0131; Tue, 10 Oct 2023 23:15:42 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 94768E000B; Wed, 11 Oct 2023 06:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697004941; 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=BoGmOsqiNH9AEWafQuovB1JgA3a8Lz4o4OJZusJOAh9wramLryvPsCwZvQ9/S5iM92jKym F3jmoU0KRDZmL2v0WbKGX/qjnPN5sKmw4GQt30qjfRtM30YBA5PoB7lcpq2SsJ5QWrOFAM iCNnsGm7TrDZuTQyuJqoNjTXfERbN7XRv3/5wb5KP5shMR7rfKEH5A/8TyI3vGpCw6ZHyo 8i2pBdWr3IzXJkHJ4rHGLY0fRCC4m+gtZkYVBsrhMFk3j+drdI439lM2Gi+Wna2WTsvbAg 3qUYtbvmz0ml79eYv02JWWu9QNaV+J/kt3RUJow9DsD6ioYMaV/NYD0jGFvsdw== 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 v8 15/30] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Wed, 11 Oct 2023 08:14:19 +0200 Message-ID: <20231011061437.64213-16-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231011061437.64213-1-herve.codina@bootlin.com> References: <20231011061437.64213-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 23:17:00 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779438738550151606 X-GMAIL-MSGID: 1779438738550151606 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;