Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp386977rdh; Wed, 7 Feb 2024 07:36:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUvO7Hoyvwc4o8/MvpnBslq2zJTTtB26+vfV9/kbsgF9DxEFX83vDP3cyUS/Rujp3ZygFND0Ox45XxckIaxZs9A9AssBYBDcedmXpJ8ag== X-Google-Smtp-Source: AGHT+IE3xkz5QKvWG2WeJSXGByEK9BPgYX64T3Nr6thKQIpIhcMsQTfEMC7F3SFQ6iUF0i798Ruf X-Received: by 2002:a62:e80b:0:b0:6e0:3b97:377 with SMTP id c11-20020a62e80b000000b006e03b970377mr3243059pfi.33.1707320210072; Wed, 07 Feb 2024 07:36:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707320210; cv=pass; d=google.com; s=arc-20160816; b=baTxLFaILcue7OkEkIu4JedLule/nTTXji29wAD8bqJhR/nHp0HfZTY+8egOnfMClV SNHFhgzcCYa+f1IKOEe6k9uU5knU5Kopjzg7YVUPUjrfiSiQVVVE+WtFc18xVxd/auR+ 9CDMhhdvQoUSX8X+qn8qaK0ciOpJdH+l5I5+H8F68oB4JN+bivof52U7JlT1VwN/031g U2WbMbryRcW4G2J/pXKwZNsFagENsdN1oojcbg6FYDK4hL1zKtfOzYMG/zQS9haKTbRg JEviwhLldwpetFnWQt7psKDxDb08+2BneBItaUffYZS5pKQ+MgHGV5awPyjdHpA3RjAg wSgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VUAowT6c9Ft0erxtEzBcSe8W7O3ZQNJQ531F8SYqzSk=; fh=r0Hx0CD0tNeE3s/9hUKRZqdeGedVn5oBEtLXlOfLWso=; b=A/qLFuzPRyeXpfcvvFS90QWu3BCnpyGOwYE3uy4NvOmHjMfiz82BtiCYRM8+n3wA+e QhZIpve69dFUF7YLlxEdxuECLcK0XaMCRJoWImc6Fr43aafhgncichSuwiuyG1uUPYxv a6rneiYEgHVxLIxVf74P5qR7mHR2ZAVjQiUzROQae5JXRRI6W4M8aYxsPUHtRdo4GHq4 XwxGpof3K++r6RzwgADz+gvQTdrp8n1/N7NfQJYt8ZfIH3v62X2C/OPIuiWLs1dY727f nGoAQOf9aOpZV8YXHTBguIrdjpPIUarXN5Pu1glASD8j9rFtGHWxX7qYBwlZy9qIhnmQ oz4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=G+342H5H; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-56715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=2; AJvYcCUVhSY8OoN7D8dAfka/ddFrgMKAOgyMpJrH+TG08hFrqCea13G8iJ22T4PJy3LzSDn89uOGg7w+w/938oXErDH2JJTs0K+Iw3Ko9SJRTg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m18-20020a62f212000000b006e02d7a2b99si1697697pfh.232.2024.02.07.07.36.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 07:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56715-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=pass header.i=@bootlin.com header.s=gm1 header.b=G+342H5H; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-56715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 C1E4AB28583 for ; Wed, 7 Feb 2024 15:25:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FE917F7D0; Wed, 7 Feb 2024 15:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="G+342H5H" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F24E97E77F; Wed, 7 Feb 2024 15:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707319523; cv=none; b=Lb+oFLi5KzsP4tHVn5NUxD8RzyCrJcjKlB4vVT5/BD1BpFcQiIhigInLho8brItckQDuFq5pc/+MT08qUM68W9ZiNNV5YXHotvmzzGWKR9avXf8ixdJLbygkfFgScdWwDx+50otd1JL39kYpi5Fu/kHFdwQB4JRPlZQNhu7e1vs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707319523; c=relaxed/simple; bh=gvOfXE9aaZLHOFWOgCvg5gMabwKGaaz75Fdk91nAsnk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A2pgMHw3SMdZuj8VzOR5I4abJpSDlm5WhlgVXL3wOjYGn7L+mVLvv2lB69dwIRiTTz66omZOfz5ni6rbXjyl8M+RxluersuRaVHSPt2u4yD9xjuEHNkmYeojp93tzo83qL6mrObuH+gd+5NP59gkJEBnBBwKe+NkYQJLv32mBuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=G+342H5H; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 907A0240003; Wed, 7 Feb 2024 15:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707319517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VUAowT6c9Ft0erxtEzBcSe8W7O3ZQNJQ531F8SYqzSk=; b=G+342H5HasI3pcR6rpDIUFgLvdwOgaKZCweEotOSNYzqM8RHYXBtOsFc0nYmdOqmZCwWZo g1juMp/ddCZazQAt3h0qyS2a2XNCwlt58akchmfSLuvQP59QvS8mjVq1VurjsxLzSFrvsZ J9knnqKx7wr/aWr9ZR/NRl504A9yMwXxzE0TyajdNEVgF2Orm/oNe4Nz45ZujafpyWY7EX dUrZt8ppJPvf9zxeynpC0AKu+6oNfA2x7oGkkzWLCZ+LHxXviOL0IwnYB/QbEq8UOjzb+n a9p3+lwyadSaNgYl5dOdFgWNHgtblSp4lo1Vdge31aYnCxOssgMVT+6tY2wQ0w== Date: Wed, 7 Feb 2024 16:25:16 +0100 From: Louis Chauvet To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Miquel Raynal , yen-mei.goh@keysight.com, koon-kee.lie@keysight.com Subject: Re: [PATCH 2/2] spi: omap2-mcspi: Add support for MULTI-mode Message-ID: Mail-Followup-To: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Miquel Raynal , yen-mei.goh@keysight.com, koon-kee.lie@keysight.com References: <20240126-spi-omap2-mcspi-multi-mode-v1-0-d143d33f0fe0@bootlin.com> <20240126-spi-omap2-mcspi-multi-mode-v1-2-d143d33f0fe0@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-GND-Sasl: louis.chauvet@bootlin.com Le 06/02/24 - 10:56, Mark Brown a ?crit : > On Tue, Feb 06, 2024 at 11:00:50AM +0100, Louis Chauvet wrote: > > > Introduce support for MULTI-mode in the OMAP2 MCSPI driver. Currently, the > > driver always uses SINGLE mode to handle the chip select (CS). With this > > enhancement, MULTI-mode is enabled for specific messages, allowing for a > > shorter delay between CS enable and the message (some FPGA devices are > > sensitive to this delay). > > I have no idea based on this commit message what either of these modes > is or how this shorter delay would be achieved, these terms are specific > to the OMAP hardware AFAICT. Please clarify this, it's hard to follow > what the change does. It looks like this is just a CS per word thing? Indeed, you're right, the wording is probably very OMAP specific, I didn't realize that earlier. I'll try to explain better. What about this addition following the above paragraph, would it be clearer? [...] this delay). The OMAP2 MCSPI device can use two different mode to send messages: SINGLE and MULTI: In SINGLE mode, the controller only leverages one single FIFO, and the host system has to manually select the CS it wants to enable. In MULTI mode, each CS is bound to a FIFO, the host system then writes the data to the relevant FIFO, as the hardware will take care of the CS The drawback [...] > Note that you may not have to tell the hardware the same word length as > the transfer specifies, so long as the wire result is the same it > doesn't matter. If I understand correclty what you want is: given a message, containing 2 transfers of 4 bits, with cs_change disabled, use the multi mode and send only one 8 bits transfer instead of two 4 bits transfer? This seems very complex to implement, and will only benefit in very niche cases. If I have to add this, I have to: - detect the very particular pattern "message of multiple transfer and those transfer can be packed in bigger transfer" - reimplement the transfer_one_message method to merge multiple transfer into one; - manage the rx buffer to "unmerge" the answer; - take care of timings if requested; - probably other issues I don't see I agree this kind of optimisation can be nice, and may benefit for this spi controller, but I don't have the time to work on it. If someone want to do it, it could be a nice improvement. I just see that I miss my rebase, I will push a v2. This v2 will also change the commit name for patch 1/2. Have a nice day, Louis Chauvet -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com