Received: by 10.223.176.5 with SMTP id f5csp1047017wra; Fri, 2 Feb 2018 10:14:37 -0800 (PST) X-Google-Smtp-Source: AH8x2275ZTFAZPcUVOV9UWiJJa+cBP/DwbplNz1At/e+7TKpFArjaXYw6DvZYmVdFzn3w0hkfQkW X-Received: by 10.101.100.208 with SMTP id t16mr24877043pgv.19.1517595277222; Fri, 02 Feb 2018 10:14:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517595277; cv=none; d=google.com; s=arc-20160816; b=uxdZS3X+yyZ2kKo5Rzl9K9LuGs+RGOSl4iaXpDCYdP3n1GSndDPNfGWzdiTzbPM+eh EW1FQxXRRMYPHgjVP22AsyPEmKLH/qqdfvSb944w9LDVhDHxtJk3jQQima4Xp5lTsIf+ cPRPMo4HnhTmqFLFc4jA7XnAdNoExyi1aaPBmc5MJVAD5kZ5RChk0X/T1gAAzFEJXg+q ZYmsfmwFU7N0OEK0rZL9IxEHqGoUenBhNJRYVkXi3+EfbjuZCyX6Fp6x63sS7rJsSkxZ uR4bgfZqphHER72xLsW+FP1e33jE28QOJzEQpUmxta8uXTXaCuABYZWG0WHfdYUE4/6x +hxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EMHZ1GlxNb/ezDwehqG7C5QpgmQZ6sRCXAqflso7T2w=; b=u6TkbXIvkT4GJIwpVIiovizt1JsufHZ+YiIVgTIFNIv892ZE9nrpvSzJuhkwD82EwD SxQCWCfMWAz+sd+TkKZ60HsM6NLsnwBR+HF8Cd27+Ty9rJfxZ25R6rW84f8O1lcXHFuz H8fT6she5VgwCmhFzNNHcO3kuZdOxXI+fqsOa7QxDQ7TS/z9oO2AHXeaHOUpAqhXz55W rHPa0K56exJ9MK0WoV4bPOzkqRDN8unW1CYi7tqR4IK7A0DHeNIG9zPmnLxxcuZU1866 RKDhfG0mqhye94WOJw2xIv9rkmaNFVoEY/pMrsLdQWpA4hVPivJpL2zoA4Wd7zI7DWpM V1Bw== 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 y11si1702792pgv.424.2018.02.02.10.14.22; Fri, 02 Feb 2018 10:14:37 -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 S1754125AbeBBSMF (ORCPT + 99 others); Fri, 2 Feb 2018 13:12:05 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36906 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752820AbeBBRHA (ORCPT ); Fri, 2 Feb 2018 12:07:00 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F0DBAE3B; Fri, 2 Feb 2018 17:06:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , Martin Kaiser , Fugang Duan Subject: [PATCH 4.9 85/86] serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS Date: Fri, 2 Feb 2018 17:58:45 +0100 Message-Id: <20180202140830.562797872@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140822.679101338@linuxfoundation.org> References: <20180202140822.679101338@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fabio Estevam commit 38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 upstream. The wakeup mechanism via RTSDEN bit relies on the system using the RTS/CTS lines, so only allow such wakeup method when the system actually has RTS/CTS support. Fixes: bc85734b126f ("serial: imx: allow waking up on RTSD") Signed-off-by: Fabio Estevam Reviewed-by: Martin Kaiser Acked-by: Fugang Duan Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2239,12 +2239,14 @@ static void serial_imx_enable_wakeup(str val &= ~UCR3_AWAKEN; writel(val, sport->port.membase + UCR3); - val = readl(sport->port.membase + UCR1); - if (on) - val |= UCR1_RTSDEN; - else - val &= ~UCR1_RTSDEN; - writel(val, sport->port.membase + UCR1); + if (sport->have_rtscts) { + val = readl(sport->port.membase + UCR1); + if (on) + val |= UCR1_RTSDEN; + else + val &= ~UCR1_RTSDEN; + writel(val, sport->port.membase + UCR1); + } } static int imx_serial_port_suspend_noirq(struct device *dev)