Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3100775ybi; Thu, 18 Jul 2019 21:02:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqygFlije4P8YDC5da28UzPRS2HVPlclAOboJNwTkn+NhxRr5ssHwb2aLUBwlZtXPA+4G4ql X-Received: by 2002:a17:90a:350c:: with SMTP id q12mr55328787pjb.46.1563508974898; Thu, 18 Jul 2019 21:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508974; cv=none; d=google.com; s=arc-20160816; b=ZCtTg56K8nNnKosNXXNvYl5ERjgQXWqtalnP2A6j9LhAF390Uu7cUXB1mU+sozetnf S+ewHfyXDpK9dQVH+LasJMulDhQDWg0d78WX2mKQBSYf0Ls6txbgsOKRDhkWWrhy4prK Mx0gGVffnaowpzTNKy8NIUJhTnQvijee7Du2BMGTkMkn9jcg7HQomxdBjeoDL1m95L4d NDUfwP9yuL5Ngqurpf2LqkcFtTVOKA57OOoyceNqADGmlrqfQTKqQ436t9Hzvq1laMPU 67QxDmvjPexqGKNgqqUPBYFrtQGmm9cROJMqysWoPOiFhudo0hW3Gw2F0FhQYcSxOOIy FEKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kcoHmZoHh+DopVrjuUKTbhl5jNSjNE8k6Bxms61l8RI=; b=c6maFxj/iU2pmDH/giikanLWKFNrFsG19D3w++bYwmtoh67kmr8rAxK/7F29sZvKmO l2Pr1/ulY1+/CnY/EAGwbF/4BXbtyypv4B7z+mxnlRqe+BkfB5OTduNgtBeYAE1Zfpjp AEDCSCYtPIgUctazSXyrSX7ohzenBT/0SZJuwGjW46By32PNl1MxGTfLNM2Tq0uGSkVb YNAaV5nx90DuSErQIeudzKNjZuayUiPXINt9qakM527rV6lLT+9652sJEySY+NxqkdZJ kK0IvIf0+522+Oeqh2+YYagP8jxIfoC+C9zwK1SnP66FdMmlJ0H+O4/9v9YvQVxUVrst F4Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UNFa4S2F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id o127si586896pga.593.2019.07.18.21.02.38; Thu, 18 Jul 2019 21:02:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UNFa4S2F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729578AbfGSEBi (ORCPT + 99 others); Fri, 19 Jul 2019 00:01:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:33260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729473AbfGSEBb (ORCPT ); Fri, 19 Jul 2019 00:01:31 -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 436D021873; Fri, 19 Jul 2019 04:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508890; bh=3gyWvW9TWKvGDCP/N8AuBPzV+BDaoFgHHsIs/6XfNHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UNFa4S2FEI33fcqOBuNsniCnQW5VTRLPSEIFkQn6vTbi+fqK2rk7JOthsjhQFO0xT igw1c4lvc/P46ViG/ZWdxLy8NxEaa8IAwlpUpAj0DyMF3kbWDv7+BVV9T36km8srK/ SMkMyiBnGotiveD36CObaDFylP03CnyqBYown0Kw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.2 140/171] powerpc/irq: Don't WARN continuously in arch_local_irq_restore() Date: Thu, 18 Jul 2019 23:56:11 -0400 Message-Id: <20190719035643.14300-140-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ Upstream commit 0fc12c022ad25532b66bf6f6c818ee1c1d63e702 ] When CONFIG_PPC_IRQ_SOFT_MASK_DEBUG is enabled (uncommon), we have a series of WARN_ON's in arch_local_irq_restore(). These are "should never happen" conditions, but if they do happen they can flood the console and render the system unusable. So switch them to WARN_ON_ONCE(). Fixes: e2b36d591720 ("powerpc/64: Don't trace code that runs with the soft irq mask unreconciled") Fixes: 9b81c0211c24 ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely") Fixes: 7c0482e3d055 ("powerpc/irq: Fix another case of lazy IRQ state getting out of sync") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190708061046.7075-1-mpe@ellerman.id.au Signed-off-by: Sasha Levin --- arch/powerpc/kernel/irq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index bc68c53af67c..5645bc9cbc09 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -255,7 +255,7 @@ notrace void arch_local_irq_restore(unsigned long mask) irq_happened = get_irq_happened(); if (!irq_happened) { #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG - WARN_ON(!(mfmsr() & MSR_EE)); + WARN_ON_ONCE(!(mfmsr() & MSR_EE)); #endif return; } @@ -268,7 +268,7 @@ notrace void arch_local_irq_restore(unsigned long mask) */ if (!(irq_happened & PACA_IRQ_HARD_DIS)) { #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG - WARN_ON(!(mfmsr() & MSR_EE)); + WARN_ON_ONCE(!(mfmsr() & MSR_EE)); #endif __hard_irq_disable(); #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG @@ -279,7 +279,7 @@ notrace void arch_local_irq_restore(unsigned long mask) * warn if we are wrong. Only do that when IRQ tracing * is enabled as mfmsr() can be costly. */ - if (WARN_ON(mfmsr() & MSR_EE)) + if (WARN_ON_ONCE(mfmsr() & MSR_EE)) __hard_irq_disable(); #endif } -- 2.20.1