From patchwork Tue Dec 5 15:21:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 174087 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3503536vqy; Tue, 5 Dec 2023 07:22:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvTyaSR5R50FjguykmH6vBBsRL2BG8JBw5jDpjrBGmQJz+SAtaiUe0gyS89jPyOQsrAMta X-Received: by 2002:a05:6a20:748d:b0:18b:8bf4:6b4a with SMTP id p13-20020a056a20748d00b0018b8bf46b4amr3182239pzd.0.1701789733355; Tue, 05 Dec 2023 07:22:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701789733; cv=none; d=google.com; s=arc-20160816; b=pu4jq+aILKz82MI+1AUwMTRkwga7m/YwQJmqvh3A/Xt9LlciSM93dObq4AsueqFseC eLjfcr3rxvrWwwO/mEPWG4frjN7fbDvJ0rL/ZuCz9FlTMzBFU7UbwBAMM/bpaibPK0kn m9LIEEizGmiketgi87XqwerRQOXxyOJoZrM7pZx4Na9nwd7k5kJk+UtDCimqr7tPkFHM Z5zENIWSRFRLHQ99eM8PKJp5GA4bLuAGMu1d1J2mwg3arVmSThYWg9V+j2+3wgeE8ygX iEHupiKPnal/JIcYbXN4H+fD2DZ4EtnqPrOdt/6cTw7MIt85J+YK/GGqopO3pgndAPb8 giLg== 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=SyQZWf38Og5Y0/pf5oTDtok//mBEqzmwwSvCPagIUBQ=; fh=vamCZaQ7EeQQjV+Jpg1PpgbwecLJumQNdtvzT0FcvGs=; b=m9RIvQyZnoq3QB42+RFeWndi8yz7uHTwcfr/ynh5QugLBNJELRe+zIMpR0qPJlbh0R wgurO+9PLgGDV5M0sZsqV6gUm/qVox6BvttcaqI6xuHwN023vibrymP9b7U4MYnsyzlK GQ2JHkhGFKDeWgJ882OsiwQHRjtsI4weKqzretLUIafq2wLHAUPpTF9nSJ2ySiTawuYE AcVBoYwNHuAaTlZStXRY2ZhksTV/aFz3vfOXuFFi3eK3SwFB2M7Jo25kSX1A8u8IDiHw rOACqTNKv1EFqbRAPo3bMA2Ig7WY++VxHnr4696L3msw9bc9F/8m/aX4dbXD/AaJnwSg t2gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FBG8r0cJ; 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 bq10-20020a056a000e0a00b006ce62c23c60si2293438pfb.139.2023.12.05.07.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:22:13 -0800 (PST) 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=FBG8r0cJ; 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 9695C8039EEC; Tue, 5 Dec 2023 07:22:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442437AbjLEPV6 (ORCPT + 99 others); Tue, 5 Dec 2023 10:21:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442393AbjLEPVv (ORCPT ); Tue, 5 Dec 2023 10:21:51 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11CF7D44 for ; Tue, 5 Dec 2023 07:21:37 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id 719364001C; Tue, 5 Dec 2023 15:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701789696; 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=SyQZWf38Og5Y0/pf5oTDtok//mBEqzmwwSvCPagIUBQ=; b=FBG8r0cJ4cSuCOfR8HlAXbtpyyfBpiimk6zTAC/iJCcfKMTLSFQw7dadW2l5TtL9k2OfMd J5sGUlARGSn3tH0I4dgOa6bEi3X05MSyPDaOg0S8qIbOd3N6ceBjWTDRdHogWWSTow5oXJ qZYAZXTBcVddg1xnaECUDwQOJewLA7kdz5ka6x8RovtXtBpUZWz2BbOxuB2GwmslrqRzK6 8N+w/Se3lAJGt4A0O7v9VINLwuOk053H48tz5jeiybde6SDAjzHDT4uUlmigulB/wxyqAX fpxHikfOWA2/6n/fnONIWJN8U0WsEj6kQHf9g+98J7u31KyU4pmIr/GnBjEw3w== From: Herve Codina To: Herve Codina , Qiang Zhao , Li Yang , Jakub Kicinski , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Christophe Leroy Cc: Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Thomas Petazzoni Subject: [PATCH v2 10/17] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Tue, 5 Dec 2023 16:21:07 +0100 Message-ID: <20231205152116.122512-11-herve.codina@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205152116.122512-1-herve.codina@bootlin.com> References: <20231205152116.122512-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 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]); Tue, 05 Dec 2023 07:22:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784455871140883200 X-GMAIL-MSGID: 1784455871140883200 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 5d7e2ecdd933..f2a71a140db7 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;