Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2140833rwp; Fri, 14 Jul 2023 01:07:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqlxtU1v1T7MD563cT/hvzFdJjwNy9eoH/hjuRmLozjmIJVFE8ZKK49D/ar5gs2nfe4KGF X-Received: by 2002:a17:906:de:b0:96a:3f29:40d9 with SMTP id 30-20020a17090600de00b0096a3f2940d9mr3473815eji.25.1689322026171; Fri, 14 Jul 2023 01:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689322026; cv=none; d=google.com; s=arc-20160816; b=AYHWF3aCb0+d3mk3osZfo176swF+ZBrygXXkqGsJxKPXCPFceXBhQR94rnGDxKdbkS q7XM+CzjDZbx9KNol9lT3zC86cBuEZtlh07InUnLOO38jprxxEwhb01P1i9cIIumK6xn YvS3Okj+78TYFZ7xsj+AP4pM8fZ53CkBSbdB46vp3RWT9UvTasiv/v5C3uHq2X12mYdE Kd8jjR7olaPlYEgsvoFJbgXyrfwPZpxYd109kqzuw1pm5BYJKfV2K6gFAoXyXL9PSLPw wKoD4YsKO9c5HBWJEmqKvhQQ4ZuTaxs8ZCe0FN5eo2uP0lojqtfku5bhFV86hHJyNWsn dACQ== 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=Hw+lMxkV95nGeIiLAuahg8HiaK1RnCKpG/E+rF245AY=; fh=MGBiMZ8r8WVdfxJVQbPpw9WUrnEAgbunN2uXUT+RHdw=; b=TxdCSscqi7Grf0WgHp+MQ9NKASKR8XEZNK+5eke8mwQhozXZmab4rkkCJS4lO4EbVM a5jPuj2rl/lhRAxMDgglVPYaWleYftokwHwz/ZODrq30heiN/qmH7dc2Pphk5uXgJPud op8LRZlMg0PtVxs4Z2yfEYKqwuJiHyuvpinCMZiZkTdLicAjWKvE/S/12yKs8VZqB3bt lF0sANw97pIMBfYQMWqMCDN5dTu5CnL1xCnwoRxVrEwWZSSB37xawCSbaHiC5PAietba FWXTsD37CVqyYPvACd2T5hFQk1whtzXM2u5015xwVMTHa5xVqIm3UqhmUx52V9d67b17 1fyw== 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 op18-20020a170906bcf200b00992acfd27fesi1376840ejb.503.2023.07.14.01.06.42; Fri, 14 Jul 2023 01:07:06 -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 S235368AbjGNHmY (ORCPT + 99 others); Fri, 14 Jul 2023 03:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234995AbjGNHmX (ORCPT ); Fri, 14 Jul 2023 03:42:23 -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 3A9CC2D78 for ; Fri, 14 Jul 2023 00:42:22 -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 1qKDRB-0000Y7-NC; Fri, 14 Jul 2023 09:42:01 +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 3A2BA1F0C60; Fri, 14 Jul 2023 07:42:00 +0000 (UTC) Date: Fri, 14 Jul 2023 09:41:59 +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: RE: [RESEND] [PATCH 1/1] can: m_can: Control tx and rx flow to avoid communication stall Message-ID: <20230714-sublime-vanilla-239fd808904c-mkl@pengutronix.de> References: <20230623085920.12904-1-kumari.pallavi@intel.com> <20230705-return-slogan-36c499673bb6-mkl@pengutronix.de> <20230707-breeder-shaft-61b826633b7e-mkl@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="miqxsq6fpespuq3y" 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 --miqxsq6fpespuq3y Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 14.07.2023 07:26:01, Kumari Pallavi wrote: > > 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_buff > > > > *skb, > > > > > } > > > > > } else { > > > > > cdev->tx_skb =3D skb; > > > > > + m_can_write(cdev, M_CAN_IE, IR_ALL_INT & (IR_TEFN)); > > > > > > > > - 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 wa= nt 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. > > > > > > > > > > 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. > >=20 > > If the bus is busy with high prio CAN frames and the m_can wants to sen= d a low > > prio frame, the m_can will not be able to send it's CAN frame, there wi= ll be not > > TX interrupt. If there are enough high prio CAN frames the RX buffer wi= ll > > overflow. >=20 > Sorry for late reply, I agree let me see if I can try to simulate this > scenario using CAN analyzer. I already stressed the current solution > for more than 10 days and didn't observe any issue. However, I will > try to incorporate this scenario for stress as well and come back. =46rom my point of view, this is a conceptional problem of this workaround. To test this issue, saturate the bus with CAN frames ID 0x0. Then on the m_can send CAN frames with ID=3D0x7ff. 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 | --miqxsq6fpespuq3y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEDs2BvajyNKlf9TJQvlAcSiqKBOgFAmSw/EUACgkQvlAcSiqK BOhcVgf9FVeqrRcMiUN45YcPm3fqfWnz9r+Y6QUSPJtSjJQF+Q3+eXW3MpR2MLII meoPMDZpPYd7EDwGW9syPTz0bC5TNFn+YGwsiLZDhCsj6vMXoan+pOrqq9DdrN61 avCLdSGN51pfw5lqyc/RelE8ffHljCjrSpqogLUt7+M4qqeW9z7PZS1yv+lL4mj9 J7sqRa3aK8mElz5cqeknElDATEkmVWrlHW3WIosWgB54/C8J+zbDrTTjipS5eww6 STj2jtlFIyUibyxqkL8Edf8k65wxRlyyN7dc/LdDEpQhuf50qVKE1iMSayOMSJ7R ZATUbj82zvuju12MGl6yYZMO/s7pVw== =NiAl -----END PGP SIGNATURE----- --miqxsq6fpespuq3y--