From patchwork Tue Dec 12 11:10:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13488972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1711CC4332F for ; Tue, 12 Dec 2023 11:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NidywTeLa1t2lr7Ob6ZM+vxH7ce9toH5B+ECnpFPdEs=; b=NfSufpN4zfnb+W j06e4LUzA/I30M7fYGCANDH8yDph128b49/zNa0H9ZBQeBHiSsO7iaNmTsqbXbkXX1r0H5B5TuZDV BiTxRg6ol55fSr+skdnjmn1Z9/l//KvutHDS5Q6/veAXvUftM+U24rVrlIVZM02JxtOIerbCeQSOf 3G2sLVgAmIxTMMIkU4v2Hw2tFawttM7wq8C2xYsyhlcH4CdCBAg8FG8CzDf8b9hXjc7lHiqQj+wmk H3tfEKphf16N81c0kLBXFACV0Z/ZUimtLyG8y8NA61HosB92Re8oSsDKXrjXbYfvgPjxSbXBJMtX3 cmWyPEfKRTiu0IlpeFQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rD0fa-00BNx4-1p; Tue, 12 Dec 2023 11:11:22 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rD0fP-00BNnQ-0L for linux-arm-kernel@bombadil.infradead.org; Tue, 12 Dec 2023 11:11:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=c3xZPTrlmq5zKDBwFw/CwKWYbPbI3+6H+5cNtLUVu3k=; b=KbaHvLkuGmAqDLBEcWhgYgXRat VYWd7v4sjHdBCvIOj/Q4zdG8wziKQMca5/TRRp9hRyz+fh36zM9ME0NsbDdMND+S5H/hfebSqbPaQ gppnEjMpjBzoysEYe0pTC83P3Lp6tbkYP+JG8HLd9yPn/JLR3gM2jCxCvjZ1NdDbrFbrUj9VNnrCH vNafOTUTCl6P3X/eRru4i5+FbCOOYnHcRoHbdeCXAlKBs8fv349drOyX+SZEC4cM1W4DLiD1wScfU wUx5nUxjXKIwFW24d2BqpH11Vv/EorQa+73tvFslL8lhD8YTZeZEDbeYok4vAuDyUQdd9KeQQPHTm zqh6Gblg==; Received: from lelv0142.ext.ti.com ([198.47.23.249]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rD0f6-008VZJ-0X for linux-arm-kernel@lists.infradead.org; Tue, 12 Dec 2023 11:11:05 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3BCBAEbn031704; Tue, 12 Dec 2023 05:10:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1702379414; bh=c3xZPTrlmq5zKDBwFw/CwKWYbPbI3+6H+5cNtLUVu3k=; h=From:To:CC:Subject:Date; b=S96wkB+GbpaD8/Yimg5ACTTq+GTJ2I8Hto4UZ/eixVQINahk/Cwl6I1WabbxwmJRo /iIEude9hKWy0+w5+KRCknl5LHIXEp1DwuRezAtRBHkWhQEYKH0lOadvXdxwsyt7f3 y2e16x9sz6S0tndLstOkyHs35aoHusQMGeDvNl8o= 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 3BCBAEXJ014613 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 Dec 2023 05:10:14 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) 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.2507.23; Tue, 12 Dec 2023 05:10:14 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 12 Dec 2023 05:10:14 -0600 Received: from uda0492258.dhcp.ti.com (uda0492258.dhcp.ti.com [172.24.227.9]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3BCBAB9v088764; Tue, 12 Dec 2023 05:10:12 -0600 From: Siddharth Vadapalli To: , CC: , , , , , Subject: [PATCH v2 0/4] Add APIs to request TX/RX DMA channels by ID Date: Tue, 12 Dec 2023 16:40:07 +0530 Message-ID: <20231212111011.1401641-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231212_111054_624696_0886C59F X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The existing APIs for requesting TX and RX DMA channels rely on parsing a device-tree node to obtain the Channel/Thread IDs from their names. However, it is possible to know the thread IDs by alternative means such as being informed by Firmware on a remote core via RPMsg regarding the allocated TX/RX DMA channel IDs. In such cases, the driver can be probed by non device-tree methods such as RPMsg-bus, due to which it is not necessary that the device using the DMA has a device-tree node corresponding to it. Thus, add APIs to enable the driver to make use of the existing DMA APIs even when there's no device-tree node. Additionally, since the name of the device for the remote RX channel is being set purely on the basis of the RX channel ID itself, it can result in duplicate names when multiple flows are used on the same channel. Avoid name duplication by including the flow in the name. Series is based on linux-next tagged next-20231212. v1: https://lore.kernel.org/r/20231114083906.3143548-1-s-vadapalli@ti.com/ Changes since v1: - Rebased series on linux-next tagged next-20231212. - Updated commit messages with details regarding the use-case for which the newly added APIs will be required. - Removed unnecessary return value check within "of_k3_udma_glue_parse_chn()" function in patch 1, since it will fall through to "out_put_spec" anyway. - Removed unnecessary return value check within "of_k3_udma_glue_parse_chn_by_id()" function in patch 1, since it will fall through to "out_put_spec" anyway. - Moved patch 4 of v1 series to patch 2 of current series. RFC Series: https://lore.kernel.org/r/20231111121555.2656760-1-s-vadapalli@ti.com/ Changes since RFC Series: - Rebased patches 1, 2 and 3 on linux-next tagged next-20231114. - Added patch 4 to the series. Siddharth Vadapalli (4): dmaengine: ti: k3-udma-glue: Add function to parse channel by ID dmaengine: ti: k3-udma-glue: Update name for remote RX channel device dmaengine: ti: k3-udma-glue: Add function to request TX channel by ID dmaengine: ti: k3-udma-glue: Add function to request RX channel by ID drivers/dma/ti/k3-udma-glue.c | 304 ++++++++++++++++++++++--------- include/linux/dma/k3-udma-glue.h | 8 + 2 files changed, 225 insertions(+), 87 deletions(-)