From patchwork Tue Jul 25 09:23:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 125481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2363881vqg; Tue, 25 Jul 2023 03:11:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlFJ1rqc2JSqn/uZKBQ5K9kD3lArV90AbX5Gf8Ah+efkbjeOW8GiKbHPBrPcmanAflKkeoM6 X-Received: by 2002:a05:6402:14c:b0:522:1cec:ca9f with SMTP id s12-20020a056402014c00b005221cecca9fmr8226960edu.19.1690279909868; Tue, 25 Jul 2023 03:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690279909; cv=none; d=google.com; s=arc-20160816; b=tITc11hLHv1zBwljJJo/o43++dObe+lLVT9kt2TnwNSRgD9JpKz3hwdykJ/xFOugdH Ypx1JfmPUPahvnd2UVz6zV68/OSMJ4ZqCHYXPTc8NvrAF2Z6ZloiZkG5jJrkYhUQOEri NHmRn8hwCUmt8Nm5zC8EZm4ECCDfQJHzQ8EqwGznP348EacG3Aps6ZmCU+V9oTU9f9IH rKxbIkeP5JBfTHr9+X+pTU8feXELKAO97MRqBlxy3Usk26Waz/g3SKRWcihkIkIY+yUj WkyW7cvugbjH1xv4aY/JXa1EalRl0C7ZqCjb5Fy+Vk3p0AN3ZuJsjF4FRyd+1O4Z0kbA jeMw== 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=Qb9JJd2ccR7R8C3gjckd4+51tlc3N7Nrektp0ymXFJ4=; fh=j5z+1OhFuGBFoHpqsKfNW8PvbyYDiDyztgOSDrYZWKg=; b=R9hAfdyf9VylkJoFHLa/ViUl751PZpRZI96BhkBZ7kl5942tFjVq4bc+4xhgxVE8/C YsODpjzIfsY0QHtTMkpnBvZcDZdWX+TIRdIIarRL+eFQ29C5wh9vEa1UGX9mZ0cqxE0S RBQeE/T8uOh0K/EQtZhqg3tzmEsluKE9YikXzeGVVrxuxLlBeyAgGJmaq2Y43RKONwRt MkgyUu37KlnqmztpD9zi/PP3xCxPbevnPXtGbOwlY7TmkWHrPG4+UWPaoEI0XMQpV6T1 jNxRXMbuJpDxXEnD6ScU4rzJb57zQxSqPp2v1hIbyRIUd5br4wsqA/C7dde9p8hKkAYL UkvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=c5NjOUYe; 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 ay6-20020a056402202600b0051de4b6be0esi8721169edb.646.2023.07.25.03.11.26; Tue, 25 Jul 2023 03:11:49 -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=c5NjOUYe; 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 S233219AbjGYJ1Q (ORCPT + 99 others); Tue, 25 Jul 2023 05:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233175AbjGYJ0f (ORCPT ); Tue, 25 Jul 2023 05:26:35 -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 527B92719; Tue, 25 Jul 2023 02:25:34 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 0E5D740019; Tue, 25 Jul 2023 09:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690277132; 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=Qb9JJd2ccR7R8C3gjckd4+51tlc3N7Nrektp0ymXFJ4=; b=c5NjOUYes6dhntB5+RrrYjoonyWCtKHMZ0/HXvaURv6PJoFwfHyFRA3TUj24KR2cDehmBY nXkpGgWny5B62KtQBa1YkHf2Kz1rY2988A6OyA3ql6PMeSS3BclrFd8Qcg9VXJ1F5ZxS6A wbNvbyZutN+xLstAQeJAPnwCkMsnGJz3n6f4x8avIuJbnsrpmArVqBwYCPfkYRe+MpAEZw o0C6R6rjRzQuaNYwoKBS72GzOH0bG4G+mZvRqLemTrp+3LsZ/5zz1RSGWGOWNSeGP0iG8+ vMYhE/dLf84Fra35LwzfrNQvyUKuPCE7kPdrI+iTB4UPHe1jIJ6ZxM4OaEjaGQ== 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 13/26] soc: fsl: cpm1: qmc: Introduce is_tsa_64rxtx flag Date: Tue, 25 Jul 2023 11:23:49 +0200 Message-ID: <20230725092417.43706-14-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: 1772386946502844701 X-GMAIL-MSGID: 1772386946502844701 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 --- 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 d02acbc1d7e1..64c3bfc16010 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++) {