Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp374352rdb; Mon, 29 Jan 2024 05:10:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnd7Fl+KVOIRXGEMjChWF+7FdCU0E5LeOYWq2/6lvEMx0oJYCO3qinUk0wpjHJDNmNOVtv X-Received: by 2002:a05:622a:190b:b0:42a:a41e:f454 with SMTP id w11-20020a05622a190b00b0042aa41ef454mr2380270qtc.61.1706533817968; Mon, 29 Jan 2024 05:10:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706533817; cv=pass; d=google.com; s=arc-20160816; b=jr0wlFo9isMhO2+nHEAvxTipP8hwcztCLVaHe3HnU0dX6t8c/4DYDcXdZii5CdRt6m Gq4XA+hKYS3b3V/xblOSDAWYy4AhtFelUawYB5g+Il9Rp8wsgOP/MgjWmapSxX4CZYPC fZ2csF76vZ8AHwLDn7e1242G9m1LOyW0wNb3H9PJzrHLZywlz9QLjR/jmjZs2DaYVlO2 YEfG6EKd8xCStk7CmraODcMs4SCu/B8Nfhc1EuGQ6pZ4dEctlpdt4s7+9oUcMasLUO3i cCTjEqT9n0kquBd8L46RDmc0X9l9XnOsNzl5gkkSYioIktWC9QWYjz435P+Trz0odgxT 861w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:autocrypt:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=WZ6n1UUyKZ6/GqoAl9C1IKiMh8xfnXYw9yivuJaenjc=; fh=Lowkqf73XtqspxEdqESAl8sX05532FxjQgwf1GwA2+A=; b=RISXciFEJdG0sH+zB33U/UP0KzrgIzNaCZMABDkc+E1pO+CXPoMUZd7kJmRgTifNWl N3Mr+RJjsJhYfa8oxewaCuQNfACWxjEHBJ1uif8BGaRQ8+AI6EzZyRw3XKp2eualOHqY jq5TMP9+R9PtPUvtMZElUeI8ttNazi++1YjWOpb7ZEMZBRKo7iWtFTrGGgvClyhTfDrC yWyW4dyqoiTAZkqlWGWcvFrYXqsoWtcv5Sr+RTN0M+ZE7Ay8oeBoaCKNVKaoKddj2F2a cgLCpfbzIqMzXvJU4CUTZrO+aTIn6tx1UmuvzeXASanD9yNI1ooHo6UEP96v2liQQcUj mqUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=lkJJhIQY; arc=pass (i=1 spf=pass spfdomain=crapouillou.net dkim=pass dkdomain=crapouillou.net dmarc=pass fromdomain=crapouillou.net); spf=pass (google.com: domain of linux-kernel+bounces-42759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p7-20020a05622a048700b0042a111b261bsi7332144qtx.776.2024.01.29.05.10.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 05:10:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=lkJJhIQY; arc=pass (i=1 spf=pass spfdomain=crapouillou.net dkim=pass dkdomain=crapouillou.net dmarc=pass fromdomain=crapouillou.net); spf=pass (google.com: domain of linux-kernel+bounces-42759-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A292B1C21F04 for ; Mon, 29 Jan 2024 13:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67F2964CE3; Mon, 29 Jan 2024 13:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="lkJJhIQY" Received: from aposti.net (aposti.net [89.234.176.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9A9F62805; Mon, 29 Jan 2024 13:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.234.176.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533630; cv=none; b=tRqrbhgulL9qOau4pBj/A9u069C6ycS0dBp5yQjr/ADgKDyqgPrnhd8rR1M6L+/eYr7zld9P7crIJZwy/sh4Qhu0Mf4zAFBDyj/BXF4eqIWGRpQDzFMcfa/g0SQj81Bf61DdbJjo424NkqXtHCy75iXORrHHedvLfFYgRKO3FuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533630; c=relaxed/simple; bh=ohwrdZDM8vaPRClPA73d/eC9TaOp9u2xSfByKk4W4Wc=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=BVanrIfzaTZ9vgGaRuPfMy9BkfNK1UtvTf/kpORf43yh40m5ikDa1czUhJVrF/kcSMPu7G1IU8WjUldaAjWDZtdnlTg9No7KXETtkmy9SOn5gxb8j1h/59oGfovKt08bCSYiqBF2IF8fGFyQVb82XCvKsiiqHAER+qX7TnFLmho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=crapouillou.net; spf=pass smtp.mailfrom=crapouillou.net; dkim=pass (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b=lkJJhIQY; arc=none smtp.client-ip=89.234.176.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=crapouillou.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crapouillou.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1706533620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=WZ6n1UUyKZ6/GqoAl9C1IKiMh8xfnXYw9yivuJaenjc=; b=lkJJhIQY7TfMtm88L38sEkEJxselNAE/Twb2fKnBQqdR6TXUlZ2g4KFkZoV01JpOgc4RAR rYr2XoaTW10D8p2tIFa0TUtnH8Nx8VUwnoNONT3e/nD7GZ+aKpfpdjZxhhLhw4eziLUrZs 1uCNQrzVPFDxkK4VvOHIVRP3VMh3YSE= Message-ID: Subject: Re: [PATCH v5 5/8] iio: core: Add new DMABUF interface infrastructure From: Paul Cercueil To: Christian =?ISO-8859-1?Q?K=F6nig?= , Jonathan Cameron 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, Nuno =?ISO-8859-1?Q?S=E1?= , Michael Hennerich Date: Mon, 29 Jan 2024 14:06:58 +0100 In-Reply-To: References: <20231219175009.65482-1-paul@crapouillou.net> <20231219175009.65482-6-paul@crapouillou.net> <20231221120624.7bcdc302@jic23-huawei> <20240127165044.22f1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dXEQDRKqNfJg8t0f5rfzp9ryxd1tCnbV+tG8VHQWiZXNqN7062DygSNXFUfQ0vZ3J2D4oAcIAEXTymRQ2+hr3Hf7I61KMHWeSkCvCG2decTYsHlw5Erix/jYWqVOtX0roOOLqWkqpQQJWtU+biWrAksmFmCp5fXIg1Nlg39v21xCXBGxJkxyTYuhdWyu1yDQ+LSIUAEQEAAYkBNgQYAQoAIBYhBNdHYd8OeCBwpMuVxnPua9InSr1BBQJdCoXBAhsMAAoJEHPua9InSr1B4wsH/Az767YCT0FSsMNt1jkkdLCBi7nY0GTW+PLP1a4zvVqFMo/vD6uz1ZflVTUAEvcTi3VHYZrlgjcxmcGu239oruqUS8Qy/xgZBp9KF0NTWQSl1iBfVbIU5VV1vHS6r77W5x0qXgfvAUWOH4gmN3MnF01SH2zMcLiaUGF+mcwl15rHbjnT3Nu2399aSE6cep86igfCAyFUOXjYEGlJy+c6UyT+DUylpjQg0nl8MlZ/7Whg2fAU9+FALIbQYQzGlT4c71SibR9T741jnegHhlmV4WXXUD6roFt54t0MSAFSVxzG8mLcSjR2cLUJ3NIPXixYUSEn3tQhfZj07xIIjWxAYZo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Christian, Le lundi 29 janvier 2024 =C3=A0 13:52 +0100, Christian K=C3=B6nig a =C3=A9c= rit=C2=A0: > 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. > > >=20 > > > 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. > > >=20 > > > 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.=C2=A0 Alternative is to circle back to this later after this code i= s > > upstream. >=20 > Separate patches for that please, the autocleanup feature is so new > that=20 > I'm not 100% convinced that everything works out smoothly from the > start. Separate patches is a given, did you mean outside this patchset? Because I can send a separate patchset that introduces scope-based management for dma_fence and dma_buf, but then it won't have users. Cheers, -Paul