From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) (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 41A54247291 for ; Sat, 17 Jan 2026 19:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768678980; cv=none; b=ORep9HpJkf5LQKlZRbQZzeElZX9aN4bxEndNvg82d+txPz8mtxjyyANfGSsHlfZv3qJwSLDV5XMkRKuKsTBu2VKJMLj/zEwp2HIbUNV0m8G8BuY/qgk4rCFVB3yi+yNBVoLSFjzHkrRbgl6snCoYju8r+oYP63yOz8koJvRqeq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768678980; c=relaxed/simple; bh=kyADtZzJjqa9S3qeCD1Nc9zebIgMdiyTsz6JgRZYFxM=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=A2jFCXfGragxRf1MFCJbziNl7xqMGOz0T1DDeVGnYwrGb6jXxnQy9Kv1i9uQlBa+29YoLGm0NeAn7+hMagPe0FvW2vFiNf3S3f6ueapVqWnZ73QWH5v5LjJYJyky/yV88IZlhCgukSjfrlXVtt6oBpNsv/hB9Wr280qmSnq/MBY= 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=U/gI5qRL; arc=none smtp.client-ip=209.85.221.178 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="U/gI5qRL" Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-5636470c344so2303274e0c.2 for ; Sat, 17 Jan 2026 11:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768678978; x=1769283778; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jX+S0Sb3/TORvv49jMJHt7cR5imR7FosT/IXWBB8ZKA=; b=U/gI5qRLoIly0KT63JIlGIm+3DHlg4T+W/E0uiPXkgDD1oz6s3i+dpVigR/poR5Itr CW78Jo3Hsg0BW74k+rhtAG4acQqzOlY4oJhwkvwWDND4JMULqP779pSYf7XYRZgJCh/Q Nv1iIpZFzIRVdVWwjWq8dx/AlzgTL4FfV+7Mzd935hSdH7KG0Pouq1FEdxkDTT4Q+2G0 KBK6XWrfOFF6N1NvBAyutfzWljyuVnY7HXBCqNNcg/WYveHlDApOqd7W8AWWheyJOB2r OQVKEc3S/BWjSKlaogVytsYHOF6+JChjB2z6sTkSxMlstFO5BcmLEUbQXNdTKW+GyGIL esaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768678978; x=1769283778; h=in-reply-to:references:cc:to:from:subject: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=jX+S0Sb3/TORvv49jMJHt7cR5imR7FosT/IXWBB8ZKA=; b=dHsU1UOtTQhhoPkcIzra1q17AmeNpuRJ4sjqn4MiBNkxkhc/1MO5vZjAy8OiprKO6y CKxgKgB4AiDPgfqXs/g+AKpE9Qjw/+dcaXiI5h4ZklQuA0KDb1ykx3IBCMad/QbMRrA6 dxhIExiEZdSdMJV6b1j9APemWymrPB+FmGRdjQP/JymDisu+sCe8vwlA0lV8h+tQGP2S 6DPlzXdtxIOCS33ZoRPAHyC9VEUo2646iqClrafuz0MMLEdBI1vFYUi0d5pB6wBaQrHr 1ipKhW1YjDUeVYMQnW6bjfXc76teOT2Z4PkVy1Cd/rhkmt0tMmjcTjqOkVRLqDmoM6d2 VISQ== X-Forwarded-Encrypted: i=1; AJvYcCUWkOOQaNyuAw0O/mKT58FXDmg6QihI0oxrYr6AzcbCZ2KNyRqamT76i6YnnznnnIEVWezsa/NLvRVycms=@vger.kernel.org X-Gm-Message-State: AOJu0YzuTTzOhwT9UidlfPqh8TelC2Tu0jTYWzfIzHrZQn5PDE6r8cLl Gk3poYfHshR0I/JpcketCEY7sIRHkFY0MJkeYv8SPKvB2BivrS7T1mIB X-Gm-Gg: AY/fxX4FsffWXxMJZqpDIS3yVkMyHpmWtcKINoAI3WQrGsFe0pY7jCN/V95a5gOez3y 0BcpI99XX3SYI+BNJrdoccK3ESUdn3FTvVKUY0ryWWHc7ZPS6MFJG2mfBHOLIsxqNyNDaosOAii rOY8FWXKVza3N8jvV02Vs9enyLdUatCCMn3hPmUxRL4BcQFj9PolysJSYrFX0YlLxe2HaD5SyM2 +IthZTuKaeVMaz9PxkVla9qIb+JL55HNT/S/09ovfcqc4jCmNRl68y8Y+Ld9X59lLB00vynsjvr dpiWevdNa3KMiM2s2VuaYY6UbLtcHCFm3C7PP6baVk/2xum947k3bRxnufHPyy5klub02x5q3rv nHOP3MT/IeOBqAeijMxvT6wkQ1N5UQGUXxvINhj60hkm2bGR6+QkYuA5iFM+RUR6yRxeyBnwNl3 ldkw== X-Received: by 2002:a05:6122:1791:b0:557:ddc4:dea4 with SMTP id 71dfb90a1353d-563b5b8cfaamr2316062e0c.5.1768678978135; Sat, 17 Jan 2026 11:42:58 -0800 (PST) Received: from localhost ([2800:bf0:82:11a2:7ac4:1f2:947b:2b6]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-563b71226a0sm1568589e0c.20.2026.01.17.11.42.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Jan 2026 11:42:57 -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: Sat, 17 Jan 2026 14:42:54 -0500 Message-Id: Subject: Re: [PATCH v3 0/7] iio: core: Introduce cleanup.h support for mode locks From: "Kurt Borja" To: "Jonathan Cameron" , "Kurt Borja" Cc: "Andy Shevchenko" , "Lars-Peter Clausen" , "Michael Hennerich" , "Benson Leung" , "Antoniu Miclaus" , "Gwendal Grignou" , "Shrikant Raskar" , "Per-Daniel Olsson" , "David Lechner" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" , "Guenter Roeck" , "Jonathan Cameron" , , , X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260106-lock-impr-v3-0-1db909b192c0@gmail.com> <20260116203353.59a2a00e@jic23-huawei> In-Reply-To: <20260116203353.59a2a00e@jic23-huawei> On Fri Jan 16, 2026 at 3:33 PM -05, Jonathan Cameron wrote: > On Tue, 06 Jan 2026 03:06:55 -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}(). >>=20 >> Which would allow some nice code simplification in many places. Some >> examples are given as patches, but the last two are the biggest >> differences. >>=20 >> In this version I dropped the RFC tag, as the general feeling is to go >> through with this after some modifications. Main one is the addition of >> IIO_DEV_ACQUIRE_{BUFFER,CLAIM}_MODE() wrappers to avoid drivers using >> the guard classes directly. I also added comments on the forbidden ways >> to use this API but I definitely still take suggestions on this. >>=20 >> For now I dropped iio_device_claim_buffer_mode() rename, as this point >> is still being discussed. My suggestion based on the RFC discussion is >> to do it, but in a separate patch (using coccinelle) and while we're at >> it rename the whole API like this: >>=20 >> iio_dev_mode_lock() >> iio_dev_mode_direct_trylock() >> iio_dev_mode_buffer_trylock() >> iio_dev_mode_unlock() > > I'm not a huge fan of flag days though this is entirely in direct mode > so I can just do it at the start of a cycle. > > Anyhow, that's a job for another day where we can bikeshed the naming > yet again. > > I do like unifying the unlock though. I can send the patch, gather some feedback and then send a rebased v2 at the start of the next cycle (or whenever seems best). Should be pretty trivial, after I learn a bit about semantic patches ( famous last words? :) ). If you feel up to it, I'm up to it. > > Patch 5 never made the list for some reason. > https://lore.kernel.org/all/20260106-lock-impr-v3-0-1db909b192c0@gmail.co= m/#r > > (I thought I'd accidentally deleted it!) Yep, it seems it never reached. I'll make sure it does this time. > > Thanks > > Jonathan > > --=20 Thanks, ~ Kurt