Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3029722pxv; Mon, 12 Jul 2021 07:41:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEmz17NMJS4/VgPsiA6hwjyJ+fZU2ga21RggpRkCTFID+M1T+B9qYOBoe0u4dyJCYM5DkM X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr1258692edv.344.1626100871242; Mon, 12 Jul 2021 07:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626100871; cv=none; d=google.com; s=arc-20160816; b=mF25c8egNlMuKq83qCH9xIpihwM7elK5HXp9Rj9/t08Oj1u0o/yywSjYNlwSJhdXWN 1bYfpePAdlDj51HlXt5yvJDVUyb71liK2vv46L57Q6idTt1e8+JwWhY4BqVVAgd+nwHb mg3hKltFnDyXFXdxGF6PPedYSzdL40OeJQPFOzUficwv7eiLI9eE6X2R0JW9frWKtc9W r+gUMRTyBBl939wKeyAA8D5a7/sAiT7w6JSZtior8pqPI6ANUOgdZmv9LoSu1t6bryvX 0pCd/uXo26/Z/qxwprmgdLcoGXziqxlD1DXP+4Bb0gv9jY43PRMb900mu1scjCSJtGDp US7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WZgmeIfXDx0JPAwGQUfJv+aElwdFW/dsiQIKg3slO2I=; b=JFL0fDjEpIZeRQ5U1W/RcOycSGOJyIXEgMvt47Cgat1XNiJ8xSCBCyk+uBiORPSySe QEoSSo4SGEAWnIjcacnv2f6R9RpL7/FIZe2lZd4rml1OuJHQponbWIJebKOfbCLyb+zU BPeO0bhi8kVnB2G8TV9N8/+ZgUkAxRiWPTwE83ziVFxudzBOWk2vAKlBfDq1Y3+FW74m MWcQo6I0p6Yhc4M+kH/qS2AnzK+prmF7CP8FFvglohhoW/YfRIbBQbJ5oRJVBFKAoKd2 3zeuHRrwFJIky/wJrscgeL6Ejwcks6+pOrxstdNNg5P3a4YWFudTuoBS5RP65d3LQSyv oXDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QES7joRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si17499632ejv.442.2021.07.12.07.40.48; Mon, 12 Jul 2021 07:41:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QES7joRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235026AbhGLOmq (ORCPT + 99 others); Mon, 12 Jul 2021 10:42:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhGLOmp (ORCPT ); Mon, 12 Jul 2021 10:42:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5CA2B61158; Mon, 12 Jul 2021 14:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626100797; bh=x/dSzrzR8V4rkbIIZXqry+nKedVwZM2XkPmtYQFAsSE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QES7joRKKaIr03Ke/ZduyyaHUI4Fuxvl4lgM/Z8yF47XMjuhjmlJpIl0XH0VZMf5t RxxRoHOJ3lEmRMvil9V+kSXociBcmDl+s1Pd30cV6w2YWN3SGtG46MTA80SV76AgB1 nj3f/HA87jwM8RGbKR++TZ1ut2qAYJe0JNgCTLlDexIpFj41eeuYhAAT5eiaydQ7UR yjiMTvPLIXiaNLf+AIAwsHz2friRuvJgCkAjoJlqmvnAh5FvhfyGiodh1UhVugwRcj 3okxkMYHYfY4HKUksYBPDuDcYBSXAqS6u2kEe98ZoGHkifdmQAeeKFwb997wjX5pPy u1qli5M1meodw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1m2x5t-0007F8-R3; Mon, 12 Jul 2021 16:39:38 +0200 Date: Mon, 12 Jul 2021 16:39:37 +0200 From: Johan Hovold To: kernel test robot Cc: Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Andy Gross , Bjorn Andersson , LKML , lkp@lists.01.org, lkp@intel.com Subject: Re: [serial] 75f4e830fa: WARNING:inconsistent_lock_state Message-ID: References: <20210712143414.GB13620@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210712143414.GB13620@xsang-OptiPlex-9020> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 12, 2021 at 10:34:14PM +0800, kernel test robot wrote: > Greeting, > > FYI, we noticed the following commit (built with clang-13): > > commit: 75f4e830fa9c47637054a3b7201765f2a314bda2 ("serial: do not restore interrupt state in sysrq helper") > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master > [ 208.007748] Possible unsafe locking scenario: > [ 208.007748] > [ 208.008411] CPU0 > [ 208.008682] ---- > [ 208.008955] lock(&port_lock_key); > [ 208.009398] > [ 208.009703] lock(&port_lock_key); > [ 208.010122] > [ 208.010122] *** DEADLOCK *** > [ 208.010122] > [ 208.010790] 1 lock held by rngd/341: > [ 208.011190] #0: ffff9e8ec0e6fd80 ((&up->timer)){+.-.}-{0:0}, at: call_timer_fn+0x48/0x2eb > [ 208.012101] > [ 208.012101] stack backtrace: > [ 208.012579] CPU: 1 PID: 341 Comm: rngd Not tainted 5.12.0-rc6+ #1 > [ 208.013253] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 > [ 208.014128] Call Trace: > [ 208.014406] dump_stack+0x8b/0xdc > [ 208.014776] mark_lock_irq+0x5b9/0x6f3 > [ 208.015175] ? stack_trace_save+0x50/0x6e > [ 208.015615] ? save_trace+0x4d/0x30d > [ 208.016001] mark_lock+0x121/0x1a3 > [ 208.016378] __lock_acquire+0x645/0x2ca8 > [ 208.016807] ? lockdep_unlock+0x8f/0x113 > [ 208.017256] ? __lock_acquire+0x133e/0x2ca8 > [ 208.017707] ? lock_is_held_type+0x102/0x15d > [ 208.018175] lock_acquire+0x1a1/0x2ab > [ 208.018590] ? serial8250_handle_irq+0x1a/0xdb > [ 208.019072] ? serial8250_handle_irq+0x1a/0xdb > [ 208.019560] _raw_spin_lock+0x34/0x67 > [ 208.019956] ? serial8250_handle_irq+0x1a/0xdb > [ 208.020444] ? univ8250_console_match+0x130/0x130 > [ 208.020951] serial8250_handle_irq+0x1a/0xdb > [ 208.021444] ? univ8250_console_match+0x130/0x130 > [ 208.021950] serial8250_default_handle_irq+0x3b/0x4a Bah, the interrupt handler can end up being called by a timer callback in some setups. I'll prepare a patch. > [ 208.022492] serial8250_timeout+0x17/0x42 > [ 208.022933] call_timer_fn+0x145/0x2eb > [ 208.023349] ? univ8250_console_match+0x130/0x130 > [ 208.023854] run_timer_softirq+0x281/0x33e > [ 208.024308] __do_softirq+0x28f/0x50b > [ 208.024716] ? asm_sysvec_apic_timer_interrupt+0xa/0x20 > [ 208.025389] __irq_exit_rcu+0xb7/0xbe > [ 208.025817] irq_exit_rcu+0x5/0x19 > [ 208.026211] sysvec_apic_timer_interrupt+0x3e/0xa3 > [ 208.026781] asm_sysvec_apic_timer_interrupt+0x12/0x20 Thanks for the report. Johan