Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2640654rdb; Wed, 15 Nov 2023 06:43:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnvYeQrWUXdUFEg5W1WTe4BMI1lRXwEHSVpWYGlf3x13e8R1LCg1hlJJp2q503l7+gcSAy X-Received: by 2002:a17:902:c948:b0:1cc:22db:cf3d with SMTP id i8-20020a170902c94800b001cc22dbcf3dmr7561723pla.15.1700059380776; Wed, 15 Nov 2023 06:43:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700059380; cv=none; d=google.com; s=arc-20160816; b=z2woAgLQ7Sxg4nm6mqnBYq3AFtrhtuSQ3/Bvy6yqU3qUgiZIHBjw0/8rHH/8ZXvadt W4iXA1YBUvMErqV+E9O8fEooQGQVjkFDGLO6nvsGrLosR+q/0NVX544sZ8XSzjoQe86e TJgf5vvq05KCPsYIauqsQhVEHNnCBCkHa/cSVaaEaCa/9f2tmuH4QfDkmG2uVrJ+dqUB 5cWonfBbYR7xYgL+2i3LK41dmj3nBKQeNSq6+viwYMrH0LJ1v3r5EMS4IeSo/9pEp8L3 fXq2eYmw1pwrz1bnrz23byngDpndrBY29Zx3u5uBLp6yYjcVzjbKQAM7ujYqm0NoS37J +OpA== 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=qGg3acl9dPUDPC44eUjx/X9VrqrNtOGTzPuj0B8/OIo=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=QNIYbFR21woc9UpADfsS3sFOcdcN4budiDNhTu7HjbZvrZgxkv3pD70JFGevUNi1xb FFrTY9+ejFeBiebV3hBDwmSOZXdqcjKI3WKej93lxf9PSxiACgt5VaDK8lTPXiurJitn xGnsAYRr5mSnISt0xN/uyUE94HRV3v29hCIZfFiA0zn4RB4NKirEVCyW22mhAH3rHzYa 0f1oYQUtUhBS0aKrEHX7PFSj2uwYr2J2j5hgBYwOnu3sioZNZjImdKsf4xBJyxuo7PbL Ne+8hMuIRUlVV/9e9vJ4jxGGZR59KhaWuKm+9P+flw7fOmbbgw0vz43DIqpZFB0HWBHJ xwYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=e89B9u78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m15-20020a170902db0f00b001b80ecdcb88si10700977plx.473.2023.11.15.06.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:43:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=e89B9u78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 C82C181A43F6; Wed, 15 Nov 2023 06:42:00 -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 S235005AbjKOOlt (ORCPT + 99 others); Wed, 15 Nov 2023 09:41:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234998AbjKOOlJ (ORCPT ); Wed, 15 Nov 2023 09:41:09 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F16B1D68; Wed, 15 Nov 2023 06:40:42 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPA id 23A83FF806; Wed, 15 Nov 2023 14:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700059241; 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=qGg3acl9dPUDPC44eUjx/X9VrqrNtOGTzPuj0B8/OIo=; b=e89B9u788SbiUpQ6wJZbqq+4iGGgrZZ2vydGV+BSfU9SWfZcp+Y49TTVcwXoeFPif1Me6F NnWr1s78axkSJLiy5rR+wcFBHbJKsIlTL3Bq9yvsytMhbYqPhbOy/b8wLXF3nL9pl26GFZ AnSwA9NydXLapodVI0FlBkzvvK/l43T0jgsmeFvT0YGdPlHKEbXcZoW/zOtCNp1G/w8/H2 RrW7qE/Zz9fgaWhqa/ES1AZtU1XKHMJCh2yKmXrdqSFqOslvyGBxeF26t8EX/nNVHMRaLS APb+JQx1PsOzplndAvq6bqQ9M4wvBuZjJxb/my4I7XxIKit7zmBIapQs1uHEAw== 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 v9 16/27] soc: fsl: cpm1: qmc: Introduce is_tsa_64rxtx flag Date: Wed, 15 Nov 2023 15:39:52 +0100 Message-ID: <20231115144007.478111-17-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231115144007.478111-1-herve.codina@bootlin.com> References: <20231115144007.478111-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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,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]); Wed, 15 Nov 2023 06:42:01 -0800 (PST) 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 5ca4120779f8..e651b3bba1ca 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