From patchwork Wed Aug 9 13:27:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 133259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2813366vqr; Wed, 9 Aug 2023 06:51:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3h5Dm6HOpv0O52JUPM4D1XKf03QG2fa6NoIXNPxVTEkpNDceMnWwbBEwNeyrz+k32knHd X-Received: by 2002:a17:90a:290e:b0:269:588c:4ec with SMTP id g14-20020a17090a290e00b00269588c04ecmr2188284pjd.41.1691589073963; Wed, 09 Aug 2023 06:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691589073; cv=none; d=google.com; s=arc-20160816; b=cptkfPsWMzZCzcZicaNLrwT6drHCgkytrs7ZFE6mQhd4EwIC/1y+HFfCNd+Hiftn5/ VCt26sdAobNp0ifZvxKM0zc4Euv8iKj0YSbsvbPXxMkRnx5a6MH7bFEvugiuxi4br4Za xqxxiDHXnjrULXaQnAktcF1aDg9FBBkuvr3i9H/tEWdEzeB8xYiMEQPRL6j7tx1j/9em 2ndnWdg/wbviRMJpGR/bZsDKMPhw0EhnX1Qvf+7UqNMtLs9RDUL4HhqcNpTFflssEvCm 4I2j0hDWCdlJM2V6qXUiGZ/Pr4QAnfLxFsC94FoLfwCW/x750iLO7ud0hwXCwu9UmMdB gDMA== 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=XN3JYbyBcPDfSUWyijVLUpNk6etEUCIdyWfdIeMzoCQ=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=Gqvp48RfneAs6tC6LvwG0b5ybWArTG/xYOVmV5cl677amP51n+h6+YXIN7acntlPNv 9qOFfIKoH+nfxsMJA/IEV+eJ4PhyRuaYTdyZz+4QFYiafMyqnys7OpqVHmfpaHNXwlmO e17FL7I/iqmHpm9Kq1baMhiR0ZbA5vFhr5H2Jg3+5tEqYrXa9IVuB6vMRaW9ruuPQ68J 5IMij0bvBl7C5Xhu5T/iN7fPgZpZ86Qw2wKTtAPKsG+VmscsYpOtalcYOU0WX9YmoAzZ F6Apdo8fnEMvTClw5AQzKidgQPwLfqkuYr7x9Wtg+5IBKbMVmA1vngDwxeTFkq6bkcBa sE4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bw6mKfhD; 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 q14-20020a17090a2dce00b00268cdfdf084si1451723pjm.80.2023.08.09.06.51.00; Wed, 09 Aug 2023 06:51:13 -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=bw6mKfhD; 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 S233082AbjHIN3r (ORCPT + 99 others); Wed, 9 Aug 2023 09:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233069AbjHIN3J (ORCPT ); Wed, 9 Aug 2023 09:29:09 -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 7AF1D2D76; Wed, 9 Aug 2023 06:28:42 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 4E3B140004; Wed, 9 Aug 2023 13:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691587721; 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=XN3JYbyBcPDfSUWyijVLUpNk6etEUCIdyWfdIeMzoCQ=; b=bw6mKfhD4dqn1A3fYeAzUcv/jlFjCns3x1vkkBzsmxVgAfaNy8cy7FSQ7GAaU8ZXsaoaZf 0KHRZiFK2ubyS4u3r5vfQzxjT7kX9otM4zIHsDu5XnYgHkBU26Z1dlfu+JbEj+0klXcKsF Dnbqrkbf88F6CtFWH+Hflqbb5EbVu2p9TGWMpWB60+BXTySQYjae0KvKKliSjjfUi6M/8a L9jBMZMVEZjwryUAQlNQQ6lx7LBwhMuuS5esf1KK3un5OIZEcipCEfkg2YFg36MFreUsUI L48gwUcQ+UnpyKq/0lTIG76VitZMpKiSq7Js2fbkrcvQx0dgvXgXf0bmSMqrfQ== 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, Thomas Petazzoni Subject: [PATCH v3 16/28] soc: fsl: cpm1: qmc: Introduce is_tsa_64rxtx flag Date: Wed, 9 Aug 2023 15:27:43 +0200 Message-ID: <20230809132757.2470544-17-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809132757.2470544-1-herve.codina@bootlin.com> References: <20230809132757.2470544-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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, 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: 1773759705091869241 X-GMAIL-MSGID: 1773759705091869241 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 1eff1e138460..610be2b8855c 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++) {