Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp513379pxt; Fri, 6 Aug 2021 07:26:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+c2zFJq5oargmimkdlnSooRpThHc5qIIFuUB8cGcq0gE4wRtQNIQga2f9cbUZx6zC5B8I X-Received: by 2002:a05:6e02:688:: with SMTP id o8mr641875ils.182.1628259962729; Fri, 06 Aug 2021 07:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628259962; cv=none; d=google.com; s=arc-20160816; b=nnJQLcUwwbYmtnCMUX6IIcyP6kKfoVOwvfV/m9PTO7iE5Oj7LriKkdLjUMZcZ8Tug0 Rfy2tpUIHkhP/41EOg1PfD6OfBeXBKYFBgSzxtidkfoTHnqItkVm20c282ffR81tv+SH gC6UmwJxSYFfmAaltiD79zdkChaERJkkZAfAO8EHzzOocRhKVGeCdSZAIPLKNFOWFJRT s375N5CiGjUvGCOp0NIMcut0cYDdppa4WxB6qtJQiOaYP80CbBUHny/dfMdtzYYqgG/7 lx4oBz0xxIhD0xW3yyHo7IZ3Y+XgVaNDgnc1hK5hF584l13QJPYD8jjA+9C69wpouBcY aAnw== 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=7IB6r7HrVoCejLtRk/A+zsDNKXnE6XmDcB/765JbILk=; b=Ls1zpBhlFe81pTCObnQJOi8wCJNF1IymcLoJpyt8otVTE9bIryV7f3O1NtOMjgg6wF hq8lIWNq5ww/gjXnbNdBz54na+UUEUPYSj74gpPViThcWhljg4IvFDwqKjZXoM7Dhv1u 5xLHwxX8wjjP/bsu2O+Y/9k+TMujnmzzyOy5W+MxsAqgv/2I2LVtCs01J7vHqv6sksA3 RMzvloIkdWu2RGeS0/RRec8FvwRiN9K2GTXetpn5fl0q/GSI9+/Yh0gY5WKS6Hztjf08 jNk2vU4ZwbUFOSo6zf8RpM2B2/3GVpHSO3CuHU8fMmTJACUrOAHdZZ6QICzttc6piPfN 5DZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si9191428jan.7.2021.08.06.07.25.41; Fri, 06 Aug 2021 07:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244601AbhHFJhZ (ORCPT + 99 others); Fri, 6 Aug 2021 05:37:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244527AbhHFJhY (ORCPT ); Fri, 6 Aug 2021 05:37:24 -0400 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 008B8C061798 for ; Fri, 6 Aug 2021 02:37:08 -0700 (PDT) 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 1mBwHm-00029e-MZ; Fri, 06 Aug 2021 11:37:02 +0200 Received: from pengutronix.de (unknown [IPv6:2a02:810a:8940:aa0:66f0:974b:98ab:a2fd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) 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 63286661D5B; Fri, 6 Aug 2021 09:37:00 +0000 (UTC) Date: Fri, 6 Aug 2021 11:36:58 +0200 From: Marc Kleine-Budde To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, Gianluca Falavigna , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Oliver Hartkopp , Vincent Mailhol , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2 4/4] can: c_can: cache frames to operate as a true FIFO Message-ID: <20210806093658.rvzw7zycrmyp4msp@pengutronix.de> References: <20210805201900.23146-1-dariobin@libero.it> <20210805201900.23146-5-dariobin@libero.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kkgc47zk5ugabioc" Content-Disposition: inline In-Reply-To: <20210805201900.23146-5-dariobin@libero.it> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --kkgc47zk5ugabioc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 05.08.2021 22:19:00, Dario Binacchi wrote: > As reported by a comment in the c_can_start_xmit() this was not a FIFO. > C/D_CAN controller sends out the buffers prioritized so that the lowest > buffer number wins. >=20 > What did c_can_start_xmit() do if head was less tail in the tx ring ? It > waited until all the frames queued in the FIFO was actually transmitted > by the controller before accepting a new CAN frame to transmit, even if > the FIFO was not full, to ensure that the messages were transmitted in > the order in which they were loaded. >=20 > By storing the frames in the FIFO without requiring its transmission, we > will be able to use the full size of the FIFO even in cases such as the > one described above. The transmission interrupt will trigger their > transmission only when all the messages previously loaded but stored in > less priority positions of the buffers have been transmitted. >=20 > Suggested-by: Gianluca Falavigna > Signed-off-by: Dario Binacchi My review from https://lore.kernel.org/linux-can/20210806092523.hij5ejjq6wecbgfr@pengutron= ix.de/ applies here, too. Please use IF_RX in c_can_do_tx(), remove the spin_lock and test. After applying your series, I'll send a patch that changes IF_RX into IF_NAPI to avoid any further confusion. 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 | --kkgc47zk5ugabioc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmENArgACgkQqclaivrt 76lr2ggAtT5H7Kcg2sOQ418ClRECb7Ivlr96/mGdHw2VANvbT0xzrmACGFjFQG1k yGPnmsKdA+SZp5lkRJNVFgZMUc5vZQjqFEh+V5YScdG1hYSnRtRkvvbqOqWrxfmG bZBHiUJKZIGRQLT61mBHQS9HmKnGMX0j3WEGn/uNTr/guFH+P3JzbZj7GGLNUgGA hjdTYUnO3j2i7dV/E6hPRSDwcBDkXzuwZxmtkuWOdb5ZNeokfF/1oi466phe5fBg r1UXw830FbsaqrkI+HnoxxZRBXCl6EneRNfapJxMmtRGdc8+czpdkoo5xDL61DMW UdcsQpCF8GUp9Igluek5mBqCnzVa1w== =WNgH -----END PGP SIGNATURE----- --kkgc47zk5ugabioc--