From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (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 457B93AE71E for ; Tue, 14 Apr 2026 13:29:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776173373; cv=none; b=jKalwbmbQe5B2m6mJeWVX/nWQqg8O8XzoMKWcPUc8WmkhostwhSZG4WfjmOGIlRYv8Trchtp9TAxWuN58CdVQcq0mOZj3QtDsdJ9xZe5HNhkC/HirXtTcWTKzAjWyeRpEXZVpjQLfa5QiXquvnyrBgRBkxKpxPfgSxVWN7UMfy0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776173373; c=relaxed/simple; bh=k/zOuY30RNZr0YbjvGcrxGgRUgTIN7ZoknxfX5JPDqI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XAVZMci8OfWmg5YipxE6PeBnLcvQc7f/96xlzrjJQHebaWPqKGYfOUKrg3UjhcQq4BWJXq+vI0D1SWPlZ5DZkqgSoTFWtBdL2PlQQVsB4tzZYHRrpyHFvSOHVO5/15gsmUrbXCnw02LEU1ufCXl8ALfaib4LeJXSGLBgykaYJ6o= 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.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b=ako3t7ey; arc=none smtp.client-ip=209.85.161.46 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.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b="ako3t7ey" Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-68207984e66so3082939eaf.2 for ; Tue, 14 Apr 2026 06:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1776173371; x=1776778171; 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=buTfI+KLeDeg8uKm1bRoRg/Dor/qBDBfQYYxVgfbj80=; b=ako3t7eykb7nWHR1drxfB1+oWz5O4exDrK/55H2xpnEG7lzBW1g0l/47HZOU4MzprQ 2rz2gzqQ4+WxsTs/JeOhHnsn2N8afKzUPS1N74dDOzEmdQTpgg5w5e/hbrU+YFt0u7p4 ftcIxFHBaWnZcS4xRa0OsMwlgj2xFubAVQrF9B82RpcY6fCVviidMXB2OwbQL1k2+2CA b2HdEMgwQn+h3OEVeC7RiF1C6QJpnE8AMfOUGtdrE6XQYs9Y+mCxbcJunX+M55fMTjTL /Td0cywUsmBoHKhBiUNynk3ExwOG0vS/2roRj2mSyeZq72ux2MXkejs1heLQAQ4r/eNq i8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776173371; x=1776778171; 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=buTfI+KLeDeg8uKm1bRoRg/Dor/qBDBfQYYxVgfbj80=; b=LBGteIGHSML2Yn4zIvkBI699klfaFMlddtzSo+XVwEtBQV3a5BDwBn8LidntV4B2fi ZZnnub+9B7Z9KcWrjGE8CJ5U6owFk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a8ff with SMTP id 006d021491bc7-68be5c5f183mr9275886eaf.12.1776173371135; Tue, 14 Apr 2026 06:29:31 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:5bfd:a817:5527:c417? ([2600:8803:e7e4:500:5bfd:a817:5527:c417]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-68bcacc9931sm7466199eaf.11.2026.04.14.06.29.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2026 06:29:30 -0700 (PDT) Message-ID: Date: Tue, 14 Apr 2026 08:29:29 -0500 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] iio: adc: ti-ads7950: use spi_optimize_message() To: Andy Shevchenko Cc: Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260411-iio-adc-ti-ads7950-spi-optimize-msg-v1-1-617766ef2e38@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/14/26 4:54 AM, Andy Shevchenko wrote: > On Sat, Apr 11, 2026 at 05:13:33PM -0500, David Lechner wrote: >> Use spi_optimize_message() to reduce CPU usage during buffered reads. >> >> On hardware with support for SPI_CS_WORD, this reduced the CPU usage >> of the threaded interrupt by about 5%. On hardware without support, this >> should reduce CPU usage even more since it won't have to split the SPI >> transfers each time the interrupt handler is called. >> >> The update_scan_mode callback hand to be moved to the buffer preenable s/hand/had/ >> callback since the SPI transfer mode can't be changed after >> spi_optimize_message() has been called. (The buffer postenable callback >> can't be used because it happens after the trigger is enabled, so the >> SPI message needs to be optimized before that.) >> >> The indent of ti_ads7950_read_raw is changed since there is no longer >> anything else in the struct to align with since we removed >> ti_ads7950_update_scan_mode. > > Some of the func() are mentioned w/o parentheses and I got lost which one is > which. Also callbacks usually mentioned as .callback() (with a leading dot). I didn't put () in the last paragraph because I was talking about the function pointer, not the function. I guess I missed update_scan_mode() though. > > The second paragraph doesn't tell me clearly if there is a behaviour change > from user perspective. > It is not clear that the difference the user can notice is that there are some CPU cycles freed up for other tasks?