From patchwork Fri Jun 21 15:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 13707795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4CE0C27C4F for ; Fri, 21 Jun 2024 15:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=oOPm3vCa0hebn5PQU85PCCbT9jGBNVDgsMo+2JVto90=; b=ZvAKIvxDMgQYLuubG1tkAvQJAy Mq1LNI7T6XY04G7qqHzeiIv4gTtX/02GGvQ+cSQ4ypG78UdKCDbaBnnfPncK0Yje821tdNUil4nNU 3f2N+hjxvcNhXB0g3yjEBNBx23VDqTw5tuqgFPvCUIEkYI1zQsF7tu9blcDdBXAMYF2i6DYVqYfhQ NGD+7zMX/Rj4QUGeIdjEmDofqA7wD/+h0n1juWHhHoKtYqmdNLuPd/KazFUdbw3tbcp0UsnvOyMJ2 hCm+l8txOOguTTX3PrvhcD6BBvH97MJeJrszGw8/aIWRIvp5bXTUKZ9kaHFzEKj7Vd+2+kI1bzHMR U0OaLzQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKgLj-00000009mHx-2bUb; Fri, 21 Jun 2024 15:38:51 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKgLg-00000009mHM-03dd for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 15:38:49 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-421d32fda86so24259165e9.0 for ; Fri, 21 Jun 2024 08:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718984326; x=1719589126; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oOPm3vCa0hebn5PQU85PCCbT9jGBNVDgsMo+2JVto90=; b=b5/C8bMEmd+7FKtu8lPya5r+R3gYLA3Ob2KZa0wSZdSNnEFW9v9iQ8cGLvEjNwMo6Z fnSN8zVzeqzmolRSN3bfW+x9nHQgDUs1EvsKy6xJUZjj7mBzTRtBj3ebFWJCqbsbT5yY 9bZbIzZjQPrnG+TW+3xpgEROikKMECbOvlm5pURaMgyWgSPYdAR8sxz5j09q0AXV9tJa PRU9r9TY9K57sgOk7SCWkDkhe7uZXmsPJzuCPT0qx0KcB8uMEanZcMCKagAnrLBx/B6q 8ZMz3QM0qZy5uFR4ncf7hLwOpENEEjGBgkJ5/tCWjQrrBXWZufPsuCJJ75n84gaEwEdl 33yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718984326; x=1719589126; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oOPm3vCa0hebn5PQU85PCCbT9jGBNVDgsMo+2JVto90=; b=Tbz3rzFI4lQe0GxC2FrNuBd8qjHbezGdXS4YsqEai7dTKegWcfpVmphXYQAgOEeL7V 6aQTf6wnPYE9jLtIu7Qk/yFjmAIQs+3sIm2cykMiO05koaGOCL/HxY/2UgTW95OTLWa3 us7fORWupWqLUDSKe8B1wg1VqAl/0ondIsE2rtepytBj2n3669qpe/znsdLoCF8URXSW oQ/lkJpFawIvta5Kw7bULa/TMtrMqoruP8h/hxTSTxB/wuup+uG6vNUJQ0gPAicelhnv 4AJFEsBs6aZkDYssHd79tk85oG1OwObmF9O7O19ZP8T3BUJyP89og95J6fbU20n5QUsf Spfw== X-Forwarded-Encrypted: i=1; AJvYcCXxrxZ1krJuETFdoDnBVew5UzSn5tnaAMZ2yTfASGJQR9y4D00UT1PugbTMml9SNKLO2y3IsTmnI8az8aOE0vn9wFdqq9qIRWlhQEKjsEg0s+jOtvs= X-Gm-Message-State: AOJu0YzI4Z64q5a8JmLpaKuHjQmRsj2oFFlg1fc0DuKspnpGMFi2vTJO SDuypR5QzV5DF6t8P6YrM2DChGlHy15iaow6pbVorXoq1jSRk94F X-Google-Smtp-Source: AGHT+IHuPmxHPN0gA69T7fWEolN/fR1P/BeIEUc2ajvI/YlolQuTbQvkvhMs5isoyekjPRiuDRSXow== X-Received: by 2002:a05:600c:314a:b0:424:82eb:7270 with SMTP id 5b1f17b1804b1-42482eb739dmr22422585e9.32.1718984325542; Fri, 21 Jun 2024 08:38:45 -0700 (PDT) Received: from eichest-laptop.lan ([2a02:168:af72:0:b162:502a:9bd1:4c8b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d21226asm69793115e9.47.2024.06.21.08.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 08:38:45 -0700 (PDT) From: Stefan Eichenberger To: gregkh@linuxfoundation.org, jirislaby@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, l.sanfilippo@kunbus.com, cniedermaier@dh-electronics.com, john.ogness@linutronix.de, esben@geanix.com, rickaran@axis.com, tglx@linutronix.de, stefan@agner.ch, francesco.dolcini@toradex.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Eichenberger Subject: [PATCH v1] serial: imx: set receiver level before starting uart Date: Fri, 21 Jun 2024 17:37:49 +0200 Message-ID: <20240621153829.183780-1-eichest@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_083848_081102_0F1A578B X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Stefan Eichenberger Set the receiver level to something > 0 before calling imx_uart_start_rx in rs485_config. This is necessary to avoid an interrupt storm that might prevent the system from booting. This was seen on an i.MX7 device when the rs485-rts-active-low property was active in the device tree. Fixes: 6d215f83e5fc ("serial: imx: warn user when using unsupported configuration") Signed-off-by: Stefan Eichenberger --- drivers/tty/serial/imx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 2eb22594960f3..f4f40c9373c2f 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1952,8 +1952,10 @@ static int imx_uart_rs485_config(struct uart_port *port, struct ktermios *termio /* Make sure Rx is enabled in case Tx is active with Rx disabled */ if (!(rs485conf->flags & SER_RS485_ENABLED) || - rs485conf->flags & SER_RS485_RX_DURING_TX) + rs485conf->flags & SER_RS485_RX_DURING_TX) { + imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); imx_uart_start_rx(port); + } return 0; }