Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1892657lqp; Tue, 16 Apr 2024 00:20:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHV3emFpyQHqtdsalHmQMipigD5ODJbS5EGb31sMQTtCQk0p1E12PLvyXek4GAazL9i5T9ndsIavM+IHzaOcnz404SJt7m4kgX4gqGIw== X-Google-Smtp-Source: AGHT+IGM0iUda9q4jTCATgADdXg6SX4OOkpGZ8iwV7h2goQO5+za0SZnANacQjetDZzddCtaySFx X-Received: by 2002:a17:90a:e146:b0:2a2:b03b:58e2 with SMTP id ez6-20020a17090ae14600b002a2b03b58e2mr10015519pjb.15.1713252038144; Tue, 16 Apr 2024 00:20:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713252038; cv=pass; d=google.com; s=arc-20160816; b=SkudgRYOIs2XRNkt6+MV4PJ3F6f6IC32mrr5DSjDcIiTLItplXumPnH0NNtP4Gg5dp 8G+kYiJLcyEBBWpL8l6TWMhWH92glnbG4hM3hd6IhTO7UXXy/huFqs+QI4z43uD10otB yHW0tVnguXZFmudEPFgeLDpTnwOdijbOiGKvUZoNK6LaJDc5wgZLfsKEASRmotqDSn+b f0YY6zYe19W0INEJgD1qd+jsOyKdrAX1WYeucYI+eWl3HankZsmbMq8tGPUL2023PdqM MxyBVkBOEeh+3hNlA/ZRStpsdMnyMsPWv18AeEHrKTYX5OC21PpovYWnRDbGHapGdxK7 z2/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9NVlXUT+9tgC3jgBF2F+TqkUl4fzQtmzUxhB+X/7tz4=; fh=WKt5nsTzCq45C4QJxmoaoXx2uEzOcL3zMnfgJg1XA9c=; b=DGNyYqlSqyRDpsWE6gY6wrSzuqK/UISM6yJPmoM+VNGFbeB5FSS8OX0WWBZIEpyquv /zUX0Br71xVxwmjetX7fzlxkfVldjRugEd7pP7OVHiTMxEVsaMzTfBf67Nmih9Q/m39u DuY5YoAHAzub/NIfjCmSZOBpQu645ECWgzFRj0BioJhPmcq9xzKEuL4UGszsTIIWzxkv JexbSGjDtGCyx3csyYRuj00Cqixon5PcVkBpUCU+pV9PP54MAlO8tkxkFCkBZcI/BNEE g3cI6rbhlhB08KWn3aadhB7K3/TN+8FSjUr7/t+3uQ+kzOlppreXtNioikCSnRgHAPSC Uwqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S+KlyKEO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-146411-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146411-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i19-20020a17090a7e1300b002a2344bfbeasi11441236pjl.113.2024.04.16.00.20.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 00:20:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146411-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S+KlyKEO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-146411-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146411-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 39724283A6F for ; Tue, 16 Apr 2024 07:20:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3C3D128835; Tue, 16 Apr 2024 07:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S+KlyKEO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1003873199; Tue, 16 Apr 2024 07:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713251948; cv=none; b=inNgQ2z0MsVRAoCjwZljZQByJJfMtAHCed0XvXLMzuxtLj6Km+/jkctbEmeZACzZZJpE0TjHUKwuDueWU46DMrZJjdh3VXWlLkS/cBwR8NOatcyW3lVjq9BoUcs9I9shDNEuv/byRb1owbTRqkYWLDLcXa9OU5dU5sgx6HnnhIs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713251948; c=relaxed/simple; bh=XvRd1i+MJnnAivOan/S0mSzDdn9jpLQDQUOM7uQ3tnk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iT/evCh+58gW3O47fFw8l2EZhElD5cR6kpJ2H5Bcl+Xk+Rhx8Kxbk4GhNqqnzM6dYWfdlF4m+ohK8H4KMh/uPlUKRzu8jQLKIiiUvIumJ18r8mPFH7MU9wDd4Quc/cruGWFYi4oevqqov0+FtUI/FUvgq855aBq9ydRWOo04cqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S+KlyKEO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50EECC113CE; Tue, 16 Apr 2024 07:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713251947; bh=XvRd1i+MJnnAivOan/S0mSzDdn9jpLQDQUOM7uQ3tnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+KlyKEOutnRnyO+UsswV3gp+zpimrfr/hw48XAD6AZwtI+Yxug9lOxurAUT6NEeE G3TcCfIwxW9Z6CE6M0EekJwAS5DUCzoXPrKcSjN7XKntCzOq7P85fe9C0Aqrep9pwN kxcm7oaJVcCTjls7vgwW5HMc8zgkT8lQOgH2th53V2Ea0LCDmtgCiQwbMVk6NEU1as yy83YFPs8Gv2bFYWZHKK7VIcFRGBSoDuR78kul2scGgph54ox6koEjY2+/7x3n3yRG +9MzTYT0bfhbwbwo5ObMEWmv9gkaCuGjXm4ZZ/fLcD9vLGb6uVcWhRCKKAv268888n O8ZwKwqp15Syg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Pengfei Xu Subject: [PATCH] serial: drop debugging WARN_ON_ONCE() from uart_put_char() Date: Tue, 16 Apr 2024 09:19:04 +0200 Message-ID: <20240416071904.21440-1-jirislaby@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Pengfei Xu reports, that the -next commit 1788cf6a91d9 (tty: serial: switch from circ_buf to kfifo) tries to emit a WARNING and that leads to lockdep errors. Obviously we cannot print anything from uart_put_char()! This WARN_ON_ONCE() was/is a debug aid to check if the condition in uart_put_char() can happen at all. Pengfei Xu confirmed it can. Unlike me and kbuild bot in my queue. Second, I completely forgot about it, so I did not remove it in the final version, nor mentioned it in the commit log. Drop it now as we are all good. And we even have stack traces (and a reproducer)! Signed-off-by: Jiri Slaby (SUSE) Reported-by: Pengfei Xu --- drivers/tty/serial/serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 558f159ada15..bd4a72f8e821 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -573,7 +573,7 @@ static int uart_put_char(struct tty_struct *tty, u8 c) int ret = 0; port = uart_port_lock(state, flags); - if (WARN_ON_ONCE(!state->port.xmit_buf)) { + if (!state->port.xmit_buf) { uart_port_unlock(port, flags); return 0; } -- 2.44.0