From patchwork Tue Jul 25 09:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 125523 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2383368vqg; Tue, 25 Jul 2023 03:55:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlEVMz7kOwEUR8nhntS/F5+FVYHX+NNvQM1S0kbkoZQ/sp8NQelwgeNfdH1P1FtvXZgqk1KB X-Received: by 2002:a05:6a00:c8e:b0:667:e17e:85c1 with SMTP id a14-20020a056a000c8e00b00667e17e85c1mr9682400pfv.1.1690282524135; Tue, 25 Jul 2023 03:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690282524; cv=none; d=google.com; s=arc-20160816; b=t/IPWPW4BBmAcZvQJW8hWBEiyJVo69y2guoTcUDSNXKhzoEysWIaxSSrln6kYL4ZOh sENyyDr/G74y3VWRb1wHQOOzg7LLGX6NeARqcpl3jseV8/0SDl1cP5PA7Cy80weVUr0y Kb+V7JgRSiuFPbSiGtI+oIukjK6fFmKAWt/m4BGezrzg+AXuF00OTwcbf/eLo1jZMMtq 7NTunklwfRTnrHd/CA+7jpYOqIMELCLhnbFoz86xABIGs+c7bVjdgIM9eOHDQNkweztK AP0R2haEJEIQuxeFd8N2LyEGL928t4RtsSuNG+bXRJgGkzut6DlDh0F6snIqG8A3NdRF g0eQ== 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=s7w3iKiIQQKpkTMMXXn0294Vp/dBJJ/qKhQwo2K5GQI=; fh=j5z+1OhFuGBFoHpqsKfNW8PvbyYDiDyztgOSDrYZWKg=; b=SP0GL3/KcLilLVR1SY5htxT++2t363TscXVBlFToUJ24Pfkw+GbEkMuEE1hMoGMW0C yk8eeq6KLUdUxSenCd2arzqB0Y65XY3pb/1AtYeMnK+QYZCmfKhyPt7vwm4AMkghgWeX L94/uvgFpR7GHwrORhgtlHMl9IkuipMFnumO5GDkVO/rNsQKSJxsosUBIQUlNix5WF4N ladg2XT+qlUbzSCbXU3n1dKpHegjZHDOBsdyzwWr4kX1H598B1mzw0axGK1fAxvC44Q3 hEuyHflRCzcd8InFpCY/cwZG3uoz6s3R7wAlSLv7dLdnV6y0kAEApX8MNLz6Iw4FxgVt 3F1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gMWe2QPx; 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 cd14-20020a056a00420e00b0068286737babsi11191211pfb.178.2023.07.25.03.55.10; Tue, 25 Jul 2023 03:55:24 -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=gMWe2QPx; 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 S233029AbjGYJ0h (ORCPT + 99 others); Tue, 25 Jul 2023 05:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233174AbjGYJZz (ORCPT ); Tue, 25 Jul 2023 05:25:55 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76C92136; Tue, 25 Jul 2023 02:25:22 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id C69BD40010; Tue, 25 Jul 2023 09:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690277120; 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=s7w3iKiIQQKpkTMMXXn0294Vp/dBJJ/qKhQwo2K5GQI=; b=gMWe2QPxe48dfbhBHhTaeuwcCtg5sj21ma0MMuCrG6OjXUXR2fxuwZz6r6qDCmpQfFhETG RFhoNS5V912y5UZqLqN1ourEFdYcQuDptcir+3o2PGuJ7Tvw6bY0Jae5x2cIdPpI6vb3L/ bE0QDA7XW30s92VP/mGVL4jC5ueurGHEVu+hwzaJjClFAmNbp5t4TjVnCBcefZdxa0vrF+ udg0ooSBRexi2/98fNNipRjZwJljOFsJLPEZdUA8HqEQNj2niUbpgkJQ0TBguNY0NQhBJP 6pESPkUT9pPI4AKHIYpn9myBCWtPfuN8aWEAwkyVNyn2r3cJ/rkWo7JSuTMXrA== 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 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 09/26] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Tue, 25 Jul 2023 11:23:45 +0200 Message-ID: <20230725092417.43706-10-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725092417.43706-1-herve.codina@bootlin.com> References: <20230725092417.43706-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,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: 1772389687998591287 X-GMAIL-MSGID: 1772389687998591287 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 --- 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 a9aba9943ab7..658aef63505e 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;