Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1770217ybl; Thu, 15 Aug 2019 00:36:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkgX2gELYvkLzai0DF3qQndcnyvo6BE18P3mHETR/RNp0MRcxGg5LcSTZv9nI833KijJMP X-Received: by 2002:a17:902:1027:: with SMTP id b36mr3023286pla.203.1565854615996; Thu, 15 Aug 2019 00:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565854615; cv=none; d=google.com; s=arc-20160816; b=Bgq5dJhq16Wr798WrXgVcn60A9Vqi4zYiGFF/nu3HDGNH8IMV2IlbZ211riXwuBfi9 xYp8XAoEHhu1+aa/fThF0yVkfnlYDUiP94r1lmollDut4dxmgQIasnMkeDRkfCZp/VkI fzE4asWKQPcOs2/bKtUZ7A21at/UVy2tAHxx15WKEW3/yOF7v6SWzPJiPBHvkvGe8ydy Hzy0s9OVNatR0MExzFrWUCkEuGNqZ3lCPBFNpCohYymyn2ZCFVvqnR2j1CWIUcEf8QdG 1Tsntva7voxYE4B8LeXR3LJnjD6rJxE+GKGJiLPZOmTW3QCwdxbJe4SW0y2fPXTh9tpb mgMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ANoVsB0LwC8zbyHXRZ+BO7WLljRWOM49ZEAvFvvmtFE=; b=u6iIQvDsZ//HN+/gGg7XZAXwTui/MwISn8EWmGY8tebW5Cy2yrtO1jHFKtgWEZxLO4 73SYDu8HTR/67rxwtDgBl7iXXWCS5NTMKdRfjeNo9G+BRQzEOmZhNvftzI276F6FYauM UbTun2O1ohEGPpaKpY/fg51PlSNIGPApJKthpG+veSVs0yR1C/dybnCmUVDZEG8mVNnr C1e9mdXIrtQsjHrGkDYY0SjY3HGXwOCvT4yVQ8R+NfrEjKHsaS3v4RcqmDHt9itkdPIf LikoXJQJbkJv1jB1ufNQ7n+2jx+ZS1uH95O9Ga6oLsK07pipiJ+IDzPQRPGHTShRCzYk 0eEg== 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 o7si1367891pgi.127.2019.08.15.00.36.39; Thu, 15 Aug 2019 00:36:55 -0700 (PDT) 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 S1730477AbfHOHHm (ORCPT + 99 others); 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--