From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (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 6237727A47F for ; Sat, 17 Jan 2026 19:33:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768678392; cv=none; b=jHrCNoMieOk1yuKNML2HYPeNOAQ+2enwSxQZJkU+100PzFzTxXcvrBpZpPCb14J4Znbjy3mZS66kPCdHpVPXQuRMn7Fr13mPnTvt9KHFuC3dmIh07HucoXvQ0HaajClRWdeRLaUSWZ9H2k0rMU0G946ZgBR6+GVxvQkEZ93eTqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768678392; c=relaxed/simple; bh=XA5Os3nG8Cu1wG7aVk4y/cruV4b/sDP00pOQjMtqfwU=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=XAHNhWU1pILHSi8bGpOxhoURV62MAcCP5dbbDkOKq8LVQfh3fbDlKi0hL79nmglrYnVA5Y6H9QJ23Hh3YtFRjGRUCzvWjYCQezWScG02NYjzho7O1Vrc5d2tjxnSp1X+eqwWB5Ffg53gQu+J25eAFRnSv0t2hXcUI/P5JU4xtUI= 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=VD2eTcBb; arc=none smtp.client-ip=209.85.222.41 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="VD2eTcBb" Received: by mail-ua1-f41.google.com with SMTP id a1e0cc1a2514c-93f56a97064so946776241.1 for ; Sat, 17 Jan 2026 11:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768678388; x=1769283188; darn=lists.linux.dev; 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=B/QjNU03Un5xr+pOfz4kD/Wx3TW7UJG3zU+9aNTvu14=; b=VD2eTcBb7iIr3km/7JmJmLE8Vv3na1jVF1j3Sj4gLmMkESThlVCP828VgPvrQX+MoP NPHF+SEJIi29Tfp450hwz56UZzw4plZGdhunGN+N2eUZzukTWiimyQqIZQXtVfo4ghF9 VheSho1x8kRGkZZGQ8dCtdcYqF51rN1m7mspx5MTZfwaDvCAjZj257niCcMHGdXbhjVi R7Y0a8nRN8mCJuHu/OquxN23ITsxirfpcbHzrseQylV5eggD+Udm2Eb9X0luVCDms8O9 MJnRDCoPeicjmYTyNCc/kTafxOtxFzDfDoRRRx8ctMAL4nx5B6oFXXiKeHRIZ7DoEuy2 OUFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768678388; x=1769283188; 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=B/QjNU03Un5xr+pOfz4kD/Wx3TW7UJG3zU+9aNTvu14=; b=UyOJSDPWFlSDh8olcl2TIRXy/P5jyFMQCPcJ+OpIlzq+FtXS7lY6GrZ+GqHWohxZso bv6n0oay9GeIMKc1pDf8RGY8gnFK1+azSJNxI8J2szMz/Djy3DOp8WFNMsnayh8nr4OE y4ZCiYHQvkch5kSxhODEeSAoFvdyd9N+gZoe10TDvu0PG0lLyUD8KxGv01Y1O6wOSIbB r/vKO3YVWmegozzBjN3sEarR1yG6ZBljTVUZ2c9OpZKLmpWY6s2ZlaATbkjaJmmHZXaF SCflxg+xKBBBfUbgAzxXu3v3Fm4M6N6NthWsYcvU+yaW2HknfdjiWhRCMenop81UgTTF 6rBQ== X-Forwarded-Encrypted: i=1; AJvYcCXMo8WH/MY7UD4luI0fsGCqAvez2gBEpburpQBmu7s5TlEYfxiWqZagi/p+24hxOV5+iG98LrHWRL+F85tsBn8=@lists.linux.dev X-Gm-Message-State: AOJu0YxDE7WoE2OWZqWCNDcL9VXArhk0laaijwOkuJ3Q2Be2DLr9GMqO aIba6QsA0LxVevO2wFJu+V2GJ83cTA6NwFz4VrGcQnNmcDJOznBLizRL X-Gm-Gg: AY/fxX7btmzZk7CokYhOrtcVwYM3x+QWvD4P2o9xOGBCUFD3j2oIZ8ar6i3xNPv74jG N4jV+nMsl5oB8zNfQr8ZcJoH14WHwy5Wd21sZgkZSUygOCRjspKtAGd3xfaOLk8Do1XeWHW0L0l umT1x5uba0r0zCPws9V81Mdlw8tEAxpUF7b6yzA2mxRGFNcyUYoVMMpwDAb+ZTNAzzhJwYu29X6 I8/CzVX4xAh8o8beou1NvznjQ5XCuPgtUkJwKrmB15WGigC+P9ufU8EwAy49KqsDbMagzUozuIJ IaqWn/HOVPglhK2rNi27sKROgUuUVHTrcrbRwTykxaMQ6P9O9E7uQyNbwHPZpwqX16U5eSDqqA5 aTEEP+7jBfyaRr5jugxJrohXA2GD05xqTcg5t+fHd/NLuADth4RhcES6cHAfqcq9QNAfWx8mkRB Xqvw== X-Received: by 2002:a05:6122:3d48:b0:55b:74ac:72cf with SMTP id 71dfb90a1353d-563b738c487mr1679358e0c.17.1768678388225; Sat, 17 Jan 2026 11:33:08 -0800 (PST) Received: from localhost ([2800:bf0:82:11a2:7ac4:1f2:947b:2b6]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-563b7123621sm1573049e0c.22.2026.01.17.11.33.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Jan 2026 11:33:07 -0800 (PST) Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev 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:32:59 -0500 Message-Id: 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" , , , Subject: Re: [PATCH v3 1/7] iio: core: Add and export __iio_dev_mode_lock() From: "Kurt Borja" To: "Jonathan Cameron" , "Kurt Borja" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260106-lock-impr-v3-0-1db909b192c0@gmail.com> <20260106-lock-impr-v3-1-1db909b192c0@gmail.com> <20260116201847.3560a2e2@jic23-huawei> In-Reply-To: <20260116201847.3560a2e2@jic23-huawei> On Fri Jan 16, 2026 at 3:18 PM -05, Jonathan Cameron wrote: > On Tue, 06 Jan 2026 03:06:56 -0500 > Kurt Borja wrote: > >> Add unconditional wrappers around the internal IIO mode lock. >>=20 >> As mentioned in the documentation, this is not meant to be used by >> drivers, instead this will aid in the eventual addition of cleanup >> classes around conditional locks. >>=20 >> Signed-off-by: Kurt Borja > Hi Kurt, > > I'm being a bit conservative in looking to apply this so apologies > if it seems like I'm ignoring you! I wanted to give plenty of time > for others to take a look. Hi Jonathan, Oh -- don't worry. It's understandable for API changes. Thanks for clarifying! > > A few comments, but if we go with this version I'll tweak the > punctuation if I remember whilst applying. I will fix the ones you mentioned here. Apologies if there is more. ... >> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h >> index 872ebdf0dd77..aecda887d833 100644 >> --- a/include/linux/iio/iio.h >> +++ b/include/linux/iio/iio.h >> @@ -661,6 +661,9 @@ void iio_device_unregister(struct iio_dev *indio_dev= ); >> int __devm_iio_device_register(struct device *dev, struct iio_dev *indi= o_dev, >> struct module *this_mod); >> int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestam= p); >> + >> +void __iio_dev_mode_lock(struct iio_dev *indio_dev) __acquires(indio_de= v); >> +void __iio_dev_mode_unlock(struct iio_dev *indio_dev) __releases(indio_= dev); > This is an interesting notation choice as there are several locks embedde= d > in iio_devs but I think it is the only one we want to expose so fair enou= gh > if we don't see any false warnings from this! The previous implementation also used __acquire(indio_dev) and I do believe is the best choice, for the reasons you mentioned. Also the mlock is inside iio_dev_opaque and we don't have access to that in iio.h. > > Jonathan > >> bool __iio_device_claim_direct(struct iio_dev *indio_dev); >> void __iio_device_release_direct(struct iio_dev *indio_dev); >> =20 >>=20 --=20 Thanks, ~ Kurt