Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2525991rdd; Fri, 12 Jan 2024 12:10:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTY1yAcM4Ug1vdu3F7QX5BBLKYiWJZuWl/gQPDaB2EKUjy/QN2SLjEakqjcD12B/nL+p6e X-Received: by 2002:a17:902:654e:b0:1d5:a225:240f with SMTP id d14-20020a170902654e00b001d5a225240fmr2117836pln.49.1705090244763; Fri, 12 Jan 2024 12:10:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705090244; cv=none; d=google.com; s=arc-20160816; b=NSGZdq7jYGSCWfkkznlAq1RCgdwDI8zSHZuaEz2XcuA4SHF9ZjNIWPiMQ8apRWgRIg +eoQO9nfmAV5hQDlFq2InCMN4F0c4HP/XuiRkRVi6XiRvtGgaP8bmnsPnzzEQJeCkMj3 w1Cq8bLTWQ1Qaon8857wqhaGITUDJR0JEgh2CplxCb1GBXB+56VNUj5XQTaotYlEmpWC U9DqVsyX4M4v0t8krBW4aLV0hwOnkRWCX+gPqaQux+oGJ7d88AeA+oDSE7QI67cCfVH5 PM8r9LKxpvhYT4mjAB0a9w0RzGrMjMMZeV7mC2QQehikpDmb/6IbnjYP8DFkraMoVd0E mtuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=KODDiTlCYJz8VsTSh5FfV19+LAJgiCFhCmKp66prebs=; fh=aIGzeXbKCKBIluEFqAlMd+8fLjgebF/+pRJXqeahOCY=; b=L/IBzWD69lv+JZOCaG3JJyhxa3lwE+bs/A8hYE1bcfcmLplGspUDS7+9Geo5Yg0uUQ j1YqoAX2xoeFSD7kD7MNfC8y65ze26uU1zi0ETti9/31Suc1vgd9DeD3mogxHHtI454n smMZ/Td56LxtH+Y5lh9Len0Ikpb7+ONV1U4SuU2utE/vINJLPufFbLoX2P5ROi9xBFYe k1BwlsgDjfVqyf2BNCLzrGS+L8WDm8w4YbDEju/p/iCHvdGo/cYfkRo91D3AteWAgMA7 /TG9Tm9snjXEPaJ4UjfYLsvRiJcYQJuA+EfhWwdumDpEX7pN0J5LBwSUxfDHk9UK1tU5 2X5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=1pgyGpfI; spf=pass (google.com: domain of linux-kernel+bounces-25022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25022-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id kn5-20020a170903078500b001d54b868546si3712531plb.346.2024.01.12.12.10.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 12:10:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=1pgyGpfI; spf=pass (google.com: domain of linux-kernel+bounces-25022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25022-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 33DA728A6FC for ; Fri, 12 Jan 2024 20:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2185171AC; Fri, 12 Jan 2024 20:09:27 +0000 (UTC) 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="1pgyGpfI" Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 B6E2D16433 for ; Fri, 12 Jan 2024 20:09:24 +0000 (UTC) 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-f170.google.com with SMTP id 38308e7fff4ca-2ccbc328744so83647881fa.3 for ; Fri, 12 Jan 2024 12:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1705090163; x=1705694963; 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=KODDiTlCYJz8VsTSh5FfV19+LAJgiCFhCmKp66prebs=; b=1pgyGpfIAUmtnVrgG2GiS1Bcof5zE5Ypo1c3vuQAugjD8jxG2OHBuff3dtj+ym2LH0 FyP5ZZQlcse7lt4saVLhFZJnH20xpgYueXwZRK49kgnypWa8l+DNsKR8rLntNZWmtm50 1vCV7vhpCi6J2vBeOIV5HevYJ7O6yLbLpUBa4QHyOaCFwZqjOHMOEd/xH5TtvwKBYdyy 5chv0NuZ2RvA/o7RxNiyUpRS33VLb5WRuWqAZJgmkrdVYWta5/d1v27v7KGJsTdZ50Tn t43+45eMxxreA8nIsx+tkvVAER788TIkVyNrz5pvRncAJXBlH1e7znPk9fzwTwt+BVCh zMog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705090163; x=1705694963; 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=KODDiTlCYJz8VsTSh5FfV19+LAJgiCFhCmKp66prebs=; b=FgtpyFa9u9N9zeaMaXVL2+FeXhsDgChccbMGJrkgbVl+sspgRJzmgcOQ/oKskq/Fhm uXu6lXwb9Au09+A9VPq2n96VRMQHGw1CDFF4HO+ihpWNN6pAJ8AAYCvq/zjwl/rrlVNw NXKSpmotIYN2TrugiED5Mh8ml6srArdlZ+fLxUKpQO4VMOgNdkgRKIlYw3Jo4wMkUimw f1FgJVIIrK2JOn8OoanPC8O97t3ebVPiRRoGFkwt4KpewtwOvR18rD7CRk//axJzuPET EADt9cXDOReFRfbSPn3aN0t24VHtagec5bq7uY5zcvbc6T64SSVIJY7ZYfxjeQqSG6cr J21g== X-Gm-Message-State: AOJu0YxRhtZy4Sk8Y8lYz5hPAy/WN9vtfAc+0TrOlHS7PGO63suaMy89 1mN1ARB2tq2zan+qXx9p12xBQD3TXuk9qx3N9yKgnlbk6aZdhg== X-Received: by 2002:a2e:7813:0:b0:2cd:85b9:5815 with SMTP id t19-20020a2e7813000000b002cd85b95815mr890369ljc.42.1705090162684; Fri, 12 Jan 2024 12:09:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240109-axi-spi-engine-series-3-v1-0-e42c6a986580@baylibre.com> <20240109-axi-spi-engine-series-3-v1-1-e42c6a986580@baylibre.com> <2c74aad9-3cb9-4222-8072-e72120c2658e@sirena.org.uk> In-Reply-To: From: David Lechner Date: Fri, 12 Jan 2024 14:09:11 -0600 Message-ID: Subject: Re: [PATCH 01/13] spi: add core support for controllers with offload capabilities To: Mark Brown Cc: Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , =?UTF-8?B?TnVubyBTw6E=?= , Frank Rowand , Thierry Reding , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Jonathan Corbet , linux-spi@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, David Jander Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 11, 2024 at 3:32=E2=80=AFPM David Lechner wrote: > > On Thu, Jan 11, 2024 at 2:54=E2=80=AFPM David Lechner wrote: > > > > On Wed, Jan 10, 2024 at 3:36=E2=80=AFPM Mark Brown = wrote: > > > > > > On Wed, Jan 10, 2024 at 01:49:42PM -0600, David Lechner wrote: > > > > This adds a feature for specialized SPI controllers that can record > > > > a series of SPI transfers, including tx data, cs assertions, delays= , > > > > etc. and then play them back using a hardware trigger without CPU > > > > intervention. > > > > > > > The intended use case for this is with the AXI SPI Engine to captur= e > > > > data from ADCs at high rates (MSPS) with a stable sample period. > > > > > > > Most of the implementation is controller-specific and will be handl= ed by > > > > drivers that implement the offload_ops callbacks. The API follows a > > > > prepare/enable pattern that should be familiar to users of the clk > > > > subsystem. > > > > > > This is a lot to do in one go, and I think it's a bit too off on the > > > side and unintegrated with the core. There's two very high level bit= s > > > here, there's the pre-cooking a message for offloading to be executed= by > > > a hardware engine and there's the bit where that's triggered by some > > > hardwar event rather than by software. > > > > > > There was a bunch of discussion of the former case with David Jander > > > > I found [1] which appears to be the conversation you are referring to. > > Is that all or is there more that I missed? > > > > [1]: https://lore.kernel.org/linux-spi/20220512163445.6dcca126@erd992/ > > > > > (CCed) a while back when he was doing all the work he did on optimisi= ng > > > the core for uncontended uses, the thinking there was to have a > > > spi_prepare_message() (or similar) API that drivers could call and th= en > > > reuse the same transfer repeatedly, and even without any interface fo= r > > > client drivers it's likely that we'd be able to take advantage of it = in > > > the core for multi-transfer messages. I'd be surprised if there were= n't > > > wins when the message goes over the DMA copybreak size. A much wider > > > range of hardware would be able to do this bit, for example David's c= ase > > > was a Raspberry Pi using the DMA controller to write into the SPI > > For those, following along, it looks like the RPi business was > actually a 2013 discussion with Martin Sperl [2]. Both this and [1] > discuss proposed spi_prepare_message() APIs. > > [2]: https://lore.kernel.org/linux-spi/CACRpkdb4mn_Hxg=3D3tuBu89n6eyJ082E= ETkwtNbzZDFZYTHbVVg@mail.gmail.com/T/#u I found one more. A patch from Martin with the basic proposed API but not much in the way of implementation. It looks like this is where the idea fizzled out. https://lore.kernel.org/linux-spi/0C7D5B1E-E561-4F52-BEA8-572EB0CA26A6@mart= in.sperl.org/