Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1426013rdg; Sat, 14 Oct 2023 01:27:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFvOySETcYjbhlhuStLpjfJHrgW1BNw++BGZ8aM/WaxCrUZriFWs27PZrRkVm85yZ2dkKP X-Received: by 2002:a05:6a00:10c1:b0:690:c2b3:e4c5 with SMTP id d1-20020a056a0010c100b00690c2b3e4c5mr30644962pfu.4.1697272068393; Sat, 14 Oct 2023 01:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697272068; cv=none; d=google.com; s=arc-20160816; b=XuVaxPxw+c7DQs8z2HYFOvj7jquSAuZ9uEfquY/LeeC7Rlq87HcOno8ke3psXdgi9u zpOGXkF7sUobZ34EVF+tiMjlfGJcCeGzfI7Sgluf8tNSTwHTUW2ICtHlSlSBVk+3nE9n 8zkPrXJmx2yy2yR/PRM891H10ORGg1YAfEbwvtzQndcPrHXSz5apdNb5nPQBvNW5zZz8 hmUD29SoJX7Y/i7ffgsP83DFwNd6BMnkv6yLHe9Uh9mgMIkfe/KfDFJfCuLqpgOfJrnB oXwasPFRAjVAc6QulGUOm4G/31ONC//ef2uNBCu0RvHA9Z3cwNaK+JL4WobY2VmAaxP4 DhRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1XpL+b/JmOBaTmsiCjv/RM1XlUoKy/lys1Ba/q5n7g4=; fh=AcGBvC0ffwfnGLqQFQ7OeLPKjw6An2EPWxnUZet3KT4=; b=SXK5CoAzOqVb7ZKD7T09Lg4YCv4xwDQ8UFkTdJrOLvtGy3cg8QNoX0dJS+/NhGAfM1 cxhWhbxpr4+CBoqhxOBbtLwtQ4qxJViFPz3aV3/IuNeYM3N2MhyzIgamZSoRyQd6z4R3 gXkFHaCbWepvivdvDPIbCXv5B8qni4dqRQuHHm0ashExoI1Z7AtIQ1kbuQLa1TLCpOdS BtJwsbmJkmdeKqAQGmvOgxOVDsm/czCEaHQX9vKG4hJ6p6xG8uuIvvqNpT6M67FODtox hXBJ1PXyFB5f9IxnunE0RYa1KSzdERRMIP25nb1dwMkv/dqyyDOGbd2qsj5qCZYCzJdQ 1/uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TfefQNUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f13-20020a056a00228d00b006b6efb7f99fsi2158739pfe.280.2023.10.14.01.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 01:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TfefQNUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6D10C81ADD6C; Sat, 14 Oct 2023 01:27:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232941AbjJNI1P (ORCPT + 99 others); Sat, 14 Oct 2023 04:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232956AbjJNI1O (ORCPT ); Sat, 14 Oct 2023 04:27:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 858FFE3; Sat, 14 Oct 2023 01:27:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D7A3C433C8; Sat, 14 Oct 2023 08:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697272030; bh=V1BVyDUQoZHK7TdSOBG+Mpd59kHxrgHno2ZPA4R71fQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TfefQNUen/ESKXPW5abHufBvSgLmgW8cA07UJGwRmmyWMBTErZuY1eQJJEkO9tVp+ m/sSrXQzPEP1rMyPo7ozLigA9ZCwu0MPyVGqoteh9+szEcaXW7Rg7rKiqD8KJP0JK9 voPwzB/o7VnWmVAsTllvXTCEoMeUraRnDJG0gjsQ= Date: Sat, 14 Oct 2023 10:27:08 +0200 From: Greg Kroah-Hartman To: Pavel Krasavin Cc: Jiri Slaby , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH v5] tty: serial: meson: fix hard LOCKUP on crtscts mode Message-ID: <2023101456-spill-splashed-92bc@gregkh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 14 Oct 2023 01:27:45 -0700 (PDT) On Fri, Oct 13, 2023 at 04:29:24PM +0000, Pavel Krasavin wrote: > From: Pavel Krasavin > > There might be hard lockup if we set crtscts mode on port without RTS/CTS configured: > > # stty -F /dev/ttyAML6 crtscts; echo 1 > /dev/ttyAML6; echo 2 > /dev/ttyAML6 > [ 95.890386] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: > [ 95.890857] rcu: 3-...0: (201 ticks this GP) idle=e33c/1/0x4000000000000000 softirq=5844/5846 fqs=4984 > [ 95.900212] rcu: (detected by 2, t=21016 jiffies, g=7753, q=296 ncpus=4) > [ 95.906972] Task dump for CPU 3: > [ 95.910178] task:bash state:R running task stack:0 pid:205 ppid:1 flags:0x00000202 > [ 95.920059] Call trace: > [ 95.922485] __switch_to+0xe4/0x168 > [ 95.925951] 0xffffff8003477508 > [ 95.974379] watchdog: Watchdog detected hard LOCKUP on cpu 3 > [ 95.974424] Modules linked in: 88x2cs(O) rtc_meson_vrtc > > Possible solution would be to not allow to setup crtscts on such port. > > Tested on S905X3 based board. > > Fixes: ff7693d079e5 ("ARM: meson: serial: add MesonX SoC on-chip uart driver") > Signed-off-by: Pavel Krasavin > Reviewed-by: Neil Armstrong > Reviewed-by: Dmitry Rokosov > --- > v5: added missed Reviewed-by tags, Fixes tag added according to Dmitry and Neil notes > v4: https://lore.kernel.org/lkml/OF55521400.7512350F-ON00258A47.003F7254-00258A47.0040E15C@gdc.ru/ > More correct patch subject according to Jiri's note > v3: https://lore.kernel.org/lkml/OF6CF5FFA0.CCFD0E8E-ON00258A46.00549EDF-00258A46.0054BB62@gdc.ru/ > "From:" line added to the mail > v2: https://lore.kernel.org/lkml/OF950BEF72.7F425944-ON00258A46.00488A76-00258A46.00497D44@gdc.ru/ > braces for single statement removed according to Dmitry's note > v1: https://lore.kernel.org/lkml/OF28B2B8C9.5BC0CD28-ON00258A46.0037688F-00258A46.0039155B@gdc.ru/ > --- > > --- a/drivers/tty/serial/meson_uart.c 2023-10-12 15:44:02.410538523 +0300 > +++ b/drivers/tty/serial/meson_uart.c 2023-10-12 15:58:06.242395253 +0300 > @@ -380,10 +380,14 @@ static void meson_uart_set_termios(struc > else > val |= AML_UART_STOP_BIT_1SB; > > - if (cflags & CRTSCTS) > - val &= ~AML_UART_TWO_WIRE_EN; > - else > + if (cflags & CRTSCTS) { > + if (port->flags & UPF_HARD_FLOW) > + val &= ~AML_UART_TWO_WIRE_EN; > + else > + termios->c_cflag &= ~CRTSCTS; > + } else { > val |= AML_UART_TWO_WIRE_EN; > + } > > writel(val, port->membase + AML_UART_CONTROL); > > @@ -705,6 +709,7 @@ static int meson_uart_probe(struct platf > u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */ > int ret = 0; > int irq; > + bool has_rtscts; > > if (pdev->dev.of_node) > pdev->id = of_alias_get_id(pdev->dev.of_node, "serial"); > @@ -732,6 +737,7 @@ static int meson_uart_probe(struct platf > return irq; > > of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize); > + has_rtscts = of_property_read_bool(pdev->dev.of_node, "uart-has-rtscts"); > > if (meson_ports[pdev->id]) { > return dev_err_probe(&pdev->dev, -EBUSY, > @@ -762,6 +768,8 @@ static int meson_uart_probe(struct platf > port->mapsize = resource_size(res_mem); > port->irq = irq; > port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY; > + if (has_rtscts) > + port->flags |= UPF_HARD_FLOW; > port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MESON_CONSOLE); > port->dev = &pdev->dev; > port->line = pdev->id; Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot