From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03C98C433DF for ; Tue, 11 Aug 2020 11:18:53 +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 BCEDE20716 for ; Tue, 11 Aug 2020 11:18:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ksb0S9hk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="GCfZ5e9x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCEDE20716 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-arm-kernel-bounces+linux-arm-kernel=archiver.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RPjkAmVOSlTkLBnxxzyU8uvd2k/4O+1cnN6IxJOh8Uw=; b=Ksb0S9hkxw5HLnYi5ddPbUo1y /QDfcgX+eUYFL41+6TwUIz17Ar3+amoSsbyXpxorqL4vWpSfWM/+084L0rLV+peB5COiBpQk0cqSV tDa4K5BWP5cBC3+PI83uUOV114HN/H+Uor/l+RYTYoBeRwyZ0T8e7UqUiISM/PnYEclVrKQYu4s25 AV4NX0R3NquOymBrUJGOEGbRvf03L9C8prms84AKZBvsjy83X0lnmFGuLijXVek7aKVMm6nNSfS6q LHEGsXq3nDPj3wXmR0zZ5pgdaX2+Z5lLdRqxV8acd9XAvjV8vRhZW7jLj0o+VD8h53PvdCCf2nNUK 2ARFwtmPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5SHR-0006WI-7f; Tue, 11 Aug 2020 11:17:21 +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 1k5SHO-0006Vf-Vo for linux-arm-kernel@lists.infradead.org; Tue, 11 Aug 2020 11:17:20 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 F284420716; Tue, 11 Aug 2020 11:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597144638; bh=xJBqLG+s8HgG35QAutrjsfzZx63gQyfWw2+EJ8gZfGA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GCfZ5e9x8+yULjtJSP/dEV/zOu2rVdRZ9nNa9NgPOVpb9I4a1tlr5i7itGO2IWc8B wgYP0Byeb0eWLz1jF5XrkJCZckYqbu4Ez107PLs7Gw4DroGOxwdlBuEdbA8gUqSONc 1Qe/B6DDLWp4R68YWcF0ylL6oS90PNJViKf3GA3A= Date: Tue, 11 Aug 2020 12:17:13 +0100 From: Will Deacon To: peterz@infradead.org Subject: Re: lockdep splat ("possible circular locking dependency detected") with PL011 on 5.8 Message-ID: <20200811111713.GA7203@willie-the-truck> References: <20200811101313.GA6970@willie-the-truck> <20200811103841.GC2674@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200811103841.GC2674@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200811_071719_634471_8049B8E3 X-CRM114-Status: GOOD ( 22.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Aug 11, 2020 at 12:38:41PM +0200, peterz@infradead.org wrote: > On Tue, Aug 11, 2020 at 11:13:13AM +0100, Will Deacon wrote: > > Using magic-sysrq via a keyboard interrupt over the serial console results in > > the following lockdep splat with the PL011 UART driver on v5.8. I can reproduce > > the issue under QEMU with arm64 defconfig + PROVE_LOCKING. > > > > Any chance somebody could take a look, please? It's a little annoying, > > because it means when I uses magic-sysrq to increase the loglevel prior > > to testing something else, lockdep gets disabled as a result. > > > > Going by msm_serial, the thing to do is something like this: > > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c > index 8efd7c2a34fe..1717790ece2b 100644 > --- a/drivers/tty/serial/amba-pl011.c > +++ b/drivers/tty/serial/amba-pl011.c > @@ -308,8 +308,9 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap, > */ > static int pl011_fifo_to_tty(struct uart_amba_port *uap) > { > - u16 status; > unsigned int ch, flag, fifotaken; > + int sysrq; > + u16 status; > > for (fifotaken = 0; fifotaken != 256; fifotaken++) { > status = pl011_read(uap, REG_FR); > @@ -344,10 +345,12 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap) > flag = TTY_FRAME; > } > > - if (uart_handle_sysrq_char(&uap->port, ch & 255)) > - continue; > + spin_unlock(&uap->port.lock); > + sysrq = uart_handle_sysrq_char(&uap->port, ch & 255); > + spin_lock(&uap->port.lock); > > - uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); > + if (!sysrq) > + uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); > } > > return fifotaken; Cheers, that seems to do the trick: Tested-by: Will Deacon but what I don't understand is why I haven't run into this before, and why nobody else seems to be reporting it! I'll try some older kernels to see if it ever worked. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel