Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14470795rwb; Mon, 28 Nov 2022 01:05:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4wzchX6V7kHnvH8QwpvoV/AoXU+9OLnhZhPD1MJGbcNE+OihvW3ZwE4Y47LL9vsy5v1q+k X-Received: by 2002:a63:f506:0:b0:470:14fa:a294 with SMTP id w6-20020a63f506000000b0047014faa294mr26656986pgh.361.1669626342452; Mon, 28 Nov 2022 01:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669626342; cv=none; d=google.com; s=arc-20160816; b=vNlHmikV15C1KSq34gPdFAQfJBDd4ZhilOgfFsCxwCjbr+XES+PZvNYI8NLrNAVcq9 nD9SZL4Q15LNrmo17UmJtMSi6nLGFozY/o06M43TrdBPC0sWhb828FlmrLNkoWscVPkF jMUsZKiJ+TwzS5bObRaQfS7amcNSY6VgXFiq/B0MARpPbvuHaMR73G46bbX+DXc3UYjH ww8M5o8W7bE0B3oomeeHAI4ewG8DzuNB8WPeLp7LYarwZ7inUNsLZd4+TmM0TX4ZXps6 gtt5+zviCQfE1ewbyNmWYyoSYYnFxBjaOTgIpwj6zzcpg5w3BPxoKWaeCG161eY/JcsW I9Aw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=DQNrsU8IiF8WI8UQ+e/aChGxFx+bAZOLsI3Y9apKOzc=; b=TEo6v2nQBUz8Xx3ien8+My8jyej79vy9fDDRSD0JSR8tQuHLPM2yQp8voKPQmOvku/ w0JZ3HWs/keHifbaIzmlKzQWO/iaqmPnFYIkLWp/4ikXKNMlORAnGcKNhflVMovnfRyS iGnOLRebc6mqF0bNKgS746wJDb00pG7IzHMfTpkpABMKZl2MjF4UrgNgWD/CP9ZcfOX+ uAoDJCO18GRBzwkvwzICVLSwCReHmoi6FJywDAizMbKfoQIbqVYPsqj3/z2DUHkS37Aa uwQ4eFLk42tX5gOOWW2kuXDluwbULWck3qMbvGg7gcSR2hjN4HMqbE0ed9VA7m1AXx7q hk2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fy5+Mq9n; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a170902dace00b00189697e2433si9894768plx.537.2022.11.28.01.05.31; Mon, 28 Nov 2022 01:05:42 -0800 (PST) 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=@ti.com header.s=ti-com-17Q1 header.b=fy5+Mq9n; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbiK1IuU (ORCPT + 83 others); Mon, 28 Nov 2022 03:50:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiK1IuT (ORCPT ); Mon, 28 Nov 2022 03:50:19 -0500 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 346DF13D04; Mon, 28 Nov 2022 00:50:18 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2AS8o68r018476; Mon, 28 Nov 2022 02:50:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669625406; bh=DQNrsU8IiF8WI8UQ+e/aChGxFx+bAZOLsI3Y9apKOzc=; h=From:To:CC:Subject:Date; b=fy5+Mq9nsFr6T6OUFkaP/Fi3oBSllu2f2Zzm8ZcCy/k4fKqeVqh+TGXA6in0Z+HK4 Ofm8oLtsIZIn1T29d6zEWb4y03FwAkMUnRaSIj+8HxHG04NH6AVD3r4qUbIGGT2NLL qbw3Ys1qvYCTDU0cZye5nae+lk3lNMxYXSz31p1A= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AS8o6l8052213 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 28 Nov 2022 02:50:06 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Mon, 28 Nov 2022 02:50:06 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Mon, 28 Nov 2022 02:50:06 -0600 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2AS8o5UB016193; Mon, 28 Nov 2022 02:50:06 -0600 From: Jayesh Choudhary To: , CC: , , , Subject: [PATCH] dmaengine: ti: k3-udma: Do conditional decrement of UDMA_CHAN_RT_PEER_BCNT_REG Date: Mon, 28 Nov 2022 14:20:05 +0530 Message-ID: <20221128085005.489964-1-j-choudhary@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 PSIL_EP_NATIVE endpoints may not have PEER registers for BCNT and thus udma_decrement_byte_counters() should not try to decrement these counters. This fixes the issue of crypto IPERF testing where the client side (EVM) hangs without transfer of packets to the server side, seen since this function was added. Fixes: 7c94dcfa8fcf ("dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow") Signed-off-by: Jayesh Choudhary --- drivers/dma/ti/k3-udma.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index ce8b80bb34d7..4c62274e0b33 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -762,11 +762,12 @@ static void udma_decrement_byte_counters(struct udma_chan *uc, u32 val) if (uc->desc->dir == DMA_DEV_TO_MEM) { udma_rchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val); udma_rchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val); - udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); + if (uc->config.ep_type != PSIL_EP_NATIVE) + udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); } else { udma_tchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val); udma_tchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val); - if (!uc->bchan) + if (!uc->bchan && uc->config.ep_type != PSIL_EP_NATIVE) udma_tchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); } } -- 2.25.1