From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF2B3C31E40 for ; Thu, 15 Aug 2019 07:07:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A2F420656 for ; Thu, 15 Aug 2019 07:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730492AbfHOHHm (ORCPT ); Thu, 15 Aug 2019 03:07:42 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:52158 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730186AbfHOHHm (ORCPT ); Thu, 15 Aug 2019 03:07:42 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 114F880BC7; Thu, 15 Aug 2019 09:07:26 +0200 (CEST) Date: Thu, 15 Aug 2019 09:07:39 +0200 From: Pavel Machek To: Jorge Ramirez Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Sasha Levin Subject: Re: [PATCH 4.19 024/113] tty: serial: msm_serial: avoid system lockup condition Message-ID: <20190815070739.GA3906@amd> References: <20190729190655.455345569@linuxfoundation.org> <20190729190701.631193260@linuxfoundation.org> <20190731190533.GA4630@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >> [ Upstream commit ba3684f99f1b25d2a30b6956d02d339d7acb9799 ] > > Should it use something like 5000*udelay(100), instead, as that has > > chance to result in closer-to-500msec wait? >=20 > the half a second timeout didnt mean to be accurate but a worst case > scenario...I am not sure accuracy matters. Well, I'd be afraid that it would wait 5 seconds, not half a second. udelay(1) may be very inaccurate. > >> while (!(msm_read(port, UART_SR) & UART_SR_TX_EMPTY)) { > >> if (msm_read(port, UART_ISR) & UART_ISR_TX_READY) > >> break; > >> udelay(1); > >> + if (!timeout--) > >> + break; > >> } > >> msm_write(port, UART_CR_CMD_RESET_TX_READY, UART_CR); > >> } > >=20 > > Plus, should it do some kind of dev_err() to let users know that > > something went very wrong with their serial? >=20 > I did consider this but then I thought that 1/2 second without > interrupts on the core should not go unnoticed. But I might be wrong. Well, maybe it will be noticed, but user will have no idea what caused it. Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl1VBLsACgkQMOfwapXb+vJ/JACeLdowu6zpV4u3EcD06Nal+ndM VtUAn1YYozTjmj0qVSW+pNe3KSrsOK3X =Nl4A -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--