From patchwork Sun Jul 5 09:27:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11644307 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EC286C1 for ; Sun, 5 Jul 2020 09:28:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37C8A2075B for ; Sun, 5 Jul 2020 09:28:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eJpCsDUe"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UvSZGSBt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37C8A2075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0x9QcRJmu6y8NxXRW+gFi41+Q6kksC2sKdCzLx5zHAM=; b=eJpCsDUeoR7GPewjzo/XFrQWmY oRCPbmdynAzFRW4BsTQ34oWGmV3i9030molYhlnm/KmbGyOmTkpubSERRB4d8VEyIXLdHorPuQJTW +o/yWDbF/HJjhcebdO0AfxNM9TOQIP/9H0XoDUIIHUjEB1DWJbpl/K0ZUvPyz8klHwwu659CIhx/Y EqNCitFg5jQxs8986W7tyGulh8YLvqnG9XJTGv7zQQxjJ6GVZMVXSBbtoMqq/I9WB71jJEtQJxShf 2rKelA4MdcUhDAsPSMvodvR0gggPBHpVfXrXweP2iR/irxkdC/4dbFTmXut2N99KE6a7iB0fLl/Ku oNE4e/rg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1js0wH-0004Y7-Vd; Sun, 05 Jul 2020 09:27:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1js0wF-0004Xl-9G for linux-amlogic@lists.infradead.org; Sun, 05 Jul 2020 09:27:56 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4055B2075B; Sun, 5 Jul 2020 09:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593941274; bh=cwT/z4X9FKhRShGYr7Xo1xaeCkNEqrqHebtQK3v592g=; h=From:To:Cc:Subject:Date:From; b=UvSZGSBtbceq5CP+GEMr6b3VXwaWm6XG5Nouf8q5iFEcisyaEgjfwgNjfLO3tt+rB PLl/F1qFrEsEaHM1Kc8ns6pRS3IfQEphXEVuhRit8vpCNfU7cKgQrkWOFY5IgnnwUg HpKRQa5TayPt1iDyzVY71YAclQd/EHai1FeQobFo= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=hot-poop.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1js0wC-0099WP-Dx; Sun, 05 Jul 2020 10:27:52 +0100 From: Marc Zyngier To: gregkh@linuxfoundation.org Subject: [PATCH] tty: serial: meson_uart: Init port lock early Date: Sun, 5 Jul 2020 10:27:36 +0100 Message-Id: <20200705092736.1030598-1-maz@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: gregkh@linuxfoundation.org, khilman@baylibre.com, linux-serial@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, andriy.shevchenko@linux.intel.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200705_052755_715721_6FF3CD6C X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: khilman@baylibre.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-amlogic@lists.infradead.org, Andy Shevchenko , kernel-team@android.com Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org The meson UART driver triggers a lockdep splat at boot time, due to the new expectation that the driver has to initialize the per-port spinlock itself. It remains unclear why a double initialization of the port spinlock is a desirable outcome, but in the meantime let's fix the splat. Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") Cc: Andy Shevchenko Cc: Greg Kroah-Hartman Signed-off-by: Marc Zyngier Signed-off-by: Andy Shevchenko --- drivers/tty/serial/meson_uart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index d2c08b760f83..386e39c90628 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -759,6 +759,9 @@ static int meson_uart_probe(struct platform_device *pdev) if (ret) return ret; + /* Init the spinlock early in case this is the console */ + spin_lock_init(&port->lock); + port->iotype = UPIO_MEM; port->mapbase = res_mem->start; port->mapsize = resource_size(res_mem);