From patchwork Mon Jul 12 06:10:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 475679 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 98FB0C11F69 for ; Mon, 12 Jul 2021 07:20:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81637613C7 for ; Mon, 12 Jul 2021 07:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240614AbhGLHXP (ORCPT ); Mon, 12 Jul 2021 03:23:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:58564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344750AbhGLHUt (ORCPT ); Mon, 12 Jul 2021 03:20:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 45EFE610A6; Mon, 12 Jul 2021 07:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074281; bh=7zs5AeFZlLMDbFtSpYQLgvmceUf9VKifAhC3x3e3esE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z3rhl2oSgj016D9Pa9F1rep+QVc+Furvb1wRC95mHOhNtUKAUVra183L8w83cljm0 E5augWSHiTVvyijYqALINyb5bbfkI89/o0nP6G57EJYZqMXNkR5gRRaSrQPrsQvo3c xv1cghdsrraGaErFzO/uFh1mjLYUWjDJiWRvxI+k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Sverdlin , Dan Carpenter , Sasha Levin Subject: [PATCH 5.12 525/700] serial: 8250_omap: fix a timeout loop condition Date: Mon, 12 Jul 2021 08:10:08 +0200 Message-Id: <20210712061032.287839327@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter [ Upstream commit d7e325aaa8c3593b5a572b583ecad79e95f32e7f ] This loop ends on -1 so the error message will never be printed. Fixes: 4bcf59a5dea0 ("serial: 8250: 8250_omap: Account for data in flight during DMA teardown") Reviewed-by: Alexander Sverdlin Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YIpd+kOpXKMpEXPf@mwanda Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 23e0decde33e..3161d3655670 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -813,7 +813,7 @@ static void __dma_rx_do_complete(struct uart_8250_port *p) poll_count--) cpu_relax(); - if (!poll_count) + if (poll_count == -1) dev_err(p->port.dev, "teardown incomplete\n"); } }