Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3203346pxk; Mon, 21 Sep 2020 07:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw96IgKDw5PnTvSzlcKPRSquweVSiY1mM2s5OSAx+Kh0mLmdtckaY4rpeFQNHBPdiVVLSnE X-Received: by 2002:a50:fa94:: with SMTP id w20mr19338edr.206.1600699670946; Mon, 21 Sep 2020 07:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699670; cv=none; d=google.com; s=arc-20160816; b=ai9PvCKXrfFGWmYYFmfguw4I7JxXLl423gRuGQWaMnBVr/B+Qfy5shW6ZIV7mOSbz3 h0sHAzDy8ACCb9aZSczVYLLMnSvWOkYXEG3BiAupCLY0XoDxzVcHtGZr8UTvp5w156Dj jlncitiQDSUML/LKJ6vFIfz/fIXs3O+jbmSReplgOh9RvaANhXTXg4QDmivubY97MPyY OrispwbW7mcsVC3RXjaSpKhoFpODxgRF2Cmup0BcNW9eFJxyqEX0oufWYSI6FxGiWrHH v+Ywf+CfXL6f/rMq3EarnLtTEyaPjaxzaG1iTVdDcf/OaK5RBuSUuFxfSqHUVWlzS5e8 ahRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l2356lw/Uh5PHC313dF1fCIiyIkqC4F3TeD8rYUbRFk=; b=yo0sb0o1Z1Q/LVb4HWpPMlS0BI/Qk3ZxRfY8EQr1q/RbRNXFvxqGzyi3zi9jh7iOxl vC73fBkluzKuv/NDS7dhBgqzi7i8/eodM3HPume3xSXCg7LTMZdYBDI0963BMxn6Rlg7 k9tYDu/1D1/KnpkWdRo7LBkdR/M6638G4Bxcyu9DvbVDjAZvTa1P4CbsJ77H9KuscOfq 0dnXqXw+cC2Pm77D51YA9Y2M0g8t0BD+YOVXk8tVYzil6yRjfHbBv5UZdWpXuZSPy+KJ +f5qfU6i4QlR0e99YQ0plIuQkx8Y7PgFkpybWtIe+F3TXYe4lmIpYAn04sYWAyHdE5pO pb7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OViTSyAn; 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 dp19si7522794ejc.122.2020.09.21.07.47.27; Mon, 21 Sep 2020 07:47:50 -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=default header.b=OViTSyAn; 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 S1728265AbgIUOng (ORCPT + 99 others); Mon, 21 Sep 2020 10:43:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:49336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbgIUOkl (ORCPT ); Mon, 21 Sep 2020 10:40:41 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 22FEA2076E; Mon, 21 Sep 2020 14:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600699240; bh=qSBxa+hR0DswKEbGWHDjnrrfzx2tHi92FAoUi0YWZ6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OViTSyAnKyOQKo76HsUqZfd3x9/qT+WdLtQl2KWx3E0KpbxXBuRLxEKOo7zidixVg OcdTEJvm0bB8CXsrmyzMh8Fu+gYGsYEwX+pC04EQLRAKjKd0SY2CbeUipHnlunD1Kr hkTzj5z6Z878N5NJOu7p6nPwTe96FkLVXvv/dNj8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sven Schnelle , Peter Zijlstra , Vasily Gorbik , Sasha Levin Subject: [PATCH AUTOSEL 5.8 10/20] lockdep: fix order in trace_hardirqs_off_caller() Date: Mon, 21 Sep 2020 10:40:17 -0400 Message-Id: <20200921144027.2135390-10-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921144027.2135390-1-sashal@kernel.org> References: <20200921144027.2135390-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Schnelle [ Upstream commit 73ac74c7d489756d2313219a108809921dbfaea1 ] Switch order so that locking state is consistent even if the IRQ tracer calls into lockdep again. Acked-by: Peter Zijlstra Signed-off-by: Sven Schnelle Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- kernel/trace/trace_preemptirq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_preemptirq.c b/kernel/trace/trace_preemptirq.c index f10073e626030..f4938040c2286 100644 --- a/kernel/trace/trace_preemptirq.c +++ b/kernel/trace/trace_preemptirq.c @@ -102,14 +102,14 @@ NOKPROBE_SYMBOL(trace_hardirqs_on_caller); __visible void trace_hardirqs_off_caller(unsigned long caller_addr) { + lockdep_hardirqs_off(CALLER_ADDR0); + if (!this_cpu_read(tracing_irq_cpu)) { this_cpu_write(tracing_irq_cpu, 1); tracer_hardirqs_off(CALLER_ADDR0, caller_addr); if (!in_nmi()) trace_irq_disable_rcuidle(CALLER_ADDR0, caller_addr); } - - lockdep_hardirqs_off(CALLER_ADDR0); } EXPORT_SYMBOL(trace_hardirqs_off_caller); NOKPROBE_SYMBOL(trace_hardirqs_off_caller); -- 2.25.1