Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4515002pxj; Wed, 12 May 2021 07:17:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyov6UMW2jKoCXi6cb2eBrJf4m5TcSSgZy42PCdnUrd+ALThaKzrzb0j82+f+J9OZiqOcc9 X-Received: by 2002:a2e:9b51:: with SMTP id o17mr28485342ljj.320.1620829029369; Wed, 12 May 2021 07:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620829029; cv=none; d=google.com; s=arc-20160816; b=z/TIkjVN2/dYFDNU0MeOdxgp0S1F1mtNodsye6r3uFKZEcATc1aFIqW6/dkPYO9Kif uHwhrkIUPXUbg68hK71OECJVFTI4tSQMpo24cgh1l0lXlma/wugOqsb/1ryU3qpMcnfu OiTw+RtZQqRjuFKWGH7mpgR27bw4dmVyfWeifq0ZkgRl3Vz5EX49UowzRnlUNGF4KT4f fyNmUn4SlgiGBMogFajBow4LwuBj94kzv6M2SKogtnh/hJutCbyZVyZgXD2qfugyz/Qc 5vJYyoqu93/OPNhJrYmJNYUWGS2yTCJDtP0aCl5CdcnV8AlyDrxguquNM4s5CnBXnPDr N/eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cPGkhq/BSP3LqTLYGR9T4LGJDXj4OLPuBBkkFMuOrqY=; b=NULTj+pY9wXd85cltdVz9NIYCCjjPlsRCUeZNDpS8J7a0P/Cvt4NoMmHTOhO/OeDYv jJvCm9JAXcDh0gZwafLSoL/qA+Mn9gWn3oXX5DaT/oY87RK0mtWuup4MHi5uXaX61VxZ fx8yqXNl5wBHm+p7dazTl6mOIrUyzY68PM+CqM8kQlKnhp2ly2XAEQo3y4Q+hgqwia9x 3c6AOU3Fc3Tm3RJY+H2VbMoVY4jVYTHnKQPECaGhHc1w58UHib0nZyEN7yN+dULws9/m Xfb3NQUGx4HNVfir5kZKTt2++4L8UJLnH+/02vQ9goztexk+Fu1XiJtrp+qGjsMG7qz0 wZ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ZkdYqzQb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u28si431lfm.546.2021.05.12.07.16.39; Wed, 12 May 2021 07:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ZkdYqzQb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231203AbhELOPd (ORCPT + 99 others); Wed, 12 May 2021 10:15:33 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:37491 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbhELOOS (ORCPT ); Wed, 12 May 2021 10:14:18 -0400 Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id D5EC32225B; Wed, 12 May 2021 16:13:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620828789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cPGkhq/BSP3LqTLYGR9T4LGJDXj4OLPuBBkkFMuOrqY=; b=ZkdYqzQbY8Nb7BNiheV3T0G+5i3ReRFHj5pE77IPIK9nBw+eTPZy/hiO0GAmGSCvF2qP2+ p0VsUFPEcYz8ZjdVxVCods3UxNIshP65+jiJzk7y17Z8E6lLXTzeiGqy9rGGYNglN9rrU+ RrRzjk6Myh/v+Dx1b4+e6Z+LUilTTYs= From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Johan Hovold , Philippe Schenker , Michael Walle Subject: [PATCH v2 9/9] serial: fsl_lpuart: disable DMA for console and fix sysrq Date: Wed, 12 May 2021 16:12:55 +0200 Message-Id: <20210512141255.18277-10-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512141255.18277-1-michael@walle.cc> References: <20210512141255.18277-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SYSRQ doesn't work with DMA. This is because there is no error indication whether a symbol had a framing error or not. Actually, this is not completely correct, there is a bit in the data register which is set in this case, but we'd have to read change the DMA access to 16 bit and we'd need to post process the data, thus make the DMA pointless in the first place. Signed-off-by: Michael Walle --- Please note, that there is already sysrq/break support in the 8 bit version. But I think there is a race between the hardware DMA controller and the ISR in this driver. I'm not sure though and can't test it. Angelo, maybe you could test it, I'd presume with this patch you don't need the special handling in the ISR anymore. drivers/tty/serial/fsl_lpuart.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 1ed019d91177..0185bb8b6000 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1587,6 +1587,9 @@ static void lpuart_tx_dma_startup(struct lpuart_port *sport) u32 uartbaud; int ret; + if (uart_console(&sport->port)) + goto err; + if (!sport->dma_tx_chan) goto err; @@ -1616,6 +1619,9 @@ static void lpuart_rx_dma_startup(struct lpuart_port *sport) int ret; unsigned char cr3; + if (uart_console(&sport->port)) + goto err; + if (!sport->dma_rx_chan) goto err; -- 2.20.1