From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7535C5478C for ; Sat, 24 Feb 2024 16:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yEssdNzUdZumCkC6f5FgnieDK8e6Db9rA3YmVOhhKPM=; b=rvoedLaVWAaxcw DAO3OCEf6RkIn1Lc4+aef8EQXVuuYjSdUGRNahw9Yd2Y6ziAEv/i8k/WPZqWWOaW5avOuvWIBx8un NUCDmEkEjxl1qxhJQ3zNcKCImKUFxU7fIPtng/5u7n7vrqxWX1afLCr2ZzfOcdFiyKZRXLoXaz5Lk ikEgo4HMow2z8aoOQDUngfcHHBOCx4Axt4SFEkA+LLIcksUWdMkJx09mbsPSIeOL58Il9IV662cry Bm+ogR9xfjklq5yZtB+nNTaOxHfCthBbIbTKbR1UMjdZtVspWNKz/70hE7D3gRSafDPOQ6s+AqrLX p6ZM2O/rUsFcnfyxUx2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdvFg-0000000DGZ4-3V8l; Sat, 24 Feb 2024 16:51:52 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdvFe-0000000DGYY-28mg for linux-arm-kernel@lists.infradead.org; Sat, 24 Feb 2024 16:51:51 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 326C8CE0C48; Sat, 24 Feb 2024 16:51:48 +0000 (UTC) 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) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240224_085150_766233_26657FBB X-CRM114-Status: GOOD ( 21.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel