Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3839288pxj; Tue, 11 May 2021 13:04:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKRx0EUaujdEz59f8GKmJnJzrlB8nh2O87cSqFrwJf5f/b8fug1XMq+L9CXq7TohILfxFt X-Received: by 2002:a17:906:b2c1:: with SMTP id cf1mr24156965ejb.544.1620763489803; Tue, 11 May 2021 13:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620763489; cv=none; d=google.com; s=arc-20160816; b=XchCXrklxgRoRsj3Dat9wpPeDAsgayDC1Q0SSIO330cga2u8a35vEnHvckEEAyFoCu R5NC4EKPo5oYod3SSqi/erZl3aaezTU0HIG+NA9IA88TBUNDZoLmCNNRUfKsocg9sYj3 ypoT4cfiYlNrmoFo/4ZoLdAKxSHiUWGjk3IwdVDrLfAV7hIotvhDS2HRNZ2Lmpvtx2Bf q5n7iFTEBBUIf6ULjWse47sZOK6IufW99OLY7gBE/no5uEV9i0j43I6CrZCK695ZFIOK uo0fKBG86g3DiFyPAk6NbVkotHiq1yCYHNdqRVMa3VE0f7RM6a+aLeb5/RkjqRFanca/ OMTQ== 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=bpC5h+RGCxqSox5jcjtTVP73L6OxFQvqjFmByEMdXg4=; b=W9tYgrjogsA7gL6c3xFbjtccF6i5oTSwWbcZszFm0wxlieA5YG4cS/17rVRYzCzXNM Z81rSK6WvghYDjYIMdo7Grv3VJ9ArRgZgvw9pRoAq88Db/aZT6TVK5EeIFMtbbIeCjPd 2OdSCnOfhRgH/nBIN5lDa1J6GcmNAG8hTz2qmXD/Tiw/PC2f24ms8TBRqd0jkv7OEOVt Ub7SCgmgYQzJ5eimry/u2D17DBtTeQwT4WGDaAqPwAoyWAhQIEjlTiMlkbbrc17tbcFA 96KJM71TlFT0vRgpC5V2+91g2vHry3M4qFpozBUZ9/W2aH9bGNs8r9Zdo+IHcF+3AuI1 dwkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=HC2xSBCI; 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 x22si17071943edq.266.2021.05.11.13.04.24; Tue, 11 May 2021 13:04:49 -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=HC2xSBCI; 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 S230225AbhEKUDa (ORCPT + 99 others); Tue, 11 May 2021 16:03:30 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:47565 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbhEKUDN (ORCPT ); Tue, 11 May 2021 16:03:13 -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 1B8352227B; Tue, 11 May 2021 22:02:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620763325; 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=bpC5h+RGCxqSox5jcjtTVP73L6OxFQvqjFmByEMdXg4=; b=HC2xSBCIDU7de8p2Rmo6fFYoQ4SCIM9DDkQxYq+TGetz1xmENUcPrJrGdH9U/8uk8DLuWe v/DcjWoCiKlt67rMRgN1y5xNig3XpkyXCHO4yzbGWt4p3LhjszEruZlJDi5DY92qHnfey0 styhmfTPUrcFkKnZlnx1N/Zl01OFAak= From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Fugang Duan , Philippe Schenker , Michael Walle Subject: [PATCH 8/8] serial: fsl_lpuart: disable DMA for console and fix sysrq Date: Tue, 11 May 2021 22:01:48 +0200 Message-Id: <20210511200148.11934-9-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210511200148.11934-1-michael@walle.cc> References: <20210511200148.11934-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 5e66f628e895..bf869c8d0897 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