Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1856389rwb; Fri, 2 Dec 2022 02:01:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf5+fdN0CNUEw7ejVoftWSV9bTVdqlA/ATvSqrpCBEmD0/IdDH2sbuKWQtEqxqI52iw///D4 X-Received: by 2002:a05:6402:184b:b0:46a:2692:76e7 with SMTP id v11-20020a056402184b00b0046a269276e7mr41795035edy.387.1669975265462; Fri, 02 Dec 2022 02:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669975265; cv=none; d=google.com; s=arc-20160816; b=sBVbRPQ3bVq2JquUpNqg+o5tDD6/crG+Dxrq/fCI8ada/vPcp8TX9yDLS2br0CR73f Owus4JY7WoEqMIMhzEDwLvVn9/vKAqwksRF9pSCE/7jkunai+VT4GqAP+/rGPv10/lSe RJDnrQLWpE6+FROjueHsabtGXYQlxD9t+xQLQXMVm1AVWaHUaLGPV1uwAiTGFs5Y+riz P/cJ4REa47Yx+0NgssUxX9BVyhTqhfZX4Ah4YsGnqk7O63/xYAvU8ezz2e5M9Z8bdA62 YtiWkvAODf2hRCicES52/P0AxwyorwspaNgdVRF0en4VjOfZAvTzjzLLO8yzJIHytivs hBkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ApF8UNUZThZNdlMIRJCD9ncp48u5GquKmQlbPliNaZA=; b=jMrX84SzU1+nNDf/3sfudlcBA9Jj2o3lr3829CbidBnFwfE9bCRhJAo+NR/3z+Ll+q eNOD2H/Shxy3vM0eMrioSpZ4+DNaMicm47RvVnFurXMtDZkUUN4rKypNvAT2pCQ8ON65 sMHB4hoZBIhThDGzaCbEfeC97M8tQWJywA0KVuWOSAVfQ7qxHvX86xh7JK552TstL3hM 97on9p5zimxHQCc3r16RN9ILZPfmq79zPS0DjooAAc0oyyPs7Xps+/BBPUwPtf7NOISH SHuhUrk5ceDGNPz2HdmFemcvfCNZ6ahDHGSjn0jtd0k56+GazAT0RUq40n3vm0QsRtKs qM+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a50cd81000000b0046bd9b65cd9si4595913edi.242.2022.12.02.02.00.44; Fri, 02 Dec 2022 02:01:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233054AbiLBJdv (ORCPT + 83 others); Fri, 2 Dec 2022 04:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233146AbiLBJdU (ORCPT ); Fri, 2 Dec 2022 04:33:20 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E271EB956F for ; Fri, 2 Dec 2022 01:33:03 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p12Pi-0001p9-OC; Fri, 02 Dec 2022 10:32:58 +0100 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:63a6:d4c5:22e2:f72a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 1CC8B1312BF; Fri, 2 Dec 2022 09:16:36 +0000 (UTC) Date: Fri, 2 Dec 2022 10:16:30 +0100 From: Marc Kleine-Budde To: Markus Schneider-Pargmann Cc: Chandrasekar Ramakrishnan , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/15] can: m_can: Wakeup net queue once tx was issued Message-ID: <20221202091630.253elxu66i3nur4n@pengutronix.de> References: <20221116205308.2996556-1-msp@baylibre.com> <20221116205308.2996556-3-msp@baylibre.com> <20221130172100.ef4xn6j6kzrymdyn@pengutronix.de> <20221201084302.oodh22xgvwsjmoc3@blmsp> <20221201091605.jgd7dlswcbxapdy3@pengutronix.de> <20221201164902.ipd3ctrtne47jtmv@blmsp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gkatmsqg2kawq7yc" Content-Disposition: inline In-Reply-To: <20221201164902.ipd3ctrtne47jtmv@blmsp> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --gkatmsqg2kawq7yc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 01.12.2022 17:49:02, Markus Schneider-Pargmann wrote: > Hi Marc, >=20 > On Thu, Dec 01, 2022 at 10:16:05AM +0100, Marc Kleine-Budde wrote: > > On 01.12.2022 09:43:02, Markus Schneider-Pargmann wrote: > > > Hi Marc, > > >=20 > > > On Wed, Nov 30, 2022 at 06:21:00PM +0100, Marc Kleine-Budde wrote: > > > > On 16.11.2022 21:52:55, Markus Schneider-Pargmann wrote: > > > > > Currently the driver waits to wakeup the queue until the interrup= t for > > > > > the transmit event is received and acknowledged. If we want to us= e the > > > > > hardware FIFO, this is too late. > > > > >=20 > > > > > Instead release the queue as soon as the transmit was transferred= into > > > > > the hardware FIFO. We are then ready for the next transmit to be > > > > > transferred. > > > >=20 > > > > If you want to really speed up the TX path, remove the worker and u= se > > > > the spi_async() API from the xmit callback, see mcp251xfd_start_xmi= t(). > > >=20 > > > Good idea. I will check how regmap's async_write works and if it is > > > suitable to do the job. I don't want to drop the regmap usage for this > > > right now. > >=20 > > IIRC regmap async write still uses mutexes, but sleeping is not allowed > > in the xmit handler. The mcp251xfd driver does the endianness conversion > > (and the optional CRC) manually for the TX path. >=20 > I just saw, you can force regmap to use spinlocks as well. But it uses > the same operation for sync operations as well. But you cannot use sync SPI api under a spinlock. > > Sending directly from the xmit handler basically eliminates the queuing > > between the network stack and the worker. Getting rid of the worker > > makes life easier and it's faster anyways. >=20 > The current implementation of the driver doesn't really queue anything > between the network stack and the worker. It is a queue of size 1 ;). Ok > To be honest I would rather focus on the other things than on getting > rid of the worker completely as this can be done in a separate patch > later as well. Yes I agree it would be nice to get rid of the worker but > it is also probably not a major bottleneck for the performance and in > its current state it works. If I have time left at the end I will be > more than happy to do that. But for the moment I would just keep the > worker as it is. Is that OK for you? Sure. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --gkatmsqg2kawq7yc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmOJwmsACgkQrX5LkNig 0126Egf6AoFzKXBy4GROos9DBeL7yECpyQlkoQoOfHsO/WumBEad76Zty8iRt3nI 3G4YxYoBInpvkA2z6hDSkAxGNg7U98GNwME8EwXMClGrCToXyyV0Z4xaFCs00nsy nJUpS3C/dL29eH1NNhuDhZu0UANYCRkCQwVwCr2I4+AQCQ1FVf+WNfuJfC7IkijE ISeV6c+hYU/L5pNNsRWRaHmz08p8gAQot2DoFp2miBK3e0hJ9CdgBg82cpvsGh6+ StKjpr1MPnbD6AE34uVKkwFPreCoGRnPSsOlXFcWIXqQHRLm5n4LNg9x6lO5Yqql kpHTw7s4SCDU0IAAYwa0aoVc7X4NOw== =RMCq -----END PGP SIGNATURE----- --gkatmsqg2kawq7yc--