Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31592962rwd; Fri, 7 Jul 2023 01:22:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdp0qe9DzuOaAsOG/2x3WsACO2T/MExOTjTEx4pJWtQhyisqc3ocdXeL/U8BT56pFTQd4x X-Received: by 2002:a05:6a20:938b:b0:12f:d350:8a05 with SMTP id x11-20020a056a20938b00b0012fd3508a05mr4467119pzh.39.1688718176581; Fri, 07 Jul 2023 01:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688718176; cv=none; d=google.com; s=arc-20160816; b=daSwo+qxrcSaanuiyzdWQ5THbBIE8gU0gmCyQqBVT7ffbszcSmXEGl09qsYvfYPBME PDabvrFlxieTX4O/VgkH51CKsprQ5SrORrgw9rn/GlEbxtluljWfIF8iRoROqHza8xry 3LpkCXDZS2VXQW5FORyHrp8G7RpTy1cKpK1iLz74mJEt5T6QH0snf2ucRTZDfQjlQQYW ve9S/kM5aPh0jTp30HpTmyNG+MqAxbmRUIz0FrxmrGjlDU+kUQgT5NUXXdYu8QRyCKv5 Zp9FstMtec74qPS4m6VJyuLBCcu64WZvy3EfYMVNq2NiDcbJCAkoXq4xRmt2MoS1hLBg RSMQ== 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=2ToLKz/CkBpGCyfTnzbQgIumGK/4OkhB3H4DptEVnqQ=; fh=MGBiMZ8r8WVdfxJVQbPpw9WUrnEAgbunN2uXUT+RHdw=; b=yip5+JEfhb1cwwfoadse8EQHggLp/PKNf/FtfLMwRone4fl1aJsjZxmgQGqvyE4hCn 10j/gYkT8WtgaIHLaSSp0swa+UpmvhwW3XZCnhd9Uw2RywyqUIx8wQjIwphXK76uWsqQ f32NHPDy+SyI+VXPLmKpjnLGe6STSF97WAQj9zxfzPCjdtYiVpuwgaIKqgdPq9XHnqme TAgIt/D1IAnU2i4ps/Siztf6lYQiQTB1uN7UbMiXqctP4sTMM0FlCtSaao4TsgvhNx73 Oa3dITa2YQu85JhW1dgSsfNtccDUM0rw6kwhKWwzBMi4Q3rNR6aeiT05Zq9VhmHdXlUb 48CQ== 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 u21-20020a056a00099500b00661cd40bd67si3412996pfg.314.2023.07.07.01.22.44; Fri, 07 Jul 2023 01:22:56 -0700 (PDT) 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 S232314AbjGGHe3 (ORCPT + 99 others); Fri, 7 Jul 2023 03:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbjGGHe3 (ORCPT ); Fri, 7 Jul 2023 03:34:29 -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 1E3A91FCE for ; Fri, 7 Jul 2023 00:34:28 -0700 (PDT) Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] 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 1qHfyq-0003Q6-E7; Fri, 07 Jul 2023 09:34:16 +0200 Received: from pengutronix.de (unknown [172.20.34.65]) (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 D3E421EAE26; Fri, 7 Jul 2023 07:34:14 +0000 (UTC) Date: Fri, 7 Jul 2023 09:34:14 +0200 From: Marc Kleine-Budde To: Kumari Pallavi Cc: "rcsekar@samsung.com" , "Sangannavar, Mallikarjunappa" , "Nikula, Jarkko" , "linux-can@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Thokala, Srikanth" Subject: Re: RE: [RESEND] [PATCH 1/1] can: m_can: Control tx and rx flow to avoid communication stall Message-ID: <20230707-breeder-shaft-61b826633b7e-mkl@pengutronix.de> References: <20230623085920.12904-1-kumari.pallavi@intel.com> <20230705-return-slogan-36c499673bb6-mkl@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dxld4druqcvwrqfa" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:b01:1d::7b 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 --dxld4druqcvwrqfa Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 07.07.2023 05:38:09, Kumari Pallavi wrote: > > > if (netif_queue_stopped(dev) && > > > !m_can_tx_fifo_full(cdev)) > > > netif_wake_queue(dev); > > > @@ -1787,6 +1787,7 @@ static netdev_tx_t m_can_start_xmit(struct sk_b= uff > > *skb, > > > } > > > } else { > > > cdev->tx_skb =3D skb; > > > + m_can_write(cdev, M_CAN_IE, IR_ALL_INT & (IR_TEFN)); > >=20 > > - What's the purpose of "()" around IR_TEFN? > > - "IR_ALL_INT & (IR_TEFN)" is equal to IR_TEFN, isn't it? > > - This basically disables all other interrupts, is this what you want to > > do? > > - What happens if the bus is busy with high prio CAN frames and you want > > to send low prio ones? You will not get any RX-IRQ, this doesn't look > > correct to me. > >=20 >=20 > Even though the RX interrupt is disabled (in IE), if there is an TX > interrupt and the RF0N bit is set (in IR), the RX packet will still be > serviced because the TX and RX share the same IRQ handler. If the bus is busy with high prio CAN frames and the m_can wants to send a low prio frame, the m_can will not be able to send it's CAN frame, there will be not TX interrupt. If there are enough high prio CAN frames the RX buffer will overflow. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --dxld4druqcvwrqfa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEDs2BvajyNKlf9TJQvlAcSiqKBOgFAmSnv/MACgkQvlAcSiqK BOjdRAf/ev2175DU15TwDRx6naSR7QltyRAabcBHohWJrGf/oDogSB3PYo3V6wFY fRtr7Dy0JRw2p2jm1oTL+UzfB45Ap3Kp8x6DDA4+4Ca2eok+aK6r7jDE1rWKfod/ iBjQt6x0Plk5PT4ph7M1f1ukGUsJERyFoAQsR1rZQv2n+eT0pqGJZwpWofNtppG5 AQw04M1keRRE6LeMk1aeMdHi3fGiZT8QEJom0i1UEOiERIARuVsL5B3NDFEYkxVF FXSX8YPH6QZS6hNAbY7x79qEB0qRRX52Uj2FklIsYnl8YeXnFUe7ISp+n+9bFERs NcnMQ/tGrFAUHZc8ln6jnQOE5jtk0g== =dHVD -----END PGP SIGNATURE----- --dxld4druqcvwrqfa--