From patchwork Thu Jun 6 19:56:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Brown X-Patchwork-Id: 802246 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E733D71B4C for ; Thu, 6 Jun 2024 19:58:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717703906; cv=none; b=cFj+fLLHG+MZVlgHxUBqsSkPO7ROQYJSvtCsMZwuldwuaZR526gDlvEBU6v+jmzfIGOHeeLJZnprz77XUmEcei582X513oNH7yMqu+6TG+4qSe67VEiOzJhpewjPedVq83vAy1xs/uPypESs7PoWFvad76T7034JEhFBMHbm1R4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717703906; c=relaxed/simple; bh=Vs2VSZfdTFzFBYmrEYnYORUiXjngtp2QIi7p2bd1T9A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qPjBCKLQBrDTC9hhBAp1PF5S+q58J8D6vbYOjH3FIuix4dcUm/5s2K6OpgYz3sV4xPtSRHIPsobTKn44g4dWM/sRryOR2IsssG+N35HWRwwkmTDDfUmaR3wyL6yVSxK+UDMUVD+dZHD5NExgLjCWMh9is0Bb0e7hiAMwIVVchRw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=schmorgal.com; spf=pass smtp.mailfrom=schmorgal.com; dkim=pass (1024-bit key) header.d=schmorgal.com header.i=@schmorgal.com header.b=Zvfs0+og; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=schmorgal.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=schmorgal.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=schmorgal.com header.i=@schmorgal.com header.b="Zvfs0+og" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-6c87835b8c5so170729a12.1 for ; Thu, 06 Jun 2024 12:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schmorgal.com; s=google; t=1717703904; x=1718308704; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E0/VzEhoXRFXg030r8DGFCIJL7QCo862n6SDAAE5DMM=; b=Zvfs0+ogTLAn6S8GUz5ppAobvly5DGWEbwsXgGPmJ/Err3RiV+7H4sKbfGU6tKE4z7 yrhk6VKN57ab8Sf8gPtesR5DQoTcEoRZrpskgpu09zRrsV4aCTz62gxBmdw5dbQ6MKpu vNH/Bq+RL3uZKbuh+8oeXWHhOCOi7AOueLaX8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717703904; x=1718308704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E0/VzEhoXRFXg030r8DGFCIJL7QCo862n6SDAAE5DMM=; b=TeiNwJz7xV785/mVlPnzbtqF3DqprU41Kukg8mp+rMu77tIzNyq/w9dwM1awc/W95w MIRf4PiZFX+gRUYDCy62dlV+zwhS/wz5l3Tq46igyfcIc3sosxf20JmyHdBB4/TXetlM VY7fr6P+GEttsB9Sw69JQPRkfnVLVWnSZU5+ATW2Ad2vYNieh148lCdrOztdzQy65ByD LnZiFeyz6Pf2Ydxxsv4ZGpsKqRwHuwpXEnxEj/DfHWKdzZSOtVgCOE+jf3yqWWZwWLuT v4GHNV3u9Iic3OmHqz0y0B9hYk4AYXdcZteK3RYXZ3/AmXgJYmJXQRqvoRokEjcoAGmg Nt4A== X-Forwarded-Encrypted: i=1; AJvYcCVs27i0D8xml9/B1ooSh8HEwjUJXyIUBS+6vklgmJWWLNJeVIFpB5Y6ZtR+OSr2FhReR7DqjvjXuX5dy8V/HBkpDtTzLNriQlzLK44A X-Gm-Message-State: AOJu0YxoC8XlNB8bsyAhveeEk0ArD5WvuKzPtKrOAC5HFBTkP5C5I9ur ofx7Arl/oPJz4YSmPaYP3Py9INhc5URe09967KV0LT+h1d7F5JyEjnuYG0Lw6iM= X-Google-Smtp-Source: AGHT+IHJmig2k/ZbzPrTMzdlYfQWU1c0lOnEnpHiDWCvb3lDcleTaZABQ2jMYmV09x0fOxrLqRXwNg== X-Received: by 2002:a05:6a20:6a23:b0:1af:cc80:57b6 with SMTP id adf61e73a8af0-1b2f9c7e449mr731905637.3.1717703904014; Thu, 06 Jun 2024 12:58:24 -0700 (PDT) Received: from doug-ryzen-5700G.. ([50.37.206.39]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd394f20sm1446787b3a.55.2024.06.06.12.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 12:58:23 -0700 (PDT) From: Doug Brown To: Greg Kroah-Hartman , Jiri Slaby Cc: Jonas Gorski , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , linux-serial@vger.kernel.org, Doug Brown , stable@vger.kernel.org Subject: [PATCH v2 1/3] Revert "serial: core: only stop transmit when HW fifo is empty" Date: Thu, 6 Jun 2024 12:56:31 -0700 Message-Id: <20240606195632.173255-2-doug@schmorgal.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240606195632.173255-1-doug@schmorgal.com> References: <20240606195632.173255-1-doug@schmorgal.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This reverts commit 7bfb915a597a301abb892f620fe5c283a9fdbd77. This commit broke pxa and omap-serial, because it inhibited them from calling stop_tx() if their TX FIFOs weren't completely empty. This resulted in these two drivers hanging during transmits because the TX interrupt would stay enabled, and a new TX interrupt would never fire. Cc: stable@vger.kernel.org Signed-off-by: Doug Brown --- include/linux/serial_core.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 8cb65f50e830..3fb9a29e025f 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -811,8 +811,7 @@ enum UART_TX_FLAGS { if (pending < WAKEUP_CHARS) { \ uart_write_wakeup(__port); \ \ - if (!((flags) & UART_TX_NOSTOP) && pending == 0 && \ - __port->ops->tx_empty(__port)) \ + if (!((flags) & UART_TX_NOSTOP) && pending == 0) \ __port->ops->stop_tx(__port); \ } \ \ From patchwork Thu Jun 6 19:56:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Brown X-Patchwork-Id: 802798 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D72171743 for ; Thu, 6 Jun 2024 19:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717703916; cv=none; b=KCwDln387AjxjcqsuTQNOlfxxUxW6vZ/Qc4+/u33evixN23vFimMyWsfpBLG0oKQHDne+3hkYYbpY0drvuHP8eTFNUfZO+qc6LPFQh1P7Ab3265KMh2RR9ywKdeYRs45xK/XKXU2BsjBWfCcbzQS/SbBdbwT+eS7Cl6vW1bd5n4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717703916; c=relaxed/simple; bh=skqVWGCzgo9ma611abjtaugTbbDm70/JjjTaxlkXm1k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nhkj5aeigDox6xksxIoHLJjTdAsZnoWPD/BsIBZnjsKgpJCIhudsikTAWnmfu82H+91dnkxvQi9IObpYAhWxAzoD2HVMbaXJ/Q+SAJiZcgQOj0UlRTtGuS1b6iyejL1m5BaPnGNA15ueLesckmwf+PBOsCDl37rb2QJGlHpKtx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=schmorgal.com; spf=pass smtp.mailfrom=schmorgal.com; dkim=pass (1024-bit key) header.d=schmorgal.com header.i=@schmorgal.com header.b=P4LKfkuu; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=schmorgal.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=schmorgal.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=schmorgal.com header.i=@schmorgal.com header.b="P4LKfkuu" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-70255195be3so83529b3a.0 for ; Thu, 06 Jun 2024 12:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schmorgal.com; s=google; t=1717703913; x=1718308713; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xhCrgBpdzAke7VNUV68QTusfCqXgr2XrKc4HM00cRt0=; b=P4LKfkuuq5W51aYf8n5QbPXkB09fm0NUkiUVMzZQNr7fp2m6xWAso7c0FFVD6ZB7kj aJOtfqjFWTeyHat1PnNYjheWqSWTlVjGeN8/3GygMAJyrsnsDkVdUvIvqkTcCcsZRqwj MHI1zJfqt1lSCvzXkzGRz5lQDoQHACwQAQDps= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717703913; x=1718308713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xhCrgBpdzAke7VNUV68QTusfCqXgr2XrKc4HM00cRt0=; b=l/qZgIbQlCATbm9ojvbKfGHrpU2JnkBaCOPNj+0AB5vdVVsA6o9GW3v1IOwDnX8mvY x+SzWnSoI4NN8aat/S5yIbHl2YtlRn3cO5Mtm1QZE8oryGcEsEinQqt10KaOYjGtfptR S0rsWWodpEJWaBRRMrcKF0bmPUpoAa1/f/xiSZeT1WOqQN3Vi1CFobp3eWyozyL970rz RKTUlcq9HalSzxbGz+rWi1uqSgL94FOWBhiSM5Bbk9apRfFfDAaq3dGH/qonWJwAFHtJ LFiurpQztgYKjP6TskdBXi5pPSa7hLW2UIJLw6cTZMt9mlpBHrXzJJ29Krup5hYzf5EU 4L0Q== X-Forwarded-Encrypted: i=1; AJvYcCUdmwoFh1HrZG5Aq0L0l1hQFN5eBTh0/HE+95T6OL8RD1NZOGCiTP+joY4q7aya0mGCFo3Iadj0nAxt/NXN2u0Gz7WXJkd9otQaFn13 X-Gm-Message-State: AOJu0YxxCpH75J3LyNYqy36ClENNqZJ9cFU3ZvARvGv5Hg/1sznYtnCZ ktNbBozB5SaS3o1lQez48VYkARH07Q66ryuxcA2OiqPYBs3doVYXbjmPSS1UTZo= X-Google-Smtp-Source: AGHT+IF7Ftlwe/U4NDtIPz39i7uTg5EUekjT2xSqVdbcRSCmGjClmjOuqdckU5olHmr84Y1emnijAg== X-Received: by 2002:aa7:870e:0:b0:6f4:9b4a:aba4 with SMTP id d2e1a72fcca58-7040c739b89mr461133b3a.2.1717703913066; Thu, 06 Jun 2024 12:58:33 -0700 (PDT) Received: from doug-ryzen-5700G.. ([50.37.206.39]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd394f20sm1446787b3a.55.2024.06.06.12.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 12:58:32 -0700 (PDT) From: Doug Brown To: Greg Kroah-Hartman , Jiri Slaby Cc: Jonas Gorski , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , linux-serial@vger.kernel.org, stable@vger.kernel.org, Doug Brown Subject: [PATCH v2 2/3] serial: core: introduce uart_port_tx_limited_flags() Date: Thu, 6 Jun 2024 12:56:32 -0700 Message-Id: <20240606195632.173255-3-doug@schmorgal.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240606195632.173255-1-doug@schmorgal.com> References: <20240606195632.173255-1-doug@schmorgal.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonas Gorski Analogue to uart_port_tx_flags() introduced in commit 3ee07964d407 ("serial: core: introduce uart_port_tx_flags()"), add a _flags variant for uart_port_tx_limited(). Fixes: d11cc8c3c4b6 ("tty: serial: use uart_port_tx_limited()") Cc: stable@vger.kernel.org Signed-off-by: Jonas Gorski Signed-off-by: Doug Brown --- include/linux/serial_core.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 3fb9a29e025f..aea25eef9a1a 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -850,6 +850,24 @@ enum UART_TX_FLAGS { __count--); \ }) +/** + * uart_port_tx_limited_flags -- transmit helper for uart_port with count limiting with flags + * @port: uart port + * @ch: variable to store a character to be written to the HW + * @flags: %UART_TX_NOSTOP or similar + * @count: a limit of characters to send + * @tx_ready: can HW accept more data function + * @put_char: function to write a character + * @tx_done: function to call after the loop is done + * + * See uart_port_tx_limited() for more details. + */ +#define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done) ({ \ + unsigned int __count = (count); \ + __uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \ + __count--); \ +}) + /** * uart_port_tx -- transmit helper for uart_port * @port: uart port From patchwork Thu Jun 6 19:56:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Brown X-Patchwork-Id: 802245 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7E98745C2 for ; Thu, 6 Jun 2024 19:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717703920; cv=none; b=bmPm8f6wcECYUhxca8Lj2H8Ju7Jpdd/ygelYx7UlKP3I6c5beufB3W9tQ58WJHPK4aOnb6psCemLimZPp7kRjS05RZ5IPaSTW8qbkycLpRiXYIauoYXgTotLOWNuZ8ChWOfOa+Zull1AJoICuHU9JbbL/QbjSArwzlItj8PumUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717703920; c=relaxed/simple; bh=om/tUMkX6OS8Ao+4R6UxrpZYLDopfROa6xD3DiyiTRc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C7ItHG09RzYlefl0Q5e38uYw+vNIVYj3mC97bxKCC8s2oZ1LmhhYgcjPhfCGeQHWYGJ/znrZ/LhuotlWrhKbHhU2h11MIlUnRlh+N9etDn/1CDWcgGPgdiTK5MOXbV7TRTWzKTzV0eSUOjEjCVEMC7GkohZNtoKG/GnF+VHF8eM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=schmorgal.com; spf=pass smtp.mailfrom=schmorgal.com; dkim=pass (1024-bit key) header.d=schmorgal.com header.i=@schmorgal.com header.b=gXJ5OlJt; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=schmorgal.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=schmorgal.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=schmorgal.com header.i=@schmorgal.com header.b="gXJ5OlJt" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-6818d68f852so165132a12.0 for ; Thu, 06 Jun 2024 12:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schmorgal.com; s=google; t=1717703918; x=1718308718; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H1O9YIWaISmK5NIxJKMIlNcYeBFnqMM13+G/DI3fqzw=; b=gXJ5OlJtgwKM0MiLtg3J0Etg9R5xTUpbPCr0WEqFvA23NN/ItVYXsXfM/mKC6hsYpb aePVa6nRXZdA9JBb6mbZGjzuEIabCHk7GUG5PK1qq7Bz6FBwEqXTDx0mAIVY6j/Xdfza XfIAoYt6Ob934aA/XRWx0GxBU+K9xrn8fyung= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717703918; x=1718308718; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H1O9YIWaISmK5NIxJKMIlNcYeBFnqMM13+G/DI3fqzw=; b=kQddNYPfu4R05mvzPYxx3qywc0nkml8BAGetMKfAtJFzvvPAXfhM8N1M/GQHQL5KzY xCUIytBG8b61QTNfzXT/3kW2hnKoHmynfV+IOEQ133cH3auEueM7c7sRo9O0NDJoeJzG zLMCUk5C/zAprSu0zMk22gJJg9xNkuvUsuDvQSG8dyZdGqfBmj/nTAfJ0DIZgQRkFmcB f1XBIpmSAwib2+MiA8j6i/+EZV6vVw0zx13z3ov6JIZOA07c+InBgZuj0kkM2zUzcIQh 2Vh8eGtp+3nsJduEDlxdopTDPI6pNd5Z/CfniMrVHP7ovzT/e8l5pQOYeNEV7lHV7xJT FAjg== X-Forwarded-Encrypted: i=1; AJvYcCVZt1/u2diIs4nrtNPmKWOzK/c5vx0h2qKN3h5HFMzLA6MKs4Sqa4TS272EcX56Kvd+KZ5kdYaOA2r7IKnFA3Qos9rWg2X8E5qTebMd X-Gm-Message-State: AOJu0YyQheveBP/LjVnV0XdP7pIg0f/VFxCGIi2x6mKAEoaRBP9YZQqf Ao0sSAfMdNGEUkLySg+/2xDiYAhaOa3uvYSA4D4OhAnaPQsEw7JQRPeyjmFjB8HahRMUXZp7J8M eOOez3A== X-Google-Smtp-Source: AGHT+IFZAvRK9sCokOpd775+K7Vnh3U8s1WAuk5KbQdzYOD2AqYp6+WQBgnCrhT26V0ykIG4QPYGRw== X-Received: by 2002:a05:6a20:6a23:b0:1af:a4a5:a26a with SMTP id adf61e73a8af0-1b2f96945c5mr703169637.1.1717703917778; Thu, 06 Jun 2024 12:58:37 -0700 (PDT) Received: from doug-ryzen-5700G.. ([50.37.206.39]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd394f20sm1446787b3a.55.2024.06.06.12.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 12:58:37 -0700 (PDT) From: Doug Brown To: Greg Kroah-Hartman , Jiri Slaby Cc: Jonas Gorski , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , linux-serial@vger.kernel.org, stable@vger.kernel.org, Doug Brown Subject: [PATCH v2 3/3] serial: bcm63xx-uart: fix tx after conversion to uart_port_tx_limited() Date: Thu, 6 Jun 2024 12:56:33 -0700 Message-Id: <20240606195632.173255-4-doug@schmorgal.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240606195632.173255-1-doug@schmorgal.com> References: <20240606195632.173255-1-doug@schmorgal.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonas Gorski When bcm63xx-uart was converted to uart_port_tx_limited(), it implicitly added a call to stop_tx(). This causes garbage to be put out on the serial console. To fix this, pass UART_TX_NOSTOP in flags, and manually call stop_tx() ourselves analogue to how a similar issue was fixed in commit 7be50f2e8f20 ("serial: mxs-auart: fix tx"). Fixes: d11cc8c3c4b6 ("tty: serial: use uart_port_tx_limited()") Cc: stable@vger.kernel.org Signed-off-by: Jonas Gorski Signed-off-by: Doug Brown --- drivers/tty/serial/bcm63xx_uart.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 34801a6f300b..b88cc28c94e3 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c @@ -308,8 +308,8 @@ static void bcm_uart_do_tx(struct uart_port *port) val = bcm_uart_readl(port, UART_MCTL_REG); val = (val & UART_MCTL_TXFIFOFILL_MASK) >> UART_MCTL_TXFIFOFILL_SHIFT; - - pending = uart_port_tx_limited(port, ch, port->fifosize - val, + pending = uart_port_tx_limited_flags(port, ch, UART_TX_NOSTOP, + port->fifosize - val, true, bcm_uart_writel(port, ch, UART_FIFO_REG), ({})); @@ -320,6 +320,9 @@ static void bcm_uart_do_tx(struct uart_port *port) val = bcm_uart_readl(port, UART_IR_REG); val &= ~UART_TX_INT_MASK; bcm_uart_writel(port, val, UART_IR_REG); + + if (uart_tx_stopped(port)) + bcm_uart_stop_tx(port); } /*