From patchwork Thu Sep 28 07:06:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 145923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3201274vqu; Thu, 28 Sep 2023 03:14:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/MGBd0UrNulwNBehTOlri6AXRNbu2dumyWD01XFd6KBOmpZfCevds8A/S9lhjQ5fTOVxg X-Received: by 2002:a0d:de45:0:b0:57a:8456:3401 with SMTP id h66-20020a0dde45000000b0057a84563401mr637759ywe.29.1695896062414; Thu, 28 Sep 2023 03:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695896062; cv=none; d=google.com; s=arc-20160816; b=UpPC7/WycQxXuihYirRzHXzASYMgaMd6QNksj3WsIJL/0y5RgMyPwSdsGtDLQ9Dlon sdLjL8eWOjaScqUyyFalvDHTBuDwB5mSMgXEQ3mqrmFTv9jZOIc8+uVJQHAV822GUFmn SAtNH5bS3b44PG7GZHj3VJXfhqS7VCi9Wg3vstT0QaJPrJQ//0jd41G5sAYg8JjVxDFf A4Op0O6LeiyVuGmd1zYes/2fOepqaBXHYXtV7EcQmxGVIEGPmUhWscEdhj3y2F12UScT ZDhaMea5MO4s4ZGGiSlR5jix8cKytUYCgDApsbtgEjbC6jejlm0yJ7mZk/HaG7I6yPuP jcKw== 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=8Kc64rxAF0/ep7JtUzveSO6N9QMBWtHyiJ9nqNn2Uww=; b=panTp3c6En3WooYdfc41Bwer7enWFzs57J9Tt7GY1LlJ5klY27Tlw8F/UW9A3GeDky YEem50g6t9w7CIRg8/ry3uw+eghFGWV/gGzXwpLjziDV/qovtg6iVoqQGlRrc3+aAq3v 15L9lcRIGbeVrIWl7ffN1ypNc4nOSY3DAjKK+cj5bQCuCwjjBgUpz/HVoy1/2B+XwX21 QiSLJC4fTRAah+dnoJ+ocuB+McEBzQYhlG2k5pocouL3Q/52H61eLuZvZ9HbvGsYsX1q QSDpW3UNAxHzFHFbLcKpqd2910DK1Yc6/Pdrs7E4CPDt1BkzPxQprfRpIeXoc4ZStwGp U4mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cw6UES8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id j71-20020a638b4a000000b00573fa8f2829si18449983pge.383.2023.09.28.03.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 03:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cw6UES8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 90DC784A3DAF; Thu, 28 Sep 2023 00:10:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbjI1HJy (ORCPT + 20 others); Thu, 28 Sep 2023 03:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbjI1HJf (ORCPT ); Thu, 28 Sep 2023 03:09:35 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF4E1FD7; Thu, 28 Sep 2023 00:07:59 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 6AC3720005; Thu, 28 Sep 2023 07:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695884878; 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=cw6UES8Ozo+nKRsAv4QbC/IyD2eYF2P5KPwVmKo0OvBCE8bhJBW5CDZvca3kln6SHfeAjK E2ELgc/EBR6408+Y/IZuQ+eoy2NdD7dc028zQO7VPv2SMqAcH2cbfjgywl1nc6bBwv3TVu VeR3AV9U1sqMLV1PVOJZbLV9zL0oaz4sDvxjlBmGpE5jgnPoe06x9/8UCThoCBbXPmShXa Ao1s7XYsCNDNCswMKs/QDBXluhMhE9SaXEZu5XiatP8qIrqwRRQlQPaDLMhO+fQu8M8g3w ntmUEgOAQ1XwNprPM17U2v9NEFowUayg2d/o/jMa+SPR7oSY1Hsk3mURT+jckA== From: Herve Codina To: Herve Codina , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , 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 v7 15/30] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Thu, 28 Sep 2023 09:06:33 +0200 Message-ID: <20230928070652.330429-16-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928070652.330429-1-herve.codina@bootlin.com> References: <20230928070652.330429-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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:10:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778275909150635491 X-GMAIL-MSGID: 1778275909150635491 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;