From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 9C08C2FE05B for ; Fri, 16 Jan 2026 21:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768600276; cv=none; b=Qcf6zK/ahtcqr8IZy2ZghR2xdz4QtJTdJcqXbEdo/I0ZgnVBsOZiq0hStIfw7tUp9dp55cCUHT5a33JVogSRNlCNtMZ4lO3RrFqTYiuCYvvd8CjV6QtvnA55ECBLlEw17EFmMUS8OmM3+8ZicRtchgbmf1LV/gM2WSLsXTmb1us= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768600276; c=relaxed/simple; bh=1ap1WGmCdUAfeAfA1Uj3FhkOVQp+SG6/lAV/o2C7jtw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KsrgBm9d2W1HeV7d4JaSs6DD6jObTQ9z/6RSJksYUBuiZcQzCX9sXYLQv1O0X0pyukCOuSCJJbGP7mREaF3Vwt1vuzAEAfJAdsjhK5llXXn79UCihngszr7+tshw6K+KBnr9EHLzDoDUfUi4CBlepiujs9booFc0hNZinTqBBkM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=a3HWh6n5; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="a3HWh6n5" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-45c889aba0dso1434049b6e.0 for ; Fri, 16 Jan 2026 13:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1768600273; x=1769205073; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=l3940XG5D9uHiDmu72L1oryEY4P2+ezhQJ90ZGR7dK0=; b=a3HWh6n5lJ8WJtM7keaTj+Jr7sSuHgUYapA4RMOxcD4ekfDsZTefM3YgOQbDox/+AV pJZk0cGIOo4SGoqoN3erRDwUdFbPIk3q49n+wO58vL2oUgyoD0v8fZHkuWQRq+yEnU+b mlwfKo9n4NU+zBkliF6XbS9cilh3jfW9Gb60JAztoutzC6Py1rz8haPW1yvDaCXox6D6 3VPT9uYTw0g29rPVJgK0lLfBenhxS+Cnpo2gejS0ONFjBXlRictVyjbtffQPqBP9JRyt lSV/Y0Nq3zymOpSrSsuuaOcTiQe3CDd8KRTET7W6dYE+/w31+yHwz+PFwIvh4pW05/hr LeRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768600273; x=1769205073; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l3940XG5D9uHiDmu72L1oryEY4P2+ezhQJ90ZGR7dK0=; b=U1i/SHveDuPTOKZQJXzr3p3ITNYGgrTp/AkmzJLmtA3lA1xBiLy0NcZdskQd8FHRZb QPsmOg+ndwdRnOEdzA1/JdFmvNajnoJViZ4gY9Ju9ZNpK6f5kg6boPHZPZZtRGSqBGeZ TWk9S2UXoHkpoE9qPmPQkHSmoiwvJb/1gvBZoLbNENOitgEGWf0P45DXfo58JMPLvF7g Fo3MkLGacMclyEzBpdYHrnqHb0q0gDgOG6jBIXV5B0A6NZHtOX0TSP2yuy0t4VSm9T0N YVhmF1hvaYfeztyhtAWBLc1jkcDW/d+a3f5RmbkjU1YgOxiYBL4QwjaDFreGgFzJpsWH svLg== X-Forwarded-Encrypted: i=1; AJvYcCX1WB0jnwb09Q0GCGdfM5ohHfgy8YYF7yBLq+K+amBFwDp3strOZ9bQDLHQTiE2Gaxm7S3Lil6E3w/2MhM=@vger.kernel.org X-Gm-Message-State: AOJu0YyW3qqE93IoA75+kZRwgdT1k+yuJLExHTFYh8nVOM9D013Sa8js GBQMAssonTwgQeCa6M/16Npffmj27N7SMwAgyXfs3DJrDNT8UTFAic0wp1Dc8NlkIBA= X-Gm-Gg: AY/fxX6UKqN44KeMb41PhvnuKyLcYbh/21ZylBKrYvoXh96iSCR83r4J8bLZ2cLYRLT k/Yea32v479YLViScu8YmIA94aVMZG6tt6XyE/JYLV4dc8rZtwEP+2B8rK9Ea7ITWSNwKjMDJb3 IDtoq5uNMK/3HQzz7623T/O2JfpE37Lf3JEoEkeqSzV+UajvKbvG8KG+SaJucCKpOFRHiY/6ApC kxg0Q8FrCYc+peyhVz2j4mfItz4hDQotuBZ/aqgweL+yg5iASJYTmXS5LOVWO6T3gM44XrkK4/c 88fzWptZ7Ou4UIVkD/H7pbiv1/pJTji4twAOieP43kJyumcd07L+3IUMI5mC924mYQXrb+xDSN+ BgoSwF+mVb9YzRUn2NW3wA0piGImhyb4KYXLmAlpv5CHZ3sRIZqTX/BcV7MbE2NSCToQakPw9rz KWv74TCtc4ITQ51er9FTGkhq0KTNdEREHZucuZfrmXHOsC0HYugpXWY+ZVfjQD X-Received: by 2002:a05:6808:1903:b0:45a:58af:fed6 with SMTP id 5614622812f47-45c880fed55mr4136737b6e.17.1768600273578; Fri, 16 Jan 2026 13:51:13 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:bd39:740e:f70f:5f7d? ([2600:8803:e7e4:500:bd39:740e:f70f:5f7d]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45c9dbcdcd3sm2008795b6e.0.2026.01.16.13.51.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Jan 2026 13:51:13 -0800 (PST) Message-ID: <5a953bf8-857e-4c67-be43-d60cc9b5a34c@baylibre.com> Date: Fri, 16 Jan 2026 15:51:12 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/7] iio: core: Refactor iio_device_claim_direct() implementation To: Kurt Borja , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Benson Leung , Antoniu Miclaus , Gwendal Grignou , Shrikant Raskar , Per-Daniel Olsson Cc: =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Guenter Roeck , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev References: <20260106-lock-impr-v3-0-1db909b192c0@gmail.com> <20260106-lock-impr-v3-2-1db909b192c0@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <20260106-lock-impr-v3-2-1db909b192c0@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/6/26 2:06 AM, Kurt Borja wrote: > In order to eventually unify the locking API, implement > iio_device_claim_direct() fully inline, with the use of > __iio_dev_mode_lock(), which takes care of sparse annotations. > > Signed-off-by: Kurt Borja > --- ... > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h > index aecda887d833..3cf340208694 100644 > --- a/include/linux/iio/iio.h > +++ b/include/linux/iio/iio.h > @@ -664,31 +664,47 @@ int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); > > void __iio_dev_mode_lock(struct iio_dev *indio_dev) __acquires(indio_dev); > void __iio_dev_mode_unlock(struct iio_dev *indio_dev) __releases(indio_dev); > -bool __iio_device_claim_direct(struct iio_dev *indio_dev); > -void __iio_device_release_direct(struct iio_dev *indio_dev); > > /* > * Helper functions that allow claim and release of direct mode > * in a fashion that doesn't generate many false positives from sparse. > * Note this must remain static inline in the header so that sparse > - * can see the __acquire() marking. Revisit when sparse supports > - * __cond_acquires() > + * can see the __acquires() and __releases() markings. > + */ > + nit: I think "attributes" would be more technically correct than "markings" (since we are touching this).