Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5616966imu; Mon, 26 Nov 2018 03:04:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/XqTnD9PlGaY4kcWvq2y4RJOULbLocl8KG2MQ/vdRnlU/QVo3FNvI8+tjZWCX9rE50Cmsff X-Received: by 2002:a63:6445:: with SMTP id y66mr25014894pgb.250.1543230251605; Mon, 26 Nov 2018 03:04:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543230251; cv=none; d=google.com; s=arc-20160816; b=gJoHv4VbB19zw2T+8GS+JAo/TINlFjpp8u0PNBtAifkTd5e8sVCZdT7kKhxwpBoIWY 0VmqUYs6l7xx6aHGRcTvtXEkJyYVKlFv14ZL82f/5ES99MKjQTrCrZS9lx2UzBAeeZc3 sQ2c43UqQWIs7yZl/jsnBplbrVddbNV3wq/wNiD4qoZiy/1limch/Hn//4Lm6WKOqW8S 8Jfl2szXKeLezLH5dKsdxY77Vjq7spoR5oeD9ZLjmuIKBBqrbr5hZ7HKktG7XUQ3bofr SghFYsVWcr4yb8+fvN3XY40FAccwLWICK97By67oXVPV0rMTJS6lrxRUiCECcMk1foJV NtPQ== 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=UlrYoA23qd89VSFILPuW/UiQw//17oMWP6VEEV9p+1Y=; b=dGRCKEtUVHHUt2T+s0INm/myHk8kKjSc8vKEbxgNlrMFg+6p14X+OTugR7UI34MvEo be7AqcpY2H+BHkQHiO2BwPGzKXJXdLWL0LYDhZ1yhCPUNFM/zyVeWy2TdAM4/vrNhah9 ZOcusE/PbaT0Yg/baiwYXaefv45RN1KFzkJjcRcCiGaht5WCxKI4cSsYGqoPFMK+a+tV 70RdCtTAW6bUx0ap7Q/qnP53KGs4bgLOOvPvvAv2O5jYXvGvi6UbdUYJMJt465BOpnPU 7yHr0dZADIHXe6WFYfrXb8ctDmFn1XNIKmdX+5FcmvZuQ8b1/xBRl7wkglwjYTju6VXj 3pkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PwrZnFHQ; 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 f4si15674381pgg.492.2018.11.26.03.03.54; Mon, 26 Nov 2018 03:04:11 -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=PwrZnFHQ; 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 S1730567AbeKZV4e (ORCPT + 99 others); Mon, 26 Nov 2018 16:56:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:39902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729290AbeKZV4d (ORCPT ); Mon, 26 Nov 2018 16:56:33 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 F190021104; Mon, 26 Nov 2018 11:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543230168; bh=EPAxqVIfuKBje7BY4dkySFcOZhqu2H8hK5EANgoRQF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PwrZnFHQvgBa8Io65CyM0EFji6MHbcyNO1bHjVTvPdNczK+/SkkAefhO/2Qj/H2V7 Gk8vDMoJypQVfrMnvqeVb0NvZ6DTh9pZTq7oC4dQS/UvFSwrcRdxlYJNqvzQeQJhex f4uNEZeqvYKLrKh3S5GmPcv6Fl0kTtxJCbAojQyQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Geert Uytterhoeven , Wolfram Sang , Sasha Levin Subject: [PATCH 4.19 032/118] serial: sh-sci: Fix receive on SCIFA/SCIFB variants with DMA Date: Mon, 26 Nov 2018 11:50:26 +0100 Message-Id: <20181126105101.174510502@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105059.832485122@linuxfoundation.org> References: <20181126105059.832485122@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 202dc3cc10b4d37e5251431acf8d5040a8876c7d ] On SCIFA and SCIFB serial ports with DMA support (i.e. some ports on R-Car Gen2 and RZ/G1 SoCs), receive DMA operations are submitted before the DMA channel pointer is initialized. Hence this fails, and the driver tries to fall back to PIO. However, at this early phase in the initialization sequence, fallback to PIO does not work, leading to a serial port that cannot receive any data. Fix this by calling sci_submit_rx() after initialization of the DMA channel pointer. Reported-by: Yoshihiro Shimoda Fixes: 2c4ee23530ffc022 ("serial: sh-sci: Postpone DMA release when falling back to PIO") Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/sh-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 3649b83ef863..effba6ce0caa 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1614,10 +1614,10 @@ static void sci_request_dma(struct uart_port *port) hrtimer_init(&s->rx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); s->rx_timer.function = rx_timer_fn; + s->chan_rx_saved = s->chan_rx = chan; + if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) sci_submit_rx(s); - - s->chan_rx_saved = s->chan_rx = chan; } } -- 2.17.1