Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2117282lqo; Mon, 13 May 2024 08:19:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQpH0fJXNNaGYFGbb35q2wk4n5EvN+eKENyoPEvWoJT35j4VsYDqnL9vd8WBUjyVVL/ui6kqaoJwP5kfe/4c1RszbthtqHEUrR4rPJXA== X-Google-Smtp-Source: AGHT+IFGmPvZMnm6qFzYJiadogVv5QoQBfZCmXJDve5cxDiRRNgSbqHo4bf91vHhEkhFa+UUn+8E X-Received: by 2002:a05:6a21:99a1:b0:1af:a53b:89e with SMTP id adf61e73a8af0-1afde07ce1amr10249765637.10.1715613539767; Mon, 13 May 2024 08:18:59 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63401ee5dbesi9323920a12.0.2024.05.13.08.18.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177739-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=Vg2uyfnY; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-177739-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177739-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1D9BAB231B2 for ; Mon, 13 May 2024 15:16:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED20D57330; Mon, 13 May 2024 15:16:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="Vg2uyfnY" Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 24C2A1DFFD for ; Mon, 13 May 2024 15:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715613369; cv=none; b=Moi61UcVIimVY7yARxsAwb3WoYETQV1q2YEmPxwCy2u4Pt/Jp++KUJNkQOMFr+yBvC7AxQzMFzTLIg3mR8BcCUiR5P4Rd3Ixbb5I2jXMHTC9xlL/nPu2LiUJ4hKat6/csUfxfjkIxk28ALOc5L7mIpPTeXN6WSGK2kignAKyRwU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715613369; c=relaxed/simple; bh=/v6zZK8vC1iWKChJg5ELITID+E0oYkoNv1bfMOqpejI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=VZ6R0Ai7TIGYCXXehhohQ0N0VDKgdUONZc7HwgaNZGE23k/S7fMRKYwelbty04Jd5K+QQdbp4pvH8oFzjhwae5YHbq1Oxd2FwzHiH1937EBKbPRDYN5mWsthrspY8+/3MIw1G3V4umckCspJjm3VMw1sL5X2V4XsjZ3KvyCrloQ= 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=Vg2uyfnY; arc=none smtp.client-ip=209.85.208.173 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 Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2e52181c228so33926931fa.0 for ; Mon, 13 May 2024 08:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1715613365; x=1716218165; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uXHSyWB6fJ4bI4UOzHNSJAK2n7Pmu648dfIJZfg2RtE=; b=Vg2uyfnYQWnV59dji9In+wfBSNsCejh0Z+Dw96/imVYb6ssAlSuNPPuEnqJJpmzOcj PldL5hSFA749LMtYihYpsZsiF0SImByQCLesVZAdDZPnz/qKgWcEGdwjwIdOgdFCjLuP dvf3RdlWtCxB3iLnCkYqSYrbvzSKq/NISW+A+PidRQzUWTgElcQZ/HnKzaiMBIrV8zx3 /1EMAUMpgKk/VgKZXLE3uW+cZSCeuX51Ra6yGSqNPWAfeLWi8iHs/9UX721/QqA1ReoA mC3HTpXFI9kaDY8sI47OjqjxjoLDpcoTaLwqePegOBFb1XBAmB9evtB2qm+QcepFICkA 2vqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715613365; x=1716218165; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uXHSyWB6fJ4bI4UOzHNSJAK2n7Pmu648dfIJZfg2RtE=; b=VHf325+MGNuiHfNMrq/VHfkgjzz6voaKfhgoBlgGopitFYdovH8MDxPkPq+3iK8jFy ei8vRB1zGvipZONB7jrvoCtHZTdbeG1LDyx1KiGVgGmW1quTik4iMsnOQj6sjhNw2yV7 2lyZWwhzHIE19KsQ5x8DJjGS9Ztz+zGyCKuwh83YmiySfQhU4lMgXZhDB4qP2jBc9EMI b7cAwYj56S9HIRiFslNnW7z7uqcmxR/Ktn3Txe8LAwGGNEP+BvWj/5qNGCWISV+UDTyc Zk05i6VOQlztvLYBaVV2plF2mzlv9LUHIAhmdQqVpXudzDEnk57kkLo93akNlueHFPYZ gx2w== X-Forwarded-Encrypted: i=1; AJvYcCXuHMJuy/MXRx2vELMASJHByc8IEtw4PtrfakBTr36c7at/nAl+o4tJFEd+pO7RehlGDxbtAG+lzLXEcPocpZYkGjze70lIciFoAvLu X-Gm-Message-State: AOJu0YwzqMLX+NTvabLNnO2n9BvepjIP1YqlVe3JePtLTUXMhzplXAuv 1b0xPIPXsTQWeA420mEsgFyADX41xjHpOc2eGJz9c6GvogaT1Xp0+rQ1oL67ryqjXVRHExRa7vB BgTIWdQGSrED8NCgPH2kWnLd9PCOShuER6NHTtg== X-Received: by 2002:a05:651c:d1:b0:2e0:c6ec:bcc1 with SMTP id 38308e7fff4ca-2e5204ac486mr60438181fa.45.1715613365410; Mon, 13 May 2024 08:16:05 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240510-dlech-mainline-spi-engine-offload-2-v2-0-8707a870c435@baylibre.com> <20240510-dlech-mainline-spi-engine-offload-2-v2-8-8707a870c435@baylibre.com> <20240511175832.6c2f6517@jic23-huawei> <20240512125202.312d0576@jic23-huawei> In-Reply-To: <20240512125202.312d0576@jic23-huawei> From: David Lechner Date: Mon, 13 May 2024 10:15:54 -0500 Message-ID: Subject: Re: [PATCH RFC v2 8/8] iio: adc: ad7944: add support for SPI offload To: Jonathan Cameron Cc: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?B?TnVubyBTw6E=?= , Michael Hennerich , Lars-Peter Clausen , David Jander , Martin Sperl , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 12, 2024 at 6:52=E2=80=AFAM Jonathan Cameron = wrote: > > On Sat, 11 May 2024 13:41:09 -0500 > David Lechner wrote: > > > On Sat, May 11, 2024 at 11:58=E2=80=AFAM Jonathan Cameron wrote: > > > > > > On Fri, 10 May 2024 19:44:31 -0500 > > > David Lechner wrote: > > > > > > > This adds support for SPI offload to the ad7944 driver. This allows > > > > reading data at the max sample rate of 2.5 MSPS. > > > > > > > > Signed-off-by: David Lechner > > > > --- > > > > > > > > v2 changes: > > > > > > > > In the previous version, there was a new separate driver for the PW= M > > > > trigger and DMA hardware buffer. This was deemed too complex so the= y > > > > are moved into the ad7944 driver. > > > > > > > > It has also been reworked to accommodate for the changes described = in > > > > the other patches. > > > > > > > > RFC: This isn't very polished yet, just FYI. A few things to sort o= ut: > > > > > > > > Rather than making the buffer either triggered buffer or hardware b= uffer, > > > > I'm considering allowing both, e.g. buffer0 will always be the trig= gered > > > > buffer and buffer1 will will be the hardware buffer if connected to= a SPI > > > > controller with offload support, otherwise buffer1 is absent. But s= ince > > > > multiple buffers haven't been used much so far, more investigation = is > > > > needed to see how that would work in practice. If we do that though= , then > > > > we would always have the sampling_frequency attribute though even t= hough > > > > it only applies to one buffer. > > > > > > Why would someone who has this nice IP in the path want the conventio= nal > > > triggered buffer? I'm not against the two buffer option, but I'd lik= e to know > > > the reasoning not to just provide the hardware buffer if this SPI off= load > > > is available. > > > > > > I can conjecture reasons but would like you to write them out for me = :) > > > This feels like if someone has paid for the expensive hardware they p= robably > > > only want the best performance. > > > > > > > For me, it was more of a question of if we need to keep the userspace > > interface consistent between both with or without offload support. But > > if you are happy with it this way where we have only one or the other, > > it is less work for me. :-) > > So inconsistency in userspace interfaces can occur for many reasons like > whether the interrupt is wired or not, but in this particularly > case I guess we have ABI stability issue because there are boards out the= re > today and people using the driver without this offload functionality. FWIW, the ad7944 driver will be landing in 6.10, so no users to speak of ye= t. > I'd not really thought that bit through, so I think you are correct that > we need to maintain the triggered buffer interface and 'add' the new > ABI for the offloaded case. The multibuffer approach should work for thi= s. > Will be interesting if any problem surface from having two very different > types of buffer on the same device. > In this particular case, I think the issues will be: 1. The hardware buffer can't allow the soft timestamp. Otherwise, the buffer layout is the same (on other chips, we won't always be so lucky). 2. The hardware trigger (sampling_frequency attribute) will only apply if there is the SPI offload support.