Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp485358rbb; Sat, 24 Feb 2024 08:51:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV00CQKVu1CKjDJOy4lDv0dc/aCCimjz9thQSmQFhB9InTlwCayr4Xm1balIi5/lEYM8e88s+To6dvyHGtl+XbF3WrajiKA1VM409+2lg== X-Google-Smtp-Source: AGHT+IG0F9PIdSqw8SrNVhcDV/J4+fkKGIXYndSjAVQb/efTGpQCtgwZwO7NFeVmqMnBm2FrXf2S X-Received: by 2002:a05:6808:3c98:b0:3c1:9ac6:4c4b with SMTP id gs24-20020a0568083c9800b003c19ac64c4bmr275800oib.42.1708793517524; Sat, 24 Feb 2024 08:51:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708793517; cv=pass; d=google.com; s=arc-20160816; b=tq5OdOlEDJ9LsC7jxEUy69BtBZ46yTYsuk6MYto5ogKIwiPL6gKckWQkBB13JPtumT 9/lkU8mLvHx0HJ4P8d2o7gmb93bF4bDU8YIJOTxqWKQR6wQoxZwCKj8XWTqMEVT0YFJ+ Y8JJIn0mBG2tzQaIl20VPfeyaXm0g57ABMm2AcEF2c+uQU7PCv04QgxkzEprLhrLQ7Li yNjwq1HeT+VFIos/ODTwtvvEsj4r4SYjEVtWqNfgoFtmooF+m4NmhcdN4Wn5MHGPITr7 M5pOc8pl7v+bwkIjBHaXDuzB76cI7V3kg/WxCTq77ikKrZPZpBOeO+xA87L2SpE7PM4P GVhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=YwcIlFCpUM9cyRSSK5uXV114IwyWU+8UQzsqB/PCZGM=; fh=myIfp5tOnTt1AThiPeO8alwqqrU/Bxpzh7s0b6bjsJA=; b=oHEuQLyALVgnJAoLXk0690aT5KiTByLvyEzFnYtuRqWh81LOo0ppaiUjGVoeyQyqul 4mD8QbgGWWVOVFHSZOxsK37fvxqMPB5Z7k6yXjwl8T7JnyfaJZo3i8JsuKFmmujTbrXp oZtbZVoquU9JRuIRyzdkHQTtktJTQ/ZNpdVp9jZsEj2MwMAJ6Omem2gfPfdxP0uch7VU l4rQT6maC9KdN2rSZwzI1dzhaw5IH5MH+rj64bG1BR69K8XqQqKs1lRorncIBJWm6ty0 aYHOUl1MMBggCjwJCSENN0kI8wRPn0wUYSFGcrP5D1d9pZZI5PhuQUfhCIO4mO8XiZBh yUPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dNTtK/Li"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id js12-20020a0562142aac00b0068fc83c08a3si1374492qvb.356.2024.02.24.08.51.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 08:51:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dNTtK/Li"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 46F2B1C21189 for ; Sat, 24 Feb 2024 16:51:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4E7641C6D; Sat, 24 Feb 2024 16:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dNTtK/Li" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F3A8C4C6B; Sat, 24 Feb 2024 16:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708793508; cv=none; b=ZVc2rcvG4fEVqzJc0h0dVj1zRf8RKuiY+sKNVewKoNM4TDNX2cQPAAFuZYOzjho5R+LBcSFv7Vub7Msp5qZTUAi9C4LG0duuuZPtLjvzqYBx8KhcJD0haYzaOojLQTOgSyhrj75geo2cRDGvC0+rz4KLrrodGL+QxbmUeZ1xcEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708793508; c=relaxed/simple; bh=nihirJ4RZALZuGoBNINSTW4VKZsU1WnAfv17CGmeF8o=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hxN2k5uazl3lpdYRhbs54a0oogvWC/i0DWuyYJ47InnS2ov7m8PlYcdM1kah+mItctBrjM35FW7IfbjN1jPGt9EZCHJqs7x5Ut16SZCbMRRFsZMLtKqpHhnlkZK+nkAISSt24yrt4blle3BZ2+dqEZ2tB28SMSeaYqLwEXQySiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dNTtK/Li; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5A65C433F1; Sat, 24 Feb 2024 16:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708793506; bh=nihirJ4RZALZuGoBNINSTW4VKZsU1WnAfv17CGmeF8o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dNTtK/Li5PCR0Sg1Ccnvl305yJ56h4eFbwZCT7S7n1lLZ44JKhTtzX9SjlZDIoF+M VzoYFmO0d729WgRzmEG8T7dR6pWU6QvAB3gExw33F9y3z4k8Nmmeue1M5uQn7+7DkV dplA7SXAHj84+JiuBT0Cu1xnBbjODy4qb+78Nv8AgRZJa2vMr/mBENpHY2l/mKzc0P 7CKFBpvcUs2atEmOYo9zrRl0/By0CzNPPdmsMuGnBpwFG87CrlqoW+ilCi3NPLeucx 5EAC4DBB7Q4N/VWNH24Jy1M+bFi7n3T4PzkWQ5ztdWgmoRagc8zgxe9RHx8F8jATlh zUwlfl6/C8hIQ== Date: Sat, 24 Feb 2024 16:51:33 +0000 From: Jonathan Cameron To: David Lechner Cc: Mark Brown , Martin Sperl , David Jander , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Alain Volmat , Maxime Coquelin , Alexandre Torgue , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, Julien Stephan Subject: Re: [PATCH v2 4/5] spi: axi-spi-engine: move message compile to optimize_message Message-ID: <20240224165133.33a6ad94@jic23-huawei> In-Reply-To: <20240219-mainline-spi-precook-message-v2-4-4a762c6701b9@baylibre.com> References: <20240219-mainline-spi-precook-message-v2-0-4a762c6701b9@baylibre.com> <20240219-mainline-spi-precook-message-v2-4-4a762c6701b9@baylibre.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 19 Feb 2024 16:33:21 -0600 David Lechner wrote: > In the AXI SPI Engine driver, compiling the message is an expensive > operation. Previously, it was done per message transfer in the > prepare_message hook. This patch moves the message compile to the > optimize_message hook so that it is only done once per message in > cases where the peripheral driver calls spi_optimize_message(). > > This can be a significant performance improvement for some peripherals. > For example, the ad7380 driver saw a 13% improvement in throughput > when using the AXI SPI Engine driver with this patch. > > Since we now need two message states, one for the optimization stage > that doesn't change for the lifetime of the message and one that is > reset on each transfer for managing the current transfer state, the old > msg->state is split into msg->opt_state and spi_engine->msg_state. The > latter is included in the driver struct now since there is only one > current message at a time that can ever use it and it is in a hot path > so avoiding allocating a new one on each message transfer saves a few > cpu cycles and lets us get rid of the prepare_message callback. > > Signed-off-by: David Lechner Whilst I'm not familiar with this driver, from a quick look at this patch and the driver code, looks fine to me. So FWIW Reviewed-by: Jonathan Cameron