Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp608825rdg; Tue, 10 Oct 2023 23:18:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrkgxecpXD4so4vRiX7V6fMxwFR9aHci2UB9WHThR+mS8azN6KZwmHVoP1rEVFBxXXWYzd X-Received: by 2002:a17:902:e74f:b0:1c6:112f:5cff with SMTP id p15-20020a170902e74f00b001c6112f5cffmr21931720plf.61.1697005111189; Tue, 10 Oct 2023 23:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697005111; cv=none; d=google.com; s=arc-20160816; b=FC3HtraQiezKGgK+dSrKo4YOwWjfk20e47rddXSKpfEpo6C9730viiBRXSDKNUOjuc tNDjAYBs9KpqSfgViwW1OxFeRrDA2JEgahDPlqX/Rv6gUeV6PWlMorww3nb2J8lAVuIq b8SHJlsI2gA3exAWr1pXbvObVIFCEUDj71f0+d+5yZWVxknbZydQy26QAHwOd9AL7cyK /ZCj2w8NQ5stFj4OSWDF1y7lujoqPrx7ZqsCxV+gXBvkl2cniycA7H1Y0Wz3MvN9Yr7C ppRvhI2055HnRbsmu+22voH6bXiNnZmSZrvJPessFOXgC7HNZrRFcVEJGkURAEyMzCPS TO9g== 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=VsO/shW7GdAWiIRATyL5QAf+hh5aGcox3ohTh+0Qx8Q=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=iB4dqhsZ6POFCSd+AEAcQLO5jSOkrIW23EyfFqO+PhGYFlZ3t0Q/fO/St3A+bJEJbQ Twc3Mc6EcGbWI4PHHOqTdmSNUyNIsjv+0xxNSLYjpy+JqoC51a3K4XvS6iRcc2uNMST+ +h4kqGN4z8Ends1kcpEMoO49QiBtNL5JJ2q61Zv+98UHcQ3LtwpCZI6Rz5ThY7FquBKH bLoCFJGTlCPjvTbGwOw70qUUcZK8XX1Zu0gdkgl937yna8/B/NLiSenjGUxMiJ4nRpp7 FY1Qq47ZVWNtXaqudMTj5ZoWnDPUMtvZ3udlyfFvgnSKfLrCKxIc71VqH7pFXOYjIXY0 hn0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Vq659Luy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e6-20020a170902cf4600b001bbca0a8393si1134795plg.56.2023.10.10.23.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:18:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Vq659Luy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 926CA83C7588; Tue, 10 Oct 2023 23:18:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345393AbjJKGRQ (ORCPT + 99 others); Wed, 11 Oct 2023 02:17:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345311AbjJKGQV (ORCPT ); Wed, 11 Oct 2023 02:16:21 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40924EA; Tue, 10 Oct 2023 23:15:59 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 87C93E000C; Wed, 11 Oct 2023 06:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697004955; 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=VsO/shW7GdAWiIRATyL5QAf+hh5aGcox3ohTh+0Qx8Q=; b=Vq659LuykhQGxr3EFMj2dPob4wXgcd+QEqSHkKA4Iq++hZmV767IJQar7MsYUj84qx1NcE dpPbhtq4ERakk689e0zCM8FQLIg7b0K1dnFxFvIIY/PtQ7co5pw2QVPMbQJX9qEvpRcxRO pIYPunSllNF510YctpX0ED3koSSCiwgs5horNMsf3jGU2ygju2LAO4ke3Xr4ebNoyKCXwt 5jI4uK0161cd3ilsWa+gGPT8Xzz8rArBQg/8kj//Esf3K2xoRWQ7iOlx1ZDK7V6RFuc2JW bKUy6OeYwwMYEqHuRlqMhNW7IvMMHAokwwnTzPyQ5oNDRPh4evSw+gmgWg2Osg== 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, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: [PATCH v8 19/30] soc: fsl: cpm1: qmc: Introduce is_tsa_64rxtx flag Date: Wed, 11 Oct 2023 08:14:23 +0200 Message-ID: <20231011061437.64213-20-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231011061437.64213-1-herve.codina@bootlin.com> References: <20231011061437.64213-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 23:18:19 -0700 (PDT) X-Spam-Level: ** In order to support runtime timeslot route changes, some operations will be different according the routing table used (common Rx and Tx table or one table for Rx and one for Tx). The is_tsa_64rxtx flag is introduced to avoid extra computation to determine the table format each time we need it. It is set once at initialization. Signed-off-by: Herve Codina Reviewed-by: Christophe Leroy --- drivers/soc/fsl/qe/qmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index eeceb81bf107..19acfcded9bc 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -216,6 +216,7 @@ struct qmc { u16 __iomem *int_curr; dma_addr_t int_dma_addr; size_t int_size; + bool is_tsa_64rxtx; struct list_head chan_head; struct qmc_chan *chans[64]; }; @@ -696,7 +697,7 @@ static int qmc_chan_setup_tsa(struct qmc_chan *chan, bool enable) * Setup one common 64 entries table or two 32 entries (one for Tx * and one for Tx) according to assigned TS numbers. */ - if (info.nb_tx_ts > 32 || info.nb_rx_ts > 32) + if (chan->qmc->is_tsa_64rxtx) return qmc_chan_setup_tsa_64rxtx(chan, &info, enable); ret = qmc_chan_setup_tsa_32rx(chan, &info, enable); @@ -1053,6 +1054,7 @@ static int qmc_init_tsa_64rxtx(struct qmc *qmc, const struct tsa_serial_info *in * Everything was previously checked, Tx and Rx related stuffs are * identical -> Used Rx related stuff to build the table */ + qmc->is_tsa_64rxtx = true; /* Invalidate all entries */ for (i = 0; i < 64; i++) @@ -1081,6 +1083,7 @@ static int qmc_init_tsa_32rx_32tx(struct qmc *qmc, const struct tsa_serial_info * Use a Tx 32 entries table and a Rx 32 entries table. * Everything was previously checked. */ + qmc->is_tsa_64rxtx = false; /* Invalidate all entries */ for (i = 0; i < 32; i++) { -- 2.41.0