From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) (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 950BB2405E7 for ; Mon, 1 Dec 2025 19:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764618427; cv=none; b=S458zzEIuJqUL0iPK/qx7Wz5HS1kEZZ98v1+QIwOrv0GK3OIXf6UgqWYDvBamLgAUh4Y+dDQau+97QzKFW05jN16JsNUi2/dpjo4Ue1+yetknc08kwnsijN+iqvybw0OIO8UMRciSKseO2eg2POKD+It53DkZxoqqMZi8h9DylA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764618427; c=relaxed/simple; bh=AkmPPwDEDqiDGbDd/c/qytly3OUEnrFljT7GLyvENCE=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=qKL6VKA6leNA2TW2Zqa5E1F3ysCsWZNQXFlAyGEhC0Qy0oLpf4nBqqjJldO/t+rmcwz5pWPjGiCSS0f7b5SOj2z0Nn1Jnf1JUnKzGwFDXBHy2wwSXxwbIEF/+ZtIw/VuakTAQQP/v3hWy0cMOuGWmUzyLCPUxOEmy6r1erJPNMA= 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=ej0KO8hP; arc=none smtp.client-ip=209.85.221.182 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="ej0KO8hP" Received: by mail-vk1-f182.google.com with SMTP id 71dfb90a1353d-55b6a642a4cso3041660e0c.3 for ; Mon, 01 Dec 2025 11:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764618423; x=1765223223; 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=Z2SwU7brTcuWQXz23QqjJKK8SJFGO+KNOCJ1yJZD+6A=; b=ej0KO8hPtkTqRH+ysDp7+saoFGDALE36QnooY0N8DaVCWO2u8adcPG7tfRGDrc6uwh ZX54wCvdEleBVE3y55E7edpG/AIP1+6rpwLwSb59Z+pJgQEKzoZo45+jlh+WXZJh+O1l IfpEPIegPQ4vzVd4/Obpy6QF7cyZAREui0FrZYjcaEXmd6lom71sMEZ7q9MRx8NYuhEE JoJnRCDcqUDCFrScaOGOimiF4CAs3Rfp7Dvx5b5x8XPuAb4N3FhN3ICQCNvjC2MTVZ+A 9V+9kWRsxxxxGOLO6ZmyBky/OravGaNd0GrgZGAJCGPjgnthCo6ddQNKrFI8b78nnUL3 Sv6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764618423; x=1765223223; 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=Z2SwU7brTcuWQXz23QqjJKK8SJFGO+KNOCJ1yJZD+6A=; b=SIvFCHuWMyB3VRARCnm8sgaOLT5PYvnV1NmQ9uPqjpmgVw2TYRwex6aX49rQ7o+IPI NqA4rC0OSn96CmMsppHr5DWvn1g8tRU+mT2c+tCyPbs6ZnE0Gt0NZ+JzvgBuHjcJ7g4R v4ZDjIxLN4txhaJsNf68ZSRI3362UGnRcwIZOhb3DbTh6T3IoqSbTBsKw+wXpmmBpOBJ qmRjGiNxQbINGwT3vY3x/HKYr4S1qTOAMOAVuNh0b3vHYbvGNSJM2iepsI/RJIWSz1Wv TkWFoEmVHoomEKtPTtal+KXsxEoyzD4cmNajXtRcgwulaQ1GbtBuAHUboBi7yZH1KvNT u+EQ== X-Forwarded-Encrypted: i=1; AJvYcCXqDKyn3PNgB7jzPVZzcmYjRF5xrwvrOQLLFtYvlatzg9zevM4wpJLR2RQK9UtYilC4WCL1zQi3ALmVR3k=@vger.kernel.org X-Gm-Message-State: AOJu0YykmBaNwkAiw/t0/KMbm1vjxqslyb+o/4jmrP9p01qNUSzQurYF brjg38OU4NisLUoY7FbtvHdt31ylASgeVbSrhRKgorNQsq0kAbe4aHyD X-Gm-Gg: ASbGncsbBR4q59S9O1QXmrkrsRzdsQ5gFgbo0GuOONHbkNF9LNesWsq4EGb2B4MJQ6B 7M2IsCB6Eic2Q9r7kWcyxR2UTlzYZhtbPbDTondIfnymm8pOEZcuG21ytnt1TJWvmbJwJmqeGPH nCEOjdnjFTvi5Yyfl4gkzAvXUg18GmItgVt9gp4+a0XlGcQvF9h5nbrjc+jX+ANuxETg83oW+hH KRZcz0T0ivsC3CDLgfz7dkkwahf/c/+2PJRX6Av0AGRR0TRCIXjJdk7yfjsWfaQbsiREMLq4Zw8 +bhngh9e3IJYIVgIubEIwbgAqUFtk4G/jLy3nQ/87Aozdq9PubJFYfGzfckXVCYKw/Ocu5/95/E x9420oooCpTCmUU39N622x6btzL/1adk6MJv5Yqr1yIlQ0uXbOCWtRwgZSboVsdlhnygZy85QX1 GOROAGYOKBqR0OlPXO X-Google-Smtp-Source: AGHT+IFtbwHx7ggOA0nfUhQeEEf9VEJmcC81IM6QKOuFmoRpxOaWAK4K1w+iiLeaHDL2epZXSr5uUw== X-Received: by 2002:a05:6122:1796:b0:557:ddc4:dea4 with SMTP id 71dfb90a1353d-55cd764c2d1mr10337077e0c.5.1764618423379; Mon, 01 Dec 2025 11:47:03 -0800 (PST) Received: from localhost ([2800:bf0:4580:3149:7d4:54b1:c444:6f2f]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-55cf5186d0csm5633068e0c.20.2025.12.01.11.47.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Dec 2025 11:47:02 -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: Mon, 01 Dec 2025 14:47:01 -0500 Message-Id: Cc: "Jonathan Cameron" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Tobias Sperling" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" , , , , "Jonathan Cameron" Subject: Re: [PATCH v3 2/2] iio: adc: Add ti-ads1018 driver From: "Kurt Borja" To: "David Lechner" , "Kurt Borja" , "Andy Shevchenko" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20251128-ads1x18-v3-0-a6ebab815b2d@gmail.com> <20251128-ads1x18-v3-2-a6ebab815b2d@gmail.com> <18fbf486-c1cc-4cd2-af12-ffa093fa9ce7@baylibre.com> In-Reply-To: <18fbf486-c1cc-4cd2-af12-ffa093fa9ce7@baylibre.com> On Mon Dec 1, 2025 at 11:07 AM -05, David Lechner wrote: ... >>>> + if (iio_device_claim_buffer_mode(indio_dev)) >>>> + goto out_notify_done; >>>> + >>>> + if (iio_trigger_using_own(indio_dev)) { >>>> + disable_irq(ads1018->drdy_irq); >>>> + ret =3D ads1018_read_unlocked(ads1018, &scan.conv, true); >>>> + enable_irq(ads1018->drdy_irq); >>>> + } else { >>>> + ret =3D spi_read(ads1018->spi, ads1018->rx_buf, sizeof(ads1018->rx_= buf)); >>>> + scan.conv =3D ads1018->rx_buf[0]; >>>> + } >>>> + >>>> + iio_device_release_buffer_mode(indio_dev); >>>> + >>>> + if (ret) >>>> + goto out_notify_done; >>>> + >>>> + iio_push_to_buffers_with_ts(indio_dev, &scan, sizeof(scan), pf->time= stamp); >>>> + >>>> +out_notify_done: >>>> + iio_trigger_notify_done(ads1018->indio_trig); >>> >>> Jonathan et al., maybe we need an ACQUIRE() class for this? It will sol= ve >>> the conditional scoped guard case, no? > > No, ACQUIRE() is not scoped, just conditional. I don't think it > will improve anything here. Maybe I'm not understanding the problem fully? I interpreted "ACQUIRE() class" as a general GUARD class, i.e. =09 guard(iio_trigger_notify)(indio_dev->trig); This way drivers may use other cleanup.h helpers cleaner, because of the goto problem? I do think it's a good idea, like a `defer` keyword. But it is a bit unorthodox using guard for non locks. --=20 ~ Kurt