Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp197558rwl; Tue, 4 Apr 2023 22:06:42 -0700 (PDT) X-Google-Smtp-Source: AKy350bgDELthxoFHGOOLWfzC8/LfC+oL4Q+qq57HzZFEtJzWk/ACwzUgx3AaPLUi2F60Ywq3yvR X-Received: by 2002:a17:903:28c7:b0:1a1:a830:cef8 with SMTP id kv7-20020a17090328c700b001a1a830cef8mr4609261plb.27.1680671202264; Tue, 04 Apr 2023 22:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680671202; cv=none; d=google.com; s=arc-20160816; b=DmNkCFsUH7L8JXQn8jAZ6ABq/UxrpQ6qn6Wxb/Lbb3bVrPBN78aXg3nl7Wp27U1wjc tkr+VkV+NDjWONh+yKBstzMkg1pAUq4ys6n8PJ/RmEnO+3WvcTzDdu+sU/oSwhFDreWr rwcchP/dkGSPCw+XNVkjAhHX5XnPy0p+qgB/+wqiiakz9Qd/ZKkKDGnqZ1709A4g0+tI DMuuPLyiJlXTCUsPzUWRHTOtD2H1h2MOwowvso/0Fe5v1zYFL8b3xMvoKwy+R/IzoV3P vLjF7w1EEvSuSLdV4OBLjvToQxUUEbjkgD9ecSs27OhOKO07t6f3mMbO+Iw6wQb2LkM1 k3AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=I9/MDBpiYVyP0EvIh5ukLUYcQ0p9CtEOQ9dED8/Fi6E=; b=f5n2LNpTFnVMwldvv8Dfys1OD2hkOD2NYhU7PIe7kLVfdK0J6L2coR9svYv5lI+PXR 5P6alJhp+Yg7wNlvivRcKLKpVmhzAbtHm8iOZYy7EDb9akQKC1/JTE2hc3+VOqBAHL+Z +8UuYcphfp2eEl3jwGtY1EIYkBXgINOIVNn3JGc4jZTj+L75LKlntE3wcaAgXDkwmLYE XnD1XXD71vsCBcx/8uxqgfptjkayGIp+fgO2HxbmCPS9y50qzP4mQIFpkx95WscxaCQp I30JzFy85C5ZfNRylznBYHDo8VNirubU+iqUwHULmMwPXMVniK42Z0SNM5uqAnDoPlBa QD7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WKgqxJAx; 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 q15-20020a170902dacf00b0019cd505cdc5si9951831plx.440.2023.04.04.22.06.28; Tue, 04 Apr 2023 22:06:42 -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=@ti.com header.s=ti-com-17Q1 header.b=WKgqxJAx; 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 S236837AbjDEFBH (ORCPT + 99 others); Wed, 5 Apr 2023 01:01:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236593AbjDEFBG (ORCPT ); Wed, 5 Apr 2023 01:01:06 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27DCE2D56; Tue, 4 Apr 2023 22:01:03 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33550rrn074903; Wed, 5 Apr 2023 00:00:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1680670853; bh=I9/MDBpiYVyP0EvIh5ukLUYcQ0p9CtEOQ9dED8/Fi6E=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=WKgqxJAxBg388wJYQUa5JCJWELuhA/y+kVMKlaSLyhIrde6lhr5oJYc/rzOxh+gAb sd1j4XgGFN/8Y5zXycWaXVNa7k1vEGDK24yU/v4kclGtZzLCC84MYK1bRebNBbNPN0 2i6Ld+YH4siWLvAsoVS9GW8JJE9S+yIt4gz3r1s0= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33550rgQ025562 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Apr 2023 00:00:53 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Wed, 5 Apr 2023 00:00:53 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE100.ent.ti.com (10.64.6.21) 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; Wed, 5 Apr 2023 00:00:53 -0500 Received: from [172.24.145.61] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33550o7L056780; Wed, 5 Apr 2023 00:00:51 -0500 Message-ID: Date: Wed, 5 Apr 2023 10:30:50 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 CC: , , , , , Subject: Re: [PATCH] dmaengine: ti: k3-udma-glue: do not create glue dma devices for udma channels To: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , Vignesh Raghavendra References: <20230404081158.1266530-1-s-vadapalli@ti.com> Content-Language: en-US From: Siddharth Vadapalli In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Péter, Vignesh, Thank you for reviewing the patch. On 05/04/23 09:17, Vignesh Raghavendra wrote: > > On 05/04/23 01:53, Péter Ujfalusi wrote: >> >> >> On 04/04/2023 11:11, Siddharth Vadapalli wrote: >>> From: Grygorii Strashko >>> >>> In case K3 DMA glue layer is using UDMA channels (AM65/J721E/J7200) it >>> doesn't need to create own DMA devices per RX/TX channels as they are >>> never >>> used and just waste resources. The UDMA based platforms are coherent and >>> UDMA device iteslf is used for DMA memory management. >>> >>> Hence, update K3 DMA glue layer to create K3 DMA glue DMA devices per >>> RX/TX >>> channels only in case of PKTDMA (AM64) where coherency configurable >>> per DMA >>> channel. >>> >>> Signed-off-by: Grygorii Strashko >>> Signed-off-by: Siddharth Vadapalli >>> --- >>>   drivers/dma/ti/k3-udma-glue.c | 70 +++++++++++++++++------------------ >>>   1 file changed, 34 insertions(+), 36 deletions(-) >>> >>> diff --git a/drivers/dma/ti/k3-udma-glue.c >>> b/drivers/dma/ti/k3-udma-glue.c >>> index 789193ed0386..b0c9572b0d02 100644 >>> --- a/drivers/dma/ti/k3-udma-glue.c >>> +++ b/drivers/dma/ti/k3-udma-glue.c >>> @@ -293,19 +293,18 @@ struct k3_udma_glue_tx_channel >>> *k3_udma_glue_request_tx_chn(struct device *dev, >>>       } >>>       tx_chn->udma_tchan_id = xudma_tchan_get_id(tx_chn->udma_tchanx); >>>   -    tx_chn->common.chan_dev.class = &k3_udma_glue_devclass; >>> -    tx_chn->common.chan_dev.parent = >>> xudma_get_device(tx_chn->common.udmax); >>> -    dev_set_name(&tx_chn->common.chan_dev, "tchan%d-0x%04x", >>> -             tx_chn->udma_tchan_id, tx_chn->common.dst_thread); >>> -    ret = device_register(&tx_chn->common.chan_dev); >>> -    if (ret) { >>> -        dev_err(dev, "Channel Device registration failed %d\n", ret); >>> -        put_device(&tx_chn->common.chan_dev); >>> -        tx_chn->common.chan_dev.parent = NULL; >>> -        goto err; >>> -    } >>> - >>>       if (xudma_is_pktdma(tx_chn->common.udmax)) { >> >> it might be possible to narrow it down to include a test for atype_asel >> 14 or 15, but then I would move that test to a helper (passing common as >> parameter) and re-use it in other places to avoid getting out o sync >> overtime. >> Might not worth the effort, just an observation. > > Irrespective, we should at least add check for atype_asel == 14/15 along > with xudma_is_pktdma(). > > Refractoring these checks to separate function can be patch of its own > >> >>> +        tx_chn->common.chan_dev.class = &k3_udma_glue_devclass; >>> +        tx_chn->common.chan_dev.parent = >>> xudma_get_device(tx_chn->common.udmax); >>> +        dev_set_name(&tx_chn->common.chan_dev, "tchan%d-0x%04x", >>> +                 tx_chn->udma_tchan_id, tx_chn->common.dst_thread); >>> +        ret = device_register(&tx_chn->common.chan_dev); >>> +        if (ret) { >>> +            dev_err(dev, "Channel Device registration failed %d\n", >>> ret); >> >> my guess is that the put_device() is still needed, no? > > Agree I will fix this at all 3 occurrences and post the v2 patch. > >> >>> +            tx_chn->common.chan_dev.parent = NULL; >>> +            goto err; >>> +        } >>> + >>>           /* prepare the channel device as coherent */ > > [...] > -- Regards, Siddharth.