Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp364645rdb; Mon, 29 Jan 2024 04:55:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJVnDaNArLHUdwn9TMVouh3L2ZzwML/GDwadHiNak1qyPwb1M6O+JvNmiAw0+MIyCmcZPI X-Received: by 2002:a05:6358:7e97:b0:178:65bf:8b83 with SMTP id o23-20020a0563587e9700b0017865bf8b83mr2558933rwn.62.1706532924362; Mon, 29 Jan 2024 04:55:24 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ft22-20020a17090b0f9600b002926a6f71c0si5690674pjb.119.2024.01.29.04.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 04:55:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=TBjnTcLN; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-42733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 00C7C284819 for ; Mon, 29 Jan 2024 12:55:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3D54633F6; Mon, 29 Jan 2024 12:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="TBjnTcLN" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2047.outbound.protection.outlook.com [40.107.237.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78B1362A04; Mon, 29 Jan 2024 12:52:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.47 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706532766; cv=fail; b=Ljs3LbUOKXHp9EzNV7RbietQpEJ4rZA2WTOn/AU9yJ6HNtNuoDFg8yxiVK0HIqavmxhtTluM+MSQW6vucX+I+Rd0N2TrgMNtDeh+lmkE7qP3wuEzuFmhYwumQ5JFOAa1gqmj9yWq3DU6bKIDgAGdH9MLBoxp5Cv1xP/ZyorWc4M= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706532766; c=relaxed/simple; bh=Ln6DC6rzrndetma+XGZS7+bE1/sNNMaHj84oOB4R/XU=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=o9L9GCiHba47rJ8TV6gXZQWCBhTPIcQNvgV1LCD9TIxnPlDdalmcBuMO29iYYZgIp8qjFpGNU2KhAeFVTmUZFl/SJQGV/oKEaTPbjesJJ13/ADHvy1OYfLdoj2vZ1WAu2BKd+zd8ikG8CBK2OB6DZa17ls29B8JD17QHim35Xqk= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=TBjnTcLN; arc=fail smtp.client-ip=40.107.237.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZhLpGUobQ0iVkbxkCKOyCbM4OnU4Gjo2ybhtJYhL9Yj2B6B4tqSaSXVhsnPWfXXTVHsw6Ct16qp40rcUxz9hUTWpgQibiamIjdfxqo4gB0fb8j3ZmQm6lqYuPGrawc7djQaO62MUgJxqdgngtsIeno9i+ZnuevrzfWdYayWnQ4Aqy8Wv1OcSVv20MVvFy3UJD5m49Ho/B8Go/GBUk9C6Tt0Rh7vhDdjHoUxj+s3j79leuTTNViVbP9U15YBenfWShSUg3rT7CqrSu4EU0Rh2MLl9UUz++rVA1HhteHreSeB1DDGWFERGv5O2xTndmSC+ZV49wkueltBUPQHaAc+qw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5fYIetDL1jttk+LQ8Bsj/fol0+RxPpSbCxCApVQDM4E=; b=EvrFNN4dIhmN6GXCIgsuTPrOYHJ/Yc9QJUiGx9aXp40eZHZte6CkUAwgJEv7fnSWNdW+Vrf5laZBirxyJi9ckKSIXn9mbHwhBx0PaPdJGYFzMrA3GfcWmIZG5gQfuJ4SUlc6kGktr4wRs00c0r+zNq3JjrYrGArG9zPRIMA1j4J7MfIChM604GJbcPv7u0dmPCQUP7Xwgy9eQR8UjtgcmlImN95w1cZVSmCy3OkgMva0yMG4vR1RE3YXWJtRCj5xpr+Qvbihp5BJTAFG0tJL/csHNCg9Z+catJNFZa8Sn2o7kl6ypwJV8jEDFysLTTGWcj7Um6ZyZ7IKkXekKt5ilA== 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=5fYIetDL1jttk+LQ8Bsj/fol0+RxPpSbCxCApVQDM4E=; b=TBjnTcLNkMT29BtGmewHc2/DHACs9sXdGlrR/NOxZ+2D0G6u/FeifrJxjuAYKXaB7dtCvdTwQCmYYhFPrGqWCz9FgNkSIyGsWb/0iv9eFRCRmUPsj0sBr5CAHluZ7n/a+To6woyzAr7XqwyvL4inPqKgFEzeqEafL+04dHD9pjg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by CH2PR12MB5515.namprd12.prod.outlook.com (2603:10b6:610:34::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Mon, 29 Jan 2024 12:52:41 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::e1fb:4123:48b1:653]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::e1fb:4123:48b1:653%4]) with mapi id 15.20.7228.029; Mon, 29 Jan 2024 12:52:41 +0000 Message-ID: Date: Mon, 29 Jan 2024 13:52:33 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 5/8] iio: core: Add new DMABUF interface infrastructure Content-Language: en-US To: Jonathan Cameron , Paul Cercueil Cc: Lars-Peter Clausen , Sumit Semwal , Vinod Koul , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-iio@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, =?UTF-8?Q?Nuno_S=C3=A1?= , Michael Hennerich References: <20231219175009.65482-1-paul@crapouillou.net> <20231219175009.65482-6-paul@crapouillou.net> <20231221120624.7bcdc302@jic23-huawei> <20240127165044.22f1b329@jic23-huawei> From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <20240127165044.22f1b329@jic23-huawei> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: ZR0P278CA0158.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::17) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|CH2PR12MB5515:EE_ X-MS-Office365-Filtering-Correlation-Id: e8a38a3a-476e-4675-56a4-08dc20c92da9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DUF7/wJm0GfrNJ/SnEIkfEpCjhO2a+rf9VOCGJzr9hcHduQaSo4TpKUZIJ1JjbC2ti32zqKnG3A6PbVaa+1rBayHwWGW4RMKTVQcGL6TCWiVmte/tJJg3mPyw2PpK3QpIAz+NsWV5AhTfCo2bulBV0KtfSguHVBLYpp3lUmbU0SjN4CNPxiTDIProlJkVBrxEvNzOQKWyKvpyoyczz8hZTq1CpsXpLWJMxg8GyZCVsCqBdPSUry9EFmzy64Zcb7CAoB8qaEfQYRcAIWNT4RqOkOI9Z4wQ/i5S/iVcCxP5N/GPgh2Y89hzkwFtI1R61f87VsKFhHrP8eRwqmNZaPk6Z0gBoQtTsnBjXqCmhM2FvyeP4cJSFO7ATVUU97M0tubwoxxkZPVnzFkhG/IZ4abPeRCPlrmO6Tgq09Hy07JYcRIGA7KnlA5PlsZ4tay+tYizHoAhOUrCi096iXaUnxgNAp+d/Ge5KbDvaJ90LUjd7k67oEkypU5Hzv7ECVPdtGDkfO69ZesRgyDDetWeQ6U6PBXT35pGzZd9zmpnW14czX5YanDd24WtS9G5Esmaj7fevKbUeTz4q1Uw6IenDKauFaaqAdQldbBOQ1oNmsbf1MJ2koe/LxIEH9eyE3l9hm/ErROwl5GnskqB5t8Ha/Bng== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5685.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(396003)(366004)(346002)(376002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(31696002)(36756003)(54906003)(66946007)(316002)(66556008)(86362001)(6506007)(110136005)(8676002)(8936002)(66476007)(6486002)(478600001)(26005)(4326008)(4744005)(6666004)(2906002)(7416002)(5660300002)(2616005)(6512007)(41300700001)(38100700002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OTlXWEpqbGhlTXp5Q3BZQmNNZlVLc0syYVJiemJGRERkY3NuN2tpQmF6b0RY?= =?utf-8?B?WnBDdUJKTmRwWnlBZHJSZjJvUEVqSEo1VXdwRHYxVmJtaXl6RGFCeHJMeHNm?= =?utf-8?B?aGFIdDRRN29oMCtzNnl6ai9QZStBZmVvdFJrRDI1MG0wUGR4UlkySGFiQUpq?= =?utf-8?B?ck5kQUR4cFNxdk9KeEViekpjZzhxV0dTUTJ1VVFRQTUxWXdxMUt0UGhIRFlj?= =?utf-8?B?VXQ4b2VwdGJWYnduQXFLYWp0SlBJc040Q2hUbldWWXhVT2taaGJsMjhXc1o3?= =?utf-8?B?Qk9RdGx4cktwTTEvcWErOTFIOFZ2cnlJK1czeDZMb2crSWNWcUVJeGM5Y1F6?= =?utf-8?B?cmg1bFE0TURNRGN1QlZsbzl3SDFsYi9pVHlqUExISEN1Y2t1dm5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9 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 12:52:40.9135 (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: bZGa8s5yG7LOLlWGwtAGcrvr9+q1im6/XZZPYGmED7fcCr2V2FEY4qUQ+wnnPiTu X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5515 Am 27.01.24 um 17:50 schrieb Jonathan Cameron: >>>> + iio_buffer_dmabuf_put(attach); >>>> + >>>> +out_dmabuf_put: >>>> + dma_buf_put(dmabuf); >>> As below. Feels like a __free(dma_buf_put) bit of magic would be a >>> nice to have. >> I'm working on the patches right now, just one quick question. >> >> Having a __free(dma_buf_put) requires that dma_buf_put is first >> "registered" as a freeing function using DEFINE_FREE() in > buf.h>, which has not been done yet. >> >> That would mean carrying a dma-buf specific patch in your tree, are you >> OK with that? > Needs an ACK from appropriate maintainer, but otherwise I'm fine doing > so. Alternative is to circle back to this later after this code is upstream. Separate patches for that please, the autocleanup feature is so new that I'm not 100% convinced that everything works out smoothly from the start. Regards, Christian. > >> Cheers, >> -Paul