Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2757286imj; Mon, 11 Feb 2019 08:02:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IaJrHrwTUu+6IKv0aHcFw3NROncK65yhBYXIEmQjKeuip7UnkTLuAuHOVUtLyET2wghKiPt X-Received: by 2002:a17:902:758f:: with SMTP id j15mr3293053pll.170.1549900967786; Mon, 11 Feb 2019 08:02:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900967; cv=none; d=google.com; s=arc-20160816; b=ZBdztVhDsGWQfVY7nCy/TIqtpVUUXJ/YABksre7K4ohom09T4bzrSL4MJfu9AlAqcN gZMlTCc5BxiBr2A628UNsyWvDTP4O+PaYTxgN1iEw2EpbB+hLYrA0DOyH+hHAc1bMDqy 82sajXsBtrOAV9jMw2BHs8EhB2gy2e6uu1Goek3Of9kOMGBnG/RrpKIm4W7ElTBch4U6 nOoGXbWsZbjfH2Woc6EUdfoToryt1XLTqQeJlQl0nne9Fnb3S0cBMZPM+tcs5AFbsAyF ULkaqbc5ebEcvayg8YjDHUPQnamkI/9fNoIanuYre1iIcYeEzOF6IkXwTbdk1UkPG6B3 lrZw== 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=WcNneXPsh+8TFSewxyRvr5DdvLB0fYKW/btwt0g6e60=; b=tLnccwHfVXVzmmHTsVwjueAwNjI95+Dex4KMj+aZCPH2UyEidb34uM58w2+CHJgANT cA2BQ2i2ImyPI3Nr/7DVoNsvrwOZShghwv12OzlvNcPoWhsIVv64DIlZY1mT2tU3MrcP LdPUY0jLCXd6TNMh6jfBQlqZCuAXmb0iTzUGYYEirFR3dbO9ss1RUVnsOeaO2/zu/VEp /mmocQMDWDzyVDq7AE7a3iiVLV99Xeqdfjjk2JdPIUHDFXC0QLB/ZltuzWF3Zl6E0ZCE h0Z3t6RIVCNWICD+XrRupiIyKLZkZjecFYMWdzSnMv0fV7BxCgH4hGlGKyARhP4Waoq7 HM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t8e829+8; 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 l9si9577989pgj.543.2019.02.11.08.02.27; Mon, 11 Feb 2019 08:02:47 -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=t8e829+8; 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 S1730247AbfBKObK (ORCPT + 99 others); Mon, 11 Feb 2019 09:31:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:37830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730241AbfBKObH (ORCPT ); Mon, 11 Feb 2019 09:31:07 -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 C612B20675; Mon, 11 Feb 2019 14:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895467; bh=D+vhLWJYRHFnrnTCB3LuxHeOXUWvnVhZ2cKZDFu9r2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t8e829+8PNaqUy/UM06JkRCf4Q9q0NkWGu6s0IjZJCjI+mlxLIhvvq4GGyaS+8Qkd S9JciBoniMkKI/c7HJ7PMpmOLqClfGT4UAIoPL9jKtAc4ZvlEL6gkWQBEOatAND0vk w661u+BTjEBXYmsr9j5FyRv+BwGoAy47Jdtb4sD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Simon Horman , Wolfram Sang , Sasha Levin Subject: [PATCH 4.20 183/352] serial: sh-sci: Resume PIO in sci_rx_interrupt() on DMA failure Date: Mon, 11 Feb 2019 15:16:50 +0100 Message-Id: <20190211141858.751418868@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 71ab1c0336c71ace5725740f200beca9667a339f ] On (H)SCIF, sci_submit_rx() is called in the receive interrupt handler. Hence if DMA submission fails, the interrupt handler should resume handling reception using PIO, else no more data is received. Make sci_submit_rx() return an error indicator, so the receive interrupt handler can act appropriately. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Acked-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/sh-sci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 613007d7165e..21fd3f6ad28e 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1331,7 +1331,7 @@ static void sci_tx_dma_release(struct sci_port *s) dma_release_channel(chan); } -static void sci_submit_rx(struct sci_port *s, bool port_lock_held) +static int sci_submit_rx(struct sci_port *s, bool port_lock_held) { struct dma_chan *chan = s->chan_rx; struct uart_port *port = &s->port; @@ -1359,7 +1359,7 @@ static void sci_submit_rx(struct sci_port *s, bool port_lock_held) s->active_rx = s->cookie_rx[0]; dma_async_issue_pending(chan); - return; + return 0; fail: /* Switch to PIO */ @@ -1374,6 +1374,7 @@ fail: sci_start_rx(port); if (!port_lock_held) spin_unlock_irqrestore(&port->lock, flags); + return -EAGAIN; } static void work_fn_tx(struct work_struct *work) @@ -1668,8 +1669,10 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) disable_irq_nosync(irq); scr |= SCSCR_RDRQE; } else { + if (sci_submit_rx(s, false) < 0) + goto handle_pio; + scr &= ~SCSCR_RIE; - sci_submit_rx(s, false); } serial_port_out(port, SCSCR, scr); /* Clear current interrupt */ @@ -1681,6 +1684,8 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) return IRQ_HANDLED; } + +handle_pio: #endif if (s->rx_trigger > 1 && s->rx_fifo_timeout > 0) { -- 2.19.1