Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6811673imu; Wed, 30 Jan 2019 23:35:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6yG671GRNPjoQ1qSeYMYvcciejxkDxvKDL4CbiPQJKxAYrsa4xu2ll31veRXsYMJyu7tvq X-Received: by 2002:a62:62c5:: with SMTP id w188mr34030802pfb.160.1548920123078; Wed, 30 Jan 2019 23:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548920123; cv=none; d=google.com; s=arc-20160816; b=JFOqKKBDCnBLsRIDUqEwHA0/1LsRi3jLhae0C7CteOfylTGtkprmANKguWCKcJLAMw Zjjnf+OiiZ7ISqFP7QGZ0CGIRGBkybACOo8qw0dIl6AFcI9f6gAhc3GfE00E7NjIi0Iw kpaGikmJ/eDkGg53LzMWnocxZQi89Qe839nH/xqEg/EBLtWrHP6Nz23rjpBOwZgfH2KH gnVGbX4ACx40osn0KOz15uznCczVQRPWX2Qj850wvlNdVPFK6TIXOZSjzSBZvavVm1Sm zBOTJU7n+8r0YA3BGj4wks9pweGKLRbZbFeUtCJRB2H6ojrasbA4BM2lawpGiC26y01X CrcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=adSywb8/ha/Du881omodxCiGV6w4eSNibeRoEDTDuqA=; b=t3jdaPiO54lKgeZGWjuv3rUy7EkmsWG7ikkWODiAv3+6uR+NxXwWAT8Ak5k//iCDyj YsAFtVhRzHHUH+XEJCkq8G7Krfb6BL7tWHt2Gpn67LfZHorYgO76RxZxNw/MNgCIJL0N chPT2iAM8VRTweMJ6a1pwCp3H/k/xd4qsvR7x1XWTZBXizVwDkLAIwfCxTIQkzKNWZ7m QPMsKRALslvL4WgfAqH6iybAPEdQfFNBWaCKLXfM32xeC3APKu3yucjh4RIcA8r5MoS0 msRGLrbvYEJlfVGWPj4XAa6qMFhiuG4GdhDyxg8O66A0qVLe4N/q+30mOovgT6b/vfnb xUAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g83si3936208pfb.278.2019.01.30.23.35.06; Wed, 30 Jan 2019 23:35:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728132AbfAaHem (ORCPT + 99 others); Thu, 31 Jan 2019 02:34:42 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:57821 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbfAaHel (ORCPT ); Thu, 31 Jan 2019 02:34:41 -0500 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gp6rt-00051M-Cr; Thu, 31 Jan 2019 08:34:37 +0100 Received: from [IPv6:2a03:f580:87bc:d400:d5ac:2cb8:946b:3c87] (unknown [IPv6:2a03:f580:87bc:d400:d5ac:2cb8:946b:3c87]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mkl@blackshift.org", Issuer "StartCom Class 1 Client CA" (not verified)) (Authenticated sender: mkl@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 4BB043C385F; Thu, 31 Jan 2019 07:34:36 +0000 (UTC) Subject: Re: [PATCH] can: flexcan: fix timeout when set small bitrate To: Joakim Zhang , "linux-can@vger.kernel.org" Cc: "wg@grandegger.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , Aisheng Dong References: <20190131065619.7298-1-qiangqing.zhang@nxp.com> From: Marc Kleine-Budde Openpgp: preference=signencrypt Autocrypt: addr=mkl@pengutronix.de; prefer-encrypt=mutual; keydata= mQINBFFVq30BEACtnSvtXHoeHJxG6nRULcvlkW6RuNwHKmrqoksispp43X8+nwqIFYgb8UaX zu8T6kZP2wEIpM9RjEL3jdBjZNCsjSS6x1qzpc2+2ivjdiJsqeaagIgvy2JWy7vUa4/PyGfx QyUeXOxdj59DvLwAx8I6hOgeHx2X/ntKAMUxwawYfPZpP3gwTNKc27dJWSomOLgp+gbmOmgc 6U5KwhAxPTEb3CsT5RicsC+uQQFumdl5I6XS+pbeXZndXwnj5t84M+HEj7RN6bUfV2WZO/AB Xt5+qFkC/AVUcj/dcHvZwQJlGeZxoi4veCoOT2MYqfR0ax1MmN+LVRvKm29oSyD4Ts/97cbs XsZDRxnEG3z/7Winiv0ZanclA7v7CQwrzsbpCv+oj+zokGuKasofzKdpywkjAfSE1zTyF+8K nxBAmzwEqeQ3iKqBc3AcCseqSPX53mPqmwvNVS2GqBpnOfY7Mxr1AEmxdEcRYbhG6Xdn+ACq Dq0Db3A++3PhMSaOu125uIAIwMXRJIzCXYSqXo8NIeo9tobk0C/9w3fUfMTrBDtSviLHqlp8 eQEP8+TDSmRP/CwmFHv36jd+XGmBHzW5I7qw0OORRwNFYBeEuiOIgxAfjjbLGHh9SRwEqXAL kw+WVTwh0MN1k7I9/CDVlGvc3yIKS0sA+wudYiselXzgLuP5cQARAQABtCZNYXJjIEtsZWlu ZS1Cd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VuiR+iITkIrMLG2FdGzy 6mXwwCEJxn5s9Y5Y31hPGlQnYDPAuYMrDVBRsIQVwAsWpV83vKjp4WFP4wC1LEYj+j/Oorqv ALsMRq49WSclOMvqDdh//wmfSAbkyn3EA6EMv9mxJHJvKW7PMXvO0Mk1uP/+VR3FudMXhZzz MUYlqpO3B/RmA7lPoMY5+Km8c4/6L9Bn0vcbGMH4piH0IuEK0px64oXtKfti47XrCX+EDpSn ZwhEnNjCKyAJTaangebRpvOwJUZUWVh+hpM5FMcwJGKvVXNmrmSj Message-ID: <1902c81b-86fa-469e-b495-c37dca744cb9@pengutronix.de> Date: Thu, 31 Jan 2019 08:34:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190131065619.7298-1-qiangqing.zhang@nxp.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iLonVwgznhAG5kZLa30zCunLPJk4hftas" 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iLonVwgznhAG5kZLa30zCunLPJk4hftas Content-Type: multipart/mixed; boundary="Yppa9ejr8tEgmk3gRDD5A3n1I8iT984sD"; protected-headers="v1" From: Marc Kleine-Budde To: Joakim Zhang , "linux-can@vger.kernel.org" Cc: "wg@grandegger.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , Aisheng Dong Message-ID: <1902c81b-86fa-469e-b495-c37dca744cb9@pengutronix.de> Subject: Re: [PATCH] can: flexcan: fix timeout when set small bitrate References: <20190131065619.7298-1-qiangqing.zhang@nxp.com> In-Reply-To: <20190131065619.7298-1-qiangqing.zhang@nxp.com> --Yppa9ejr8tEgmk3gRDD5A3n1I8iT984sD Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable On 1/31/19 7:58 AM, Joakim Zhang wrote: > From: Dong Aisheng >=20 > Current we can meet timeout issue when setting a small bitrate > like 10000 as follows: > root@imx6qdlsolo:~# ip link set can0 up type can bitrate 10000 > A link change request failed with some changes committed already. > Interface can0 may have been left with an inconsistent configuration, > please check. > RTNETLINK answers: Connection timed out Which SoC are you using? Which clock rate has the flexcan IP core? > It is caused by calling of flexcan_chip_unfreeze() timeout. >=20 > Originally the code is using usleep_range(10, 20) for unfreeze operatio= n, > but the patch (8badd65 can: flexcan: avoid calling usleep_range from > interrupt context) changed it into udelay(10) which is only a half dela= y > of before, there're also some other delay changes. >=20 > After only changed unfreeze delay back to udelay(20), the issue is gone= =2E > So other timeout values are kept the same as 8badd65 changed. Can you change FLEXCAN_TIMEOUT_US instead? > Signed-off-by: Dong Aisheng > Signed-off-by: Joakim Zhang > --- > drivers/net/can/flexcan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c > index 2bca867bcfaa..1d3a9053bbeb 100644 > --- a/drivers/net/can/flexcan.c > +++ b/drivers/net/can/flexcan.c > @@ -530,7 +530,7 @@ static int flexcan_chip_unfreeze(struct flexcan_pri= v *priv) > priv->write(reg, ®s->mcr); > =20 > while (timeout-- && (priv->read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) > - udelay(10); > + udelay(20); > =20 > if (priv->read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK) > return -ETIMEDOUT; >=20 Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --Yppa9ejr8tEgmk3gRDD5A3n1I8iT984sD-- --iLonVwgznhAG5kZLa30zCunLPJk4hftas Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEENrCndlB/VnAEWuH5k9IU1zQoZfEFAlxSpQAACgkQk9IU1zQo ZfEM9wgAlgeJI/sa+IgA/dhYW9a8/YPX9d6CjwiDZaus6Jn/nqQJUlNdrOYjEDQL oBKXl9cnRhbF3HMBGVGoEuT3IIIZwsNOBroKI0pCyKzKUkqUfJTVQUIiqxBf8spT b6GsrjCx0CnKo/0plB1NtPT5ZVyvTW8DedUEaKG9iEbZpFzEVHv2KQUJES8eX2Jg t/vq88ka8VG1F7N5IGjsPfml1g6xTMo5CIF/AW7nLnLJ9c7hnJtWSzfC2YakFSwh DiidkubLmtV6OVkEqprf8bNSph3PZLit7aHdRmUZN3C5Ozb8/FyZVcSSYL0l5/5Q ZAj1TZY+ubB07QvO0jsLF1K+fz8Llw== =rW4Y -----END PGP SIGNATURE----- --iLonVwgznhAG5kZLa30zCunLPJk4hftas--