Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp267650rwb; Thu, 1 Dec 2022 01:53:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7xg//pZiDChWu9MUL80GL/3yzLOnTs7s55e9CHrLHOhmFmK4i9qvZ+aQfBWIsrEz3lxUiO X-Received: by 2002:a05:6402:4286:b0:458:7489:34ea with SMTP id g6-20020a056402428600b00458748934eamr7506191edc.264.1669888383810; Thu, 01 Dec 2022 01:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669888383; cv=none; d=google.com; s=arc-20160816; b=j+8gq+f7F7mK3NiBP2oH9Vo4jdMEnr/iS1NktgEE7ve0LRfiFeuz2aeSv0MdIUYQ0U icR2tOUOKDBHgsYaWTo7MKBSxPtDuZRZQF2QWo/O3QpeoLA952fbY3Dh+X+Lo4u+3n0J ISVFoIf/ZjmehHAKd8ReEVB4U+WIZoz0ZDphTWyc1XaPEJShwa3fNNtc6UDc4mquWdx2 OpSwjflxNwk4SgAdep7OZxQltDzZZEBDmAq5OCKWPZB8km0p6pPgmoCr46xwGXaQg1dL OS2394V6c97Gj0YWTQd5KpIE8Tn0P4RhDxVDnMJrL+p2Fb3va2XzbgQx6xJuRBXbBhCJ FhpA== 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=Tyl9hbxz8sIbemoMZ92NBaJ+TuP22RcJil26OOa2pXg=; b=L240wEY+GkZI+g+cypSQ+8/w8dzWx/p99apvr97vARqn8K8GXJ7GvNnvXYtJP9JtP8 MUW92mnC2O0MOpjx6+P/HNmS01uFkC/z43hnlhDIDeYgz9qCT6o5E+hm0WB22fFBzrHE PCdiHFwVhOxQF8xzwZfX3FXUAIU3MJoYwUHgl1IveG3gY5yFQqW04qkw0JPfVt/VOrQs jjYTZB1X6LZDugPjibGVvOHXpyta5xealOoiVMA7mD3DqsCFj+iKVBog4LVw7+b1TY8O XqjEk5+sl9kzCYfvWVHDqQHmlP6MFm9u+zFIls5mo3yzAClNvNTODSep1Y/lVbcFRQ5E rXHQ== 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 w15-20020a056402268f00b0046acab646ecsi3918496edd.81.2022.12.01.01.52.43; Thu, 01 Dec 2022 01:53:03 -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 S229685AbiLAJQT (ORCPT + 82 others); Thu, 1 Dec 2022 04:16:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiLAJQQ (ORCPT ); Thu, 1 Dec 2022 04:16:16 -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 728B0442C7 for ; Thu, 1 Dec 2022 01:16:15 -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 1p0ffs-00053K-AF; Thu, 01 Dec 2022 10:16:08 +0100 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:dc5e:59bf:44a8:4077]) (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 D433A12ECAC; Thu, 1 Dec 2022 09:16:06 +0000 (UTC) Date: Thu, 1 Dec 2022 10:16:05 +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: <20221201091605.jgd7dlswcbxapdy3@pengutronix.de> References: <20221116205308.2996556-1-msp@baylibre.com> <20221116205308.2996556-3-msp@baylibre.com> <20221130172100.ef4xn6j6kzrymdyn@pengutronix.de> <20221201084302.oodh22xgvwsjmoc3@blmsp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bgbavs7rssx26dyz" Content-Disposition: inline In-Reply-To: <20221201084302.oodh22xgvwsjmoc3@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 --bgbavs7rssx26dyz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 interrupt for > > > the transmit event is received and acknowledged. If we want to use 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 use > > the spi_async() API from the xmit callback, see mcp251xfd_start_xmit(). >=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. 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. 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. > > Extra bonus if you implement xmit_more() and transfer more than 1 skb > > per SPI transfer. >=20 > That's on my todo list, but I am not sure I will get to it soonish. I haven't implemented this for the mcp251xfd, yet, but I have some proof-of-concept code somewhere. However, the mcp251xfd driver already implemented byte queue limits: 0084e298acfe ("can: mcp251xfd: add BQL support"). regards, 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 | --bgbavs7rssx26dyz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmOIcNIACgkQrX5LkNig 012hAggAlCb40W8MfJXLFvupUYSaOXCTBav4Ad74PpGE+RCHo5V+RVAHB6xNqBUC Ur3tjLynBaHmla68klZIdl4ZUqRU5cBdJtRiGQpHwZJLqU9xP2FuiUf0I0VHAn/9 Wa/0yS2DY3kd9Ss9cdeAsewED4/0+zjgaFWWVycUX8srrcTi7ub26px0QGCkH+ld 6H2MJOtYzkLD3tAlcAghuRpfp3bsq2ZigzRfkungG8vJOlvkm7AsvLH49Q+ZAAW9 ALcyi61T2MGL6tL4glNVH5nozZif11Oo8SLY+y6cSeiRv1XGH+LLA6W2ff9hJo04 24rseGKCL6TUFzXOWhE1w+CBmE+LKQ== =p4PT -----END PGP SIGNATURE----- --bgbavs7rssx26dyz--