From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) (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 B3333344052 for ; Thu, 4 Dec 2025 17:33:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764869641; cv=none; b=XCBNM+F1Mhdkln/oXDY9d0Bo3l2AfOTK457690PDOrkanr3sxkmVH6BDv+bYaS26B67FGo0jXO22/2kEeZYoGK9eXjcyOq819qWK0l6I6hXJoda+I6ixNY8wKm1F2h5QpNbcaNJynH25FIs4WK4ov1Anebor4yr/AX0SM9vMdfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764869641; c=relaxed/simple; bh=e7sfty3yRlUODBxJz+PpxClJYLIPv1iuD6tUC8QfWQk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=sO3VilfDAjfH7+onv5NtiwXem8wqMeLYEDplIOxd8KoQ1iSVhiQNvKxPAUj1/MSSNvKLkQTY3BbL07xaKVrEN/4VjACAQrmol+BeKFh7AuHTgOyOoC9YwTkcG+2osXa8Camc2YDbRuhWhjktx7S+seCbO/tOhBilggGuLpbs9ko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=T09prPBn; arc=none smtp.client-ip=209.85.222.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T09prPBn" Received: by mail-ua1-f52.google.com with SMTP id a1e0cc1a2514c-93720298f86so688738241.2 for ; Thu, 04 Dec 2025 09:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764869638; x=1765474438; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NOkTIDR+TWpIaxfl02NyThkY1v6gZKg13N/SLcRcC4c=; b=T09prPBnpn0epGRd7UL9ZYA6OpzC0Oo+XYZMQHhwDOEAuqgf5/whpU1MkG8BdhLf2R rXlExom24AITIMsbhJIDyKkLQw1Y+fYT4zPM9/dBYWIrrisvtoUe3qKFJJ9ScnR8oZ6C 61XxFHbmqGKQ9WxGYfi9pL71M85qADB5rQ7HflRgf7v/u3Dy2lHuipzlEf/DsbjOPgVt 7jAb158RN4zTQ2tl0rqyCVBgSCwrz0kYGjYsDkEG4QWnSPKto12CXQpAzR4HkzrYYVJI 3IL7vbgFFxMQb4uXtl4dhJ1tITzMqrbaA6PbTcVn9tSjIwg2Q281yQp+e1Fc7QNnKhTO q4+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764869638; x=1765474438; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NOkTIDR+TWpIaxfl02NyThkY1v6gZKg13N/SLcRcC4c=; b=dGgkq7hQQpasHuQtv/D5ToOksYAPOJyeRKn8YOU92b9T4K18qVo62z7ZDY8IhY+8rz s1yxDHaEI+8jS0ikbrtLa2tDo0SSYcww+i8vM9O8WCczdEsUokUqbmIPVdhbAM1mBhaw /P1rVev+NHVdUKnp0BHyNC0VyyuVLnik4SO/e+ITwiaqhMgzuw9LarkLjYRURdGOaoIH dPmzRydQVaHNVTKBeRuh/OX6x92hi7d2oaSBRCyBAnJk2QONerlouPfTZu9uC+MpM5k1 Yj9UzNNDzxsE5DhZMh/6XZJ4+VIdMGmFYm2trkxARIhLqbzK1vcIXzHNqKvt+6cyQqCB g8zA== X-Forwarded-Encrypted: i=1; AJvYcCUWAwl6ElY2i+UaGltXWB75aht3PE4DqTrXV1kZucNqzuDpcAhcLMgGtcmLttHuMvwW6mDcFVTRoI2QrUg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxg0s7a/IZec0M+HTBo/rYXNrIk9IcHiJkaV04DAo/ouQgJObTC SroOviHI3pIbsq4wi8Axq883bYaD3JwbBo5GiEeDX3O3kewKKsjoebAd X-Gm-Gg: ASbGncsae/L6P1Ix19Dv0zxpFmLCJz1XLhMtaZqxJJv6U3hUwrnRxsxqDKQq11N5yr8 9DiGmiS2pwhnVTp1yZxEt3c4Z5jbdGBegGai3SQMtMf7ogxOU4NNBnRlgn2xdPuP/Ks2Wm0cUbH dXiR1vC8NrX/WOVB7puxLMdbYTH02cKrrjnbXf4BK71o0cnwPbbMCT0BGDPwns6qPGtSXo9UT6P LTn+v3exUoLIrBvcwtzY8etTWJq5WrFXR1crh3cN4d0gi760N1+kL5eVrqEH0sEPiY1jWC7/8/q vfRe//y+DajFVPBGKw37jWBqt+csg8mwgupcJbPnuymmyYZlwIT3RfHN8T6vYo42xGCUxxsxIMj 4dnTriDSfh654877ejvkPzhHr2v50/Xp4MJTorSSs0ErTK7WAmN0RbmgVzixpaKqYOdjCx56Q/k PbX9gvgw== X-Google-Smtp-Source: AGHT+IGlqYuc0MrdtBQVsuewSDNftJnQO6IYdcPyj5E2cCkLcpeZ4pRP4rTMgDOr8UY0XIwiv6cDqg== X-Received: by 2002:a05:6102:5706:b0:5df:bd66:7b76 with SMTP id ada2fe7eead31-5e506882463mr1639471137.17.1764869638606; Thu, 04 Dec 2025 09:33:58 -0800 (PST) Received: from localhost ([2800:bf0:4580:3149:7d4:54b1:c444:6f2f]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-5e5107e7677sm955060137.6.2025.12.04.09.33.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Dec 2025 09:33:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 04 Dec 2025 12:33:56 -0500 Message-Id: Cc: "David Lechner" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" , "Guenter Roeck" , "Jonathan Cameron" , , , Subject: Re: [PATCH RFC 0/6] iio: core: Introduce cleanup.h support for mode locks From: "Kurt Borja" To: =?utf-8?q?Nuno_S=C3=A1?= , "Kurt Borja" , "Andy Shevchenko" , "Lars-Peter Clausen" , "Michael Hennerich" , "Jonathan Cameron" , "Benson Leung" , "Antoniu Miclaus" , "Gwendal Grignou" , "Shrikant Raskar" , "Per-Daniel Olsson" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20251203-lock-impr-v1-0-b4a1fd639423@gmail.com> <77ca77847511e67066a150096a7af2fb84f1f25f.camel@gmail.com> In-Reply-To: <77ca77847511e67066a150096a7af2fb84f1f25f.camel@gmail.com> On Thu Dec 4, 2025 at 9:36 AM -05, Nuno S=C3=A1 wrote: > On Wed, 2025-12-03 at 14:18 -0500, Kurt Borja wrote: >> Hi, >>=20 >> In a recent driver review discussion [1], Andy Shevchenko suggested we >> add cleanup.h support for the lock API: >>=20 >> iio_device_claim_{direct,buffer_mode}(). > > We already went this patch and then reverted it. I guess before we did no= t had > ACQUIRE() and ACQUIRE_ERR() but I'm not sure that makes it much better. L= ooking at the > last two patches on how we are handling the buffer mode stuff, I'm really= not convinced... > > Also, I have doubts sparse can keep up with the __cleanup stuff so I'm no= t sure the > annotations much make sense if we go down this path. Unless we want to us= e both=C2=A0 > approaches which is also questionable. I think if we add iio_device_claim() or whatever the final name may be, we can annotate that instead with acquires(&mlock) and maybe it could work? I will test that. > > - Nuno S=C3=A1 --=20 ~ Kurt