From patchwork Wed Aug 9 13:27:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 133294 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2864515vqr; Wed, 9 Aug 2023 08:10:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbYROtY4jHVThqwpDTB5wi/GG/pyjswCAYynB77my2FfhB0VxjXDpScASEsSmimDe0LE7c X-Received: by 2002:a17:902:c3cc:b0:1bb:1494:f7f7 with SMTP id j12-20020a170902c3cc00b001bb1494f7f7mr3083876plj.23.1691593839756; Wed, 09 Aug 2023 08:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691593839; cv=none; d=google.com; s=arc-20160816; b=q/1PMQaZ9NQgX2/iw6T7/QdVMD77p84yLfI2poNSBShbtVK5GgweFjmJ/2JmZSvFDK U5aJF1nA+MH8jI9rRCIM4JqhbVWmC0Oqgdv50tFFkd1kYcUcM6sG5VXJ6aoV2Du3XfE5 re8dUotdEX6tjUvJSWtqEskmZgT14/1hTPF/C2EdTKRa8YdJCD3Lka+vE+wJ602/ToI9 nA7p9AkF2YEyQE9jI6zJWkuK6BNyOtpXlbC8Y/5LWI/I4QcgiwHXXKIwE+/cy4tP+Hct xeZS00RY93DGzWybNJ3VCuykvo9CisSIxzc7jEdlJmRdfA7J5KUh1g7sIZw3dLL8EuT3 A28w== 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=e3M7r5kP9BFmSEGkwYYNmaCjvt7TKrPw/eCo9cZe9TE=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=toNKefBewNWLLTBOu/Y1YyMiBFfqlUYVLKLgIVrf0kHUHo5LC0f7BrMY36KhxXqQ4e ybn9Ol5ysktXYXx6vMavzQWWvkUHW+etR0Nk+PTKwmyqtJuuUIAMTf339BRcvm4J14ei Q5qnwEAz8pxueksLG8Fr4RWErWzVAuv7u4Q+f3IJWKzA8D5K8m0JR/6WSz2gN4Z3svxy j3QSIwZuFaNMlWMQLuFe+FNspuf0ERzv8d9JEGaRZ//gpHB/zsxzLuWKtM112rRqG1c8 XGTvl5CpIwipLr+BIFD0C4W3o2+dTKPXcyCIVZRiz/zxn5bPuPEWQxpa2mtjFbwgngDr f6xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ItleYGvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a170902db0400b001b864e277e1si9982371plx.494.2023.08.09.08.10.25; Wed, 09 Aug 2023 08:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ItleYGvx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbjHIN3U (ORCPT + 99 others); Wed, 9 Aug 2023 09:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbjHIN2y (ORCPT ); Wed, 9 Aug 2023 09:28:54 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 395E02727; Wed, 9 Aug 2023 06:28:33 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 536EC4000F; Wed, 9 Aug 2023 13:28:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691587712; 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=e3M7r5kP9BFmSEGkwYYNmaCjvt7TKrPw/eCo9cZe9TE=; b=ItleYGvxGA2aGrqoc9FCBwKTpuac/dNNasRHV7bIC4g+qMhq+3+jgkf+XdvSZFgPLKcjDR nh/0iPri4HVqoBSlJMgaxmriNacFBtE7RwyG8Oysff8LaY6NUqFCwfDVVhxMk3Qvrz8bf1 C+DWS4s0LgYc+uSKRxRZ8VdKCOH9n+9w1Iqx5eiZYrRP3CbyUf8iZzjI4yd1l6Nc/Qa5ie krFBgE3XLzhhEmwpoaXXVT5fVMHr/mso/Ly6ALF5tKr+jp3I3OvCRiS+jRrOsnSNwsdTh9 1Uh5OPYVXEHh6G2EjslIQ/bO4TTKyQQVrlkuwAZuqJQXZ/1oJ7xvIIdbKvoJ5Q== 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, Thomas Petazzoni Subject: [PATCH v3 12/28] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Wed, 9 Aug 2023 15:27:39 +0200 Message-ID: <20230809132757.2470544-13-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809132757.2470544-1-herve.codina@bootlin.com> References: <20230809132757.2470544-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, 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773764702219960307 X-GMAIL-MSGID: 1773764702219960307 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 bddff0b74252..2416408bb7e7 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;