Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4489146ybx; Mon, 4 Nov 2019 14:16:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzT900dlxfsD2w9nE67aqoJDv3TFoEMnt8oAlIqr4BhwynVgVKzBGkr3G9FYArUR3IWa08I X-Received: by 2002:a05:6402:28d:: with SMTP id l13mr6090968edv.286.1572905776613; Mon, 04 Nov 2019 14:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905776; cv=none; d=google.com; s=arc-20160816; b=OyLMX6s94e0daFWTFyxG+5+csYJ9PSovX0k07tVYmfYpBWGKSZdcVb+72/fVIIEL+h O0sZPxqVCHhblemZ0IcP4VbkljDX16xI0ldxzFM0YVP2I1rx/8TDtXf+P6dxR7U0qNBU 4fYZBrJ0MF6C4KYNRnsJYvKvGLoajd+6Tj16lMMY2T6HVfrO3XouuNSf9hNm+VZ4bT8j KW0/XPj/ehS/QqQKlAbt0L4Gc4oT8jWUtX+LadqFHJWkuggYE4Xc+/oxv8woAog5nOYN 2HNV3q6MhKUBP5k+bWkRdWdqsXfEevyJe9lthv+vD/veaJ3lNYdslZrDfr3ZIRwv2viO N48g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7NsjpvwoOHEuNB/Tznq4oOlqcIVjBJiTjKlI5eD2BYA=; b=JwNgI2UApgdtSPgIwnW8klEjm05lCahOw8LzG9axX3H8fDPbtbQF73fXtMOrbi+ubX KOFa/dC44IT92FG14qE/V7K2k0pDmPhIwL1LimzQi5iLj9wGIua8IvtMEN+Y5tmr7zFu 0UcVBZbxRp7KYueW+iHzY6AOYJSIQGqsGtFXdCIfZtdVKP/p4+WEy51klNf/BMly/6Tn KatoXH9M4umvX3gsze/KWbvBIEq48Vv/CoTWNyrkhMLLv9sjrW7kbys2ajUqon8dcySH c4unLi3LaiksqNTXniOEwUiHIuvGCBSRCPRixjwauuYCYSbW4FAmVa+nBRIVqzYBwrFH QU8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r9vTWxXQ; 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 e56si8285606edb.355.2019.11.04.14.15.42; Mon, 04 Nov 2019 14:16:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=r9vTWxXQ; 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 S2389922AbfKDWPD (ORCPT + 99 others); Mon, 4 Nov 2019 17:15:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:38890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390057AbfKDWGr (ORCPT ); Mon, 4 Nov 2019 17:06:47 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0782A21D71; Mon, 4 Nov 2019 22:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905206; bh=vOxgA07gZhgreIxvC378VR7YjrXYnrjkGDXa/aPtFWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r9vTWxXQESaEp6/sZdUIMf90wPGVWRUDqeqF7SvtDRrXxJbF2T7YmYMO1ERYmHljA cc4PDiGNKFY4psvUb4cjXOp4jvXHekG4NIo9bh7nkpIoBt9IlV3hjnUW8e7/LnNded epLRZk0gRaXzu+4gYNQtIamB+GbpF9Gk7JY1VJH4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adam Ford , Yegor Yefremov , Sasha Levin Subject: [PATCH 5.3 048/163] serial: 8250_omap: Fix gpio check for auto RTS/CTS Date: Mon, 4 Nov 2019 22:43:58 +0100 Message-Id: <20191104212143.674151433@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adam Ford [ Upstream commit fc64f7abbef2dae7ee4c94702fb3cf9a2be5431a ] There are two checks to see if the manual gpio is configured, but these the check is seeing if the structure is NULL instead it should check to see if there are CTS and/or RTS pins defined. This patch uses checks for those individual pins instead of checking for the structure itself to restore auto RTS/CTS. Signed-off-by: Adam Ford Reviewed-by: Yegor Yefremov Link: https://lore.kernel.org/r/20191006163314.23191-2-aford173@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_omap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 3ef65cbd2478a..e4b08077f8757 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -141,7 +141,7 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) serial8250_do_set_mctrl(port, mctrl); - if (!up->gpios) { + if (!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS)) { /* * Turn off autoRTS if RTS is lowered and restore autoRTS * setting if RTS is raised @@ -456,7 +456,8 @@ static void omap_8250_set_termios(struct uart_port *port, up->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF); if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW && - !up->gpios) { + !mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS) && + !mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_CTS)) { /* Enable AUTOCTS (autoRTS is enabled when RTS is raised) */ up->port.status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS; priv->efr |= UART_EFR_CTS; -- 2.20.1