Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5972112pxv; Thu, 29 Jul 2021 03:14:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6V9Gis+nFZ4gGmzfYRW6S+Ajcd6QDcmfl/+ISlfyuOYE80O7QfrTaQ+ojsrvXbG7ElwYn X-Received: by 2002:a92:8e44:: with SMTP id k4mr3114879ilh.305.1627553656151; Thu, 29 Jul 2021 03:14:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1627553656; cv=pass; d=google.com; s=arc-20160816; b=knE+ZabSMQzD0zkL73+1gluar6lJRllXenAG3q4Dcn0sJ+3pA4aJNQYtArUiIMOMdf fjYpjsHLKuhPH38oJAseCKjzZP7z+aE7glH8eb+4dXDdAgNREUMZgGUS/DX7CglbymV8 2fvSlVaFE/UbFWFhZCaNfkXG66i/XFW+sbNi1Fzdt0Wh4xOBIKW+uYyrFTO6IcPjibbA UaUY51By06hzevmbqruJ8IBm/PcjC3itG5wbuh7MNMHdZ/VwC1dwRiCUAg5h41Gh6rSv g2BKNK7WzY5OUfsZb3JD6IagzcoatjTXXUWGguufoH+ClGBCq+MutPn0JB0ZBz41pTNT NTZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=+VzxSlYk5Cqro5ij9API7cbIkton1xzILQo21X1aO/U=; b=BValXqKgOGtgVJMI25j9s2Ub+rDzoOu51N6ZH3588BM2pF9v2qfWOY3PGYXttwqn2w j0yQIDBUy1mgPY0hxLxtXrlJXhzweqsAe4WuTO4pzx8hzRAAPIDQAZVqyYXt0RCWm5FE Wi14N2UlwqMapzsUTHLupLEel/VIv2sezoyySWUBA0mzygtFxpbQd/oeal5s+IDXAv+l kSf0Qe15GP1LeJUtCgCfQY2Wj+glf4EK7rNxFKn3OquAAtRktBWKXWndujU/IkNKvAFn 9sU4T9LwcuJIzyFGC/y/AolGxm+0HmBquy9zeoTVeRrx/Y02q1YM+8D+5mTdYZGHmFpa VyLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=gw+iiaHm; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si3027058jas.104.2021.07.29.03.14.05; Thu, 29 Jul 2021 03:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=gw+iiaHm; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235598AbhG2KNE (ORCPT + 99 others); Thu, 29 Jul 2021 06:13:04 -0400 Received: from mail-bn1nam07on2058.outbound.protection.outlook.com ([40.107.212.58]:32901 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231488AbhG2KND (ORCPT ); Thu, 29 Jul 2021 06:13:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJnbky6JtX4663ppdG0dmWXLB266rV3RGfoMi6v4Csa1rh/WqGHtuYzJVXRR5ARLgZdjKvZGkc/y/CzS27BOsJ+KKMkzUW8xMY4hL159HyQyZLdTgLZ57Cy3ryuHfUc+CncIEcxoH5UqEWlWlHROXxhQ3dVIiO98r7Mi7kGs5VzvyCawbGIDVs954ccca5pLqJbdBou38wZAs7b45JckySYD/KToWPRNO/fIl8Wwdm09rzUZ+b5Bnn2N0yPQhP8ldlNIWklevY4u/xoD8MSl2T+T9FfcleMpXXiIf8S7qQg8l4P8h12xtgg1Wn7LyUDqtLiZbiVWVNrYJQIOgRIjBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+VzxSlYk5Cqro5ij9API7cbIkton1xzILQo21X1aO/U=; b=lxQ0qqZtyG+WySklgLe2i2UYwEpsCaNegaABCALJJkH3iPImnvbUxwfiVMbVK/4JiKRDm3XeEaD5BKfB4/YvE4toAQqIG0Fc7opPn0uvDuvWs/5DMy6cihoSAqqFWy9LD1j41O0GI9rORHg1LDgUxpb5PZRABdW0IYiI/mcv/Kw74b7ypTACBfhi0euyo69REdMCpGhON+d5cJ/padaAQ0v8od7PJUVMNunL8YPSbtB+1VNlCF7FZKiV5M9inyz3fyAv4rCbhMezqeUkwngn7rcCkkqzQO6Pf7RMFWSa9R5ml4seBI9bUt0pnuDQg/jBFV85GsS2Uf+mJsA+w3VjFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+VzxSlYk5Cqro5ij9API7cbIkton1xzILQo21X1aO/U=; b=gw+iiaHmGYvLkUM1L3S/sPG2WI+1Tbg/98q8suwKVuwD424NU0xiWtlOJ/LxKpFl92IT2fexDRiaSxqjcG2KKyBDr7njM/d2sv+wvBy7s0XeaC0u5xJoXis7D90QPt+fK6Vnj0pfL7HepSz/zaz/c0yD4zQ/KlePWXYVOfYKp/4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5103.namprd12.prod.outlook.com (2603:10b6:5:392::13) by DM4PR12MB5055.namprd12.prod.outlook.com (2603:10b6:5:38a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.20; Thu, 29 Jul 2021 10:12:59 +0000 Received: from DM4PR12MB5103.namprd12.prod.outlook.com ([fe80::18ea:5df5:f06e:f822]) by DM4PR12MB5103.namprd12.prod.outlook.com ([fe80::18ea:5df5:f06e:f822%3]) with mapi id 15.20.4373.021; Thu, 29 Jul 2021 10:12:59 +0000 Subject: Re: [PATCH v10 2/3] dmaengine: ptdma: register PTDMA controller as a DMA resource To: Vinod Koul , Sanjay R Mehta Cc: gregkh@linuxfoundation.org, dan.j.williams@intel.com, Thomas.Lendacky@amd.com, Shyam-sundar.S-k@amd.com, Nehal-bakulchandra.Shah@amd.com, robh@kernel.org, mchehab+samsung@kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org References: <1624207298-115928-1-git-send-email-Sanju.Mehta@amd.com> <1624207298-115928-3-git-send-email-Sanju.Mehta@amd.com> From: Sanjay R Mehta Message-ID: <368f7d3e-bdb1-ea9f-de70-285280420706@amd.com> Date: Thu, 29 Jul 2021 15:42:47 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: KL1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:820:c::17) To DM4PR12MB5103.namprd12.prod.outlook.com (2603:10b6:5:392::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.252.71.123] (165.204.80.7) by KL1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:820:c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Thu, 29 Jul 2021 10:12:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c420410d-b22b-4ca6-5be0-08d952797116 X-MS-TrafficTypeDiagnostic: DM4PR12MB5055: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DknASLUZUgPDkwzxkw50NsGTDZ76/IBQOs5gMy/VsPjqJ0dq62ej9WhNYp9UlRhflPkG9ATWSxAwbkAiqanbaDTKmjdr6trj8uzVRSm3sWdXloOfmzXYmYs7cW9WJd4nWYMaC8uVYDLFxzowgz/It3qxTStDnPtX3MXsbgiv26vojqv6BsmcNARMsXffRft9vjnLUVFphOej3dRmTPLUzmkWu2GJemBEtRWspw7iqKJPb2Zx21Ikqfq01NdSY7mJpXrEt+7Axo/jq2Mdwv6yLDR6nMU3AovvzpGMcvrEDep03cA3zO+TpNca8ZzKxsGcvjIMrEwvoU/1OhpZOii1jYprgIEOHBGl+RNNH1yZhjniYi+0dilQBhuJnzDrMnmRN9BBYvOjqFDu4eZnmUV/1cWNmfjEm9isXGD1SSYsceeUhwZEjXaHmWL7n1slklQC1E8QvNaE93GFKiGosZqPZD6T37mbFc31UuDbiBexrkjs4VWEzYWgSQ13rHT8BLeWso+qbhO1L6FQMSR7KdnYoVHILLuKTmF8zDyesCMO2U56Ds0cpDC0Gqa9LhOQatCW2FTjILVjzaLeeVlpuAQkFtbQvYN2gquYaNVc1+Znkjt+QtRb/NfDt9nWaJwHNa1nmVYLc40c1/yHNv6YRsiwl4d7mLK4lkQgni2lPp7kGXoEriEiRczziztjtGorj/3J4OTYmg8+iKweA8o2zFs7hIQYo4N/KVXGryDJlUNnReA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5103.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(366004)(136003)(39860400002)(376002)(346002)(4326008)(16576012)(478600001)(110136005)(83380400001)(36756003)(6636002)(31696002)(5660300002)(316002)(8936002)(6666004)(66946007)(38100700002)(956004)(53546011)(31686004)(2906002)(8676002)(6486002)(4744005)(2616005)(26005)(66556008)(186003)(66476007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?STQ4NGFnazB4NUFJZkErT0lRbllUQzJTWTBmWVA0Q1ZoNmpzQURmUEhwZWpV?= =?utf-8?B?Y3UwU2treUVGYjVEeU1yTmxmNnROeDVwUmZKOUxvVnhWcnJlUk1ya052TGRh?= =?utf-8?B?Mi9XV2tMcGtlQjM4c3p1eENPV0ZGb1ZVYjkrOVRtT2kraFN3SHVHOWZNUlN5?= =?utf-8?B?bjFEZVFvSnpIQTJKdHlSQjZxUnF5cWU3VWw3ZCtHa0txVXJtNVl1WTJCd2NP?= =?utf-8?B?OFZiaHlQMkJkajdPZ0hZTEkvazlsejlkb3VSYXJtT1lGdTdtYm1lWGRyMVdl?= =?utf-8?B?K1hnUEJ0c1lGcHhBbmp6VnRTb3Y4OW5OK0dRYjMxdHVYNWhLQTM4TnhJU1pz?= =?utf-8?B?U0YzZGsrZmpSTFZlRm9FWnp4N1pMVFA0M0JxQlNyQ2JRYWxsei9VL3NUZWc2?= =?utf-8?B?WFptTTA5eE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s1ZFFoRVVCUXhxMmYyYzh4?= =?utf-8?B?b25sL21IMGRua28weCtsTzNBMVRnbVZXNGhYZGZEcGc0TGk2ZUlOSk9nbk0z?= =?utf-8?B?OG1vOHh4cUV2YitnUHlVc3NNYzZocnBZdE9OZklPQW0wclZ5VHZYaUQ0OFFM?= =?utf-8?B?UThMVTZvZTVnaE51cEhiaHAvYkljTnBhMnJlUEc2cTZGY0ZhZ3pzc1MxN3FI?= =?utf-8?B?V2lXbnlWYnBSS1lzUXZLNHhKTE1ERXdEYTZlbXlKZDhMYWtPa3p4OFJCL3JW?= =?utf-8?B?NWlSSlpaMWFyVVE4VjBqeEcxTUN4cU9WbkhqVXZqTmNRQmZ6TTh4WVc3OFdk?= =?utf-8?B?a2NVczg3K0JldTVTQ29PUGQxWFhBdll1YWorb0pYZGpONHJlUXI3RkRWb0pj?= =?utf-8?B?eDZub0RvbnBSNzRzTHFOSEVYWm1CcEsybEFUamN3TlpobE9Weno5YlY2dnlj?= =?utf-8?Q?cwDSsCbpQlrLJEM+JIGpMyS6FlTfjZ0YLkqOBM/?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c420410d-b22b-4ca6-5be0-08d952797116 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5103.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2021 10:12:59.2412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9bD93Jc6XVNymJzzifVm58GJ8JHYZDNj0TpF7L2vQnqq6pOgRD01FbgIXwTcUd5clpKhbM+aPCtaOO/WRSEPOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5055 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/28/2021 11:45 AM, Vinod Koul wrote: > [CAUTION: External Email] > > On 20-06-21, 11:41, Sanjay R Mehta wrote: >> From: Sanjay R Mehta >> >> Register ptdma queue to Linux dmaengine framework as general-purpose >> DMA channels. > > Mostly looks good, one question below: > >> +static struct pt_dma_desc *pt_alloc_dma_desc(struct pt_dma_chan *chan, >> + unsigned long flags) >> +{ >> + struct pt_dma_desc *desc; >> + >> + desc = kmem_cache_zalloc(chan->pt->dma_desc_cache, GFP_NOWAIT); >> + if (!desc) >> + return NULL; >> + >> + vchan_tx_prep(&chan->vc, &desc->vd, flags); >> + >> + desc->pt = chan->pt; >> + desc->issued_to_hw = 0; >> + desc->status = DMA_IN_PROGRESS; > > where is this descriptor freed? > This descriptor is freed in the pt_do_cleanup() function. pt_do_cleanup() is set as a callback routine for "chan->vc.desc_free" in the init code. - Sanjay. > -- > ~Vinod >