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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 B7008C433E0 for ; Tue, 11 Aug 2020 10:40:05 +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 77CE62065C for ; Tue, 11 Aug 2020 10:40:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a+QJuGI2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WcGZoU5z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77CE62065C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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=AHmJY7wFvPK0cDgp4ArwjaRoSSdeHfrGEr2gDCEGMxw=; b=a+QJuGI2gS+n3z8Xv68zKyEuh uPu6AjNeFfs0QEKdDHRX040pqA3relL7I50S0syXBGnnudU+Yi4jNO/V++LBKSAZGQBBVegmEuu6i tFflXuqmdFMfPlyS+EPtd4rXb8btVSdBxTUrRG++p/0JaK2I38Q/v+GcbCNbeXafpqJGwl9R46fQt kVPFyfG6sCMmxY0wCKzH96ZkyDjKg+S3kDephoMdbHqBfCbsXv1vcwfzdxqdWoytNKhrwv8mB6sNr cwfkeYiBbz4UnOB52f4oO5E10B6iONdYkriB3HWl6bHPyagJR+A6BRBUjJJW5OfUWgA5c3/AKWVS0 WLR3Ps8bQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5Rg8-0001nY-Iu; Tue, 11 Aug 2020 10:38:48 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5Rg7-0001nR-1v for linux-arm-kernel@merlin.infradead.org; Tue, 11 Aug 2020 10:38:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=phuSQTyOsMMj+YYoUn41/VtyZh3faVfNjBlSMB4YUww=; b=WcGZoU5zZ2MtTWjOsUh8QPJH0u eOTkqh5SntAUSb9R5gR68k1pGHG8qXKgEnLNDsZHx3ic2zKcd7om0T4RKCxBVOFJtlqmf7E2lFCM/ +qQznmZdNbSVGXQ/JzT9dLYyrRksmFroBrkSYMMO3//V2FoJ8a3udLa3aFgIWQvuIda/tUByCmkPz Drj3io9M/O2hVPS5350ZDM4HpOWXrPhZW2t1IMuLY6wUvQl+WhIrAWxVAKuBvlBjCcbEAAuPOUWmn Qq4amIQ5LHxiuJZ0gJ+XjPNXwyxjoM13QuuQ3uxT6sKSWgeAafLKa6ItAsCwDdImnaPAJ1hFyjpJs 53pU9URQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5Rg4-0005pK-QK; Tue, 11 Aug 2020 10:38:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7C9003060AE; Tue, 11 Aug 2020 12:38:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 62D4020BFC4E4; Tue, 11 Aug 2020 12:38:41 +0200 (CEST) Date: Tue, 11 Aug 2020 12:38:41 +0200 From: peterz@infradead.org To: Will Deacon Subject: Re: lockdep splat ("possible circular locking dependency detected") with PL011 on 5.8 Message-ID: <20200811103841.GC2674@hirez.programming.kicks-ass.net> References: <20200811101313.GA6970@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200811101313.GA6970@willie-the-truck> 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 11:13:13AM +0100, Will Deacon wrote: > Hi, > > 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; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel