Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1528074ybv; Fri, 14 Feb 2020 01:15:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxkO+RqRtU8n9e9q+EqfPkp2I26Lo0PWm1jL2r/meruwOEhwTqnCLDinuzYmdUIEyenX0Vk X-Received: by 2002:a05:6830:18c4:: with SMTP id v4mr1404099ote.265.1581671701259; Fri, 14 Feb 2020 01:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581671701; cv=none; d=google.com; s=arc-20160816; b=hPGkTAlFNt93x+heSGISxP4gKFAiLShatA4LuVq/IHPR1ofGWKf/gzGLkiCE4T1A0H LgQIwMl+agWsr+3VWguwm5E80WpgJQ1rLmc+cMhZEv+rYw4zW7A0L1P9wO5twyV0+7ZJ N4lWJqWT5OsT0v9k5axF6uLoLR1TEA0yLiwSxTaDY/tSJFhxTfK1Jkwf6gWLzDG3dAVF KdVsUquIc5KOTnP0YCIinPCwRH9zmsjY4ItCyCORX5m1AwMIngt5vNSJMAfZvMjN1Wal sUtLg8vrEfNDnMuHqA9WgiglABjphZAo94FgxfKNHOxMnR0PTHYicHJCF0p1PvktJxpL SEWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=votoJopeUiOFmQ8b9bopvSn/QhK/lyTDFPpmbqA+rLo=; b=L19rCzPpUWwbpPDWCU6nTZpTmbXAIPAHhHaflYmLrdBEb7TVCOwcqjSO4GFIA7ymv7 n3i2PG1JRtwdkBG0uFdlvMjFD4/vyjMgAAA/QDUJkYAT+NVPX6+X6PrMnxjfCF9BxnFV rDYh6qhg4sxzY15AVuSUdtMI2e4HdtwXkinQYm+go3RDg1D25Hjseik1uTTlnR7lTtbD L3rAvBjpgiFF3K9iHOb0fysHrPj8AAMyM67fZIQ7VfqyyBbULlSSGQDy3PdMvlmubuKJ +oeKap0horv2Hmbk+fBGD7htS+FceJOlDUFFQACxq2EYmg9/MYGVXQqI0mClH+8JYCA9 ynAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=O7VDv3jz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si2586030otk.227.2020.02.14.01.14.48; Fri, 14 Feb 2020 01:15:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=O7VDv3jz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728890AbgBNJOn (ORCPT + 99 others); Fri, 14 Feb 2020 04:14:43 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:57602 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbgBNJOn (ORCPT ); Fri, 14 Feb 2020 04:14:43 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 01E9EeVZ117357; Fri, 14 Feb 2020 03:14:40 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1581671680; bh=votoJopeUiOFmQ8b9bopvSn/QhK/lyTDFPpmbqA+rLo=; h=From:To:CC:Subject:Date; b=O7VDv3jzQl4OzEzK4VqTi8zHUNbdDXtHQNubfUVOqUHH3JI4Whp3QBE13rUHeemzw MJK42IdH0cMjc+VsHUmhw75P4CdSfnDZd/dJTNoptOnaIF+vDELggqJvFL/f8AaazU ZpvvfLDQi1ySPbdRlWe38KeNZ20VgMQ/FidNMhMA= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 01E9Ed9g117904 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Feb 2020 03:14:40 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Fri, 14 Feb 2020 03:14:38 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Fri, 14 Feb 2020 03:14:38 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 01E9Ea3u043021; Fri, 14 Feb 2020 03:14:36 -0600 From: Peter Ujfalusi To: CC: , , , , Subject: [PATCH v2 0/6] dmaengine: ti: k3-udma: Fixes for 5.6 Date: Fri, 14 Feb 2020 11:14:35 +0200 Message-ID: <20200214091441.27535-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, Recently we have uncovered silicon and driver issues which was not addressed in the initial driver: 1. RX channel teardown will lock up the channel if we have stale data in the DMA FIFOs and we don't have active transfer (no descriptor for UDMA). The workaround is to use a dummy drain packet in these cases. 2. Early TX completion handling The delayed work approach was not working efficiently causing the UART, SPI performance to degrade, with the patch from Vignesh we see 10x performance increase 3. TR setup for slave_sg It was possible that the sg_len() was not multiple of 'burst * dev_width' and because of this we ended up with incorrect TR setups. Using a single function for TR setup makes things simpler and error prone among slave_sg, cyclic and memcpy 4. Pause/Resume causes kernel crash if it was called when we did not had active transfer the uc->desc was NULL. 5. The terminated cookie was never marked as completed client will think that it is still in progress, which is not the case. Also adding back the check for running channel in tx_status since if the channel is not running then it implies that it has been terminated, so no transfer is running. Regards, Peter --- Peter Ujfalusi (5): dmaengine: ti: k3-udma: Workaround for RX teardown with stale data in peer dmaengine: ti: k3-udma: Move the TR counter calculation to helper function dmaengine: ti: k3-udma: Use the TR counter helper for slave_sg and cyclic dmaengine: ti: k3-udma: Use the channel direction in pause/resume functions dmaengine: ti: k3-udma: Fix terminated transfer handling Vignesh Raghavendra (1): dmaengine: ti: k3-udma: Use ktime/usleep_range based TX completion check drivers/dma/ti/k3-udma.c | 493 ++++++++++++++++++++++++++++----------- 1 file changed, 361 insertions(+), 132 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki