Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5437234rwb; Mon, 21 Nov 2022 23:13:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf47BMKllxloLUprtGBVebB6BH+IfFK9+YCLSOTB6faHvJZamTN+psnhdg5ht7SlW/EI4BUV X-Received: by 2002:a17:90a:ca09:b0:213:53c:3b2a with SMTP id x9-20020a17090aca0900b00213053c3b2amr24581383pjt.113.1669101203692; Mon, 21 Nov 2022 23:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669101203; cv=none; d=google.com; s=arc-20160816; b=J+HAThISlrtsn0wEF2lBhFWbZef97I2BYz2UsDUzvm4HCqxgkq8Ddu0oOfm53KFcX9 ZvXpAesB3FH1OQgA11os4ekbxIYPTth0YO1INB0EaHz548d6l679Mw+JJPlbEk4mlGpE KV5MOV9VDyZkA1i6w3XDVuBxQvnHUIGVcBTvMXlBw3M+REfctk4P3aivfwN4MKIl0dUy onqOlkzbp2tk4UrUBuHYZyB0ky67iGLbChQIwJ/aACzFD0Y90PPtGODYuP4dIk2tAXTu tysMU+oqCUJ7EanrZDNhYil/8E25tvoC8+uzd9WZs04WTELC3A/53VMqDzJXdsQZuavC kiIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=obhyf6FbeDYJ4EzUmao9xEvzmssDDgcxntsnLOZ5F7g=; b=vOJ/e4Iyd8zzfHEWdJn1GEKWvJQEn5FOvmClgRnKbr5EMMtiZt2jMGlLBqMrE8yEvF 5LmXXhLH5E6YLTIRf3UA5nMjAv8wu5typec9D6lOlFjHnpg1J7uAR908QM2bU4tSRQvh 2Gw50ZLVagP2/lNYBbvFvjtdEUXCY3I8w2AaGWLA7ubKF8lEk+X2/NCQUtC85W02ssBO Dt+eDHhAKxcs7CZ81cr+8uG+L9qOUKruiTE5AQiVGv5zd6pl7BeVqM9vMbHDTqwiRZMy difu4/bHntmqIA/siwsUzW03xepnQgsf1YakTkF/vpeK9oc64e5YfUurIODPNE0yCEVz F+XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a17090341c100b00188f4cec43csi16029114ple.260.2022.11.21.23.13.11; Mon, 21 Nov 2022 23:13:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbiKVHCK (ORCPT + 92 others); Tue, 22 Nov 2022 02:02:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbiKVHCI (ORCPT ); Tue, 22 Nov 2022 02:02:08 -0500 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC39F23BF0; Mon, 21 Nov 2022 23:02:07 -0800 (PST) Received: by mail-ej1-f44.google.com with SMTP id f27so33722478eje.1; Mon, 21 Nov 2022 23:02:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=obhyf6FbeDYJ4EzUmao9xEvzmssDDgcxntsnLOZ5F7g=; b=ZgQzUOvf1AG4XRU9QvCfO/xuBT0LzT8i9dqulbVwlbeSvr/oyg53SSDEpHRO7NkaUe +X6qF0eceb33pRteladirlW+QNZAOiEjN0BfaAcr+yXxGQltSRB7cUExmmUHYBWadI6+ JqhHvkpC/QbOoZudGzre1BIheWOC+l15RIfrdohHoAeeHvdvuzOx8VoLkZHPX5GvcuRi mAMOiPWa78P7kZtRPSwui55xBDK1wahWRrM1jvR3NQghapkbck5Zh3KqBeyB98/lryjC 0EahdalbLMUW7IyW8QoeKbzPIqIe1WWioHrck2pCwaIzGJUCmx/Zu/7VX2AI+As0/Uem gEJA== X-Gm-Message-State: ANoB5pn5cDU1cbokLHDIrkOllXbOB5u/f14R3saCPeD4qt/t7G4dfr2q NMN7n9tWODXchD/DnWfXeeX4NPqKYYrSsA== X-Received: by 2002:a17:907:c208:b0:7ad:79c0:547a with SMTP id ti8-20020a170907c20800b007ad79c0547amr8621315ejc.41.1669100526244; Mon, 21 Nov 2022 23:02:06 -0800 (PST) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:49? ([2a0b:e7c0:0:107::aaaa:49]) by smtp.gmail.com with ESMTPSA id b14-20020a17090636ce00b007a8de84ce36sm5751620ejc.206.2022.11.21.23.02.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Nov 2022 23:02:05 -0800 (PST) Message-ID: Date: Tue, 22 Nov 2022 08:02:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v5 2/3] tty: serial: use uart_port_tx() helper Content-Language: en-US To: Michael Walle Cc: afaerber@suse.de, alexandre.belloni@bootlin.com, claudiu.beznea@microchip.com, festevam@gmail.com, gregkh@linuxfoundation.org, ilpo.jarvinen@linux.intel.com, kernel@pengutronix.de, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, liviu.dudau@arm.com, lorenzo.pieralisi@arm.com, mani@kernel.org, nicolas.ferre@microchip.com, richard.genoud@gmail.com, s.hauer@pengutronix.de, shawnguo@kernel.org, sudeep.holla@arm.com, tklauser@distanz.ch, vz@mleia.com References: <20221004104927.14361-3-jirislaby@kernel.org> <20221121202724.1708460-1-michael@walle.cc> From: Jiri Slaby In-Reply-To: <20221121202724.1708460-1-michael@walle.cc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 21. 11. 22, 21:27, Michael Walle wrote: > This will break serial output for the userspace on my board > (arch/arm/boot/dts/lan966x-kontron-kswitch-d10-mmt*dts). The uart_port_tx() > helper will call __port->ops->stop_tx(__port) if uart_circ_chars_pending() > returns 0. But the code above, doesn't do that. In fact, removing the > stop_tx() call in the helper macro, will fix the console output. > > Any ideas how to fix that? Hm, so ATMEL_US_TXRDY is removed from tx_done_mask in stop_tx, but not added back in start_tx. So the tx interrupt is never handled (the tx tasklet is not scheduled to send the queue chars) in atmel_handle_transmit(). Any chance, the below fixes it? diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 11bf2466390e..395370e0c77b 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -596,6 +596,8 @@ static void atmel_start_tx(struct uart_port *port) /* re-enable PDC transmit */ atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTEN); + atmel_port->tx_done_mask |= ATMEL_US_TXRDY; + /* Enable interrupts */ atmel_uart_writel(port, ATMEL_US_IER, atmel_port->tx_done_mask); thanks, -- js