From patchwork Tue Nov 28 14:08:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 170805 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3946954vqx; Tue, 28 Nov 2023 06:09:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+JoQiwgh4oUt+QQygZHIIwdhc60HKsSj5fomaCXikGagY7MVBeQsUg14nb0QD9OyUs8NG X-Received: by 2002:a05:6a00:2e8b:b0:6cb:4361:773c with SMTP id fd11-20020a056a002e8b00b006cb4361773cmr20225076pfb.5.1701180555721; Tue, 28 Nov 2023 06:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701180555; cv=none; d=google.com; s=arc-20160816; b=UBut2SsDQPxGzMXfNT1uhwdSPUi9sMUtoaZLMz0oa2UnHn5RhubSrJfPwdOmDX04T0 qtSXy4ySm/kBVnx0Sf7R9QOv/0gDFtOHP3yu6BFB9Jtp6lg7g95yrXLsbXd+Mjtu5oPQ NRTc2GUF17en7+/yUbQ902rvHqimx11lpsQMDn77SSiHNDT/RontyuN6Enua0MiVmUYI DN1xZvyRvmfMYQWSjNIJnE+AqrDKItWruhjFFuJhKi/8mrWdqasSiBdfd+GAbloUnJi6 ShG9hFKRd+GytNHZna90MYMuW9Us4bupprp+rZo7BAtBRszVFPzAw1Yx+m4ODsFeniFS iDzw== 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=3HnC31hSxmZV54Av1uYqv8xlMMFu4tlE/lTrC/V/gEc=; fh=vamCZaQ7EeQQjV+Jpg1PpgbwecLJumQNdtvzT0FcvGs=; b=HvRjwGIvXZxgNCCh6cEQbUM5vl9os1y+ZTLI5kM9lhRQqT6tM96GUOgmyO8Ocz1Ils zP0ELr+Np5MlSTPcMKEOP/Us3cmbXCjZCimwCuRIUykDa8xhy3wSoaLCYJrCCZytveHo eRXwnjhnwRyvtM9BuPeJd37AbekEp8GeInuo1UyHI+ISG+lktI73sT+V5EXgO637i8gE IzwSiSmZttkvoqv7eQBKOXovzoqQWri5TrQudGt+RsCy8nirzwBPMMSMK0uwhBy5CrRq y5Jk9PQkiPq7hg2QtBxs2uAPsjA1AuHjgGY0loUsoBBON1Pc0MuDEgf9FcRkXBsWX+wz yAWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EKPaBoIR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g9-20020a056a0023c900b0069342eade87si12761511pfc.18.2023.11.28.06.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:09:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EKPaBoIR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 33C338047544; Tue, 28 Nov 2023 06:09:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346139AbjK1OI5 (ORCPT + 99 others); Tue, 28 Nov 2023 09:08:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345643AbjK1OIf (ORCPT ); Tue, 28 Nov 2023 09:08:35 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A89A1702 for ; Tue, 28 Nov 2023 06:08:33 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id 055A560019; Tue, 28 Nov 2023 14:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701180512; 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=3HnC31hSxmZV54Av1uYqv8xlMMFu4tlE/lTrC/V/gEc=; b=EKPaBoIRvTW/5ppCis1S+25udDqzlucm3iPrxYLH3oVp/ZWH4ca1SUk0NzCR+KYHATZTw3 KF/ydqf2BaL5GATgodrX/YXezDmX8iE/zDe9aNqLBrD2Mq8b3WHazSbOwwH1bFIw5K3lpW Cy6cFk52r8jpmndBjVocDFhfhsW7iGcLa67L7uxbvvg3u9lYCjyx2Cn8+vreWw0xEXzsxk prHTjedvyFouzAiNe1HAypMv1yNzWQuu99F+IbMENj6c3DrR+UnSivZYgAzNdNUwJmOUMf TpFfWVb/8g+N2fKZ0Q/G5VcHp/kBBtSEse1j4aybbY+Rb3yIuSW83UTfs4l8vQ== 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 10/17] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Tue, 28 Nov 2023 15:08:09 +0100 Message-ID: <20231128140818.261541-11-herve.codina@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231128140818.261541-1-herve.codina@bootlin.com> References: <20231128140818.261541-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, T_SCC_BODY_TEXT_LINE 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]); Tue, 28 Nov 2023 06:09:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783817102343678871 X-GMAIL-MSGID: 1783817102343678871 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;