Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7281738imu; Wed, 14 Nov 2018 14:49:10 -0800 (PST) X-Google-Smtp-Source: AJdET5ch8oKco7BkWWBdKmBVJK0G4hmjSo7UKftJW6HSp632XogA+A/8koISe86jg5PeTK0EEBIG X-Received: by 2002:a65:4904:: with SMTP id p4mr3528615pgs.384.1542235750895; Wed, 14 Nov 2018 14:49:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542235750; cv=none; d=google.com; s=arc-20160816; b=Rir4NdvH0LsTS+0N7tbsyzYUImjAJeECmKDSdJmEA2dMlO0IZY6LEeBtB8D5W1kSqy v8WCIYd+asFKT2dtZ72NSSb4QSm1Z+Rp6N8KmP0VDZx0koyneij0WzEq7VF/ybV9OdsL SxARDQWx6rspjXjkqy1VFXIyDxoZr41bzcxmQ/1sRnHCFimH0X/0B2RDtIG92QEa+axH 2IqCl9+Ig2ItBT51vSqLWi8CPFyQ9BEjrnz9n2DAQv0/6mtQXmfosu1V/YyBV0TANiuQ FW6DjUgB4IxopVYXrZ8uApwsUMNeKI2+qQEN11qqFU1qjkRsK0QlT1NO2sQDyUG//Ljq 7I+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=D5FaB88scnUAGrgOqpair9z5SJrcwoNb5DVQrb2U6kY=; b=JEk2hV67iLDTbZLVOG019rVPFHg3ucV5cpnNKWJBLDPnPC6AAn9kqQPvM3l2pV2V7+ wST5CIV6O7CYSG9rqQDb4pq7CdDcbYpYh3Xnn8PAJoG/4nkVfv1YFYgbRPeDetap2G2K R2Ol7XUWL/UqvVKMFj7WD17u72dLwdCGn7AHJnLZd10qcp3iq3hufw9IIR/WiAFexlzx TDEwEswVaMzVkKqoN3QeW9svlyZzHSiB7b8ndx7q1q7uv/BA9UwD3M33Fv46qVuuG4D5 7+aAEc9CuZ9YMZFyoeiq5Lk5/jQ5y9MZbZyP7waLn5BSdtyTxYZRmYhwJAhMwpL00UBU 99GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LtVjBMr2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37-v6si25206491plb.167.2018.11.14.14.48.56; Wed, 14 Nov 2018 14:49:10 -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=LtVjBMr2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbeKOI1M (ORCPT + 99 others); Thu, 15 Nov 2018 03:27:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:34364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbeKOI1L (ORCPT ); Thu, 15 Nov 2018 03:27:11 -0500 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79FAC223DD; Wed, 14 Nov 2018 22:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542234128; bh=C+47D2OYjB7bvRO7f0Ls6LQwIKUD0ykaGlTWN2a2jUI=; h=From:To:Cc:Subject:Date:From; b=LtVjBMr2oC+k7T6SvR9VRDvNFMwod7hBtCI/3zqjVxlHYe092hGfHmO/fkyATxDOP wnHrFJy3OUR7lFuzzq91rVtbXNXHwSvXQkRMSInBoGSOkuSv+NWx5bcvKY7Q7KHY+6 M0U59pOuK8rqwdCABHRZskWR1/pWR23ujTqFTks4= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 01/73] serial: sh-sci: Fix receive on SCIFA/SCIFB variants with DMA Date: Wed, 14 Nov 2018 17:20:55 -0500 Message-Id: <20181114222207.98701-1-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven [ 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 ab3f6e91853d..e19bfbba8a01 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