Received: by 10.213.65.68 with SMTP id h4csp447240imn; Tue, 13 Mar 2018 09:19:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELsE30VVqVs2TmW93doC7ilfqMRmlCRldLahHdmx+HCm34owiwzdH5r0CfQlFS+HMPF3sV2l X-Received: by 10.98.223.93 with SMTP id u90mr1157120pfg.13.1520957992242; Tue, 13 Mar 2018 09:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957992; cv=none; d=google.com; s=arc-20160816; b=vG7Nkxu8iY8CVMEb/22/lCQbCW6eUPRKAGU2OvlblVHwB9gNWyH9eY1fpagvSxkwjp xv0gOqzA79c3ti/LylV7HgLbMFAlldSnTs6sgwGfqX/82/INy5URxkqKmlS0A4Wy5Zxu OK+VGXDP8U5RPmQ9g+rwuhw/BQ8flTgCVol95xVzwEvfKZz+J2Nas7lw+QVm95qYLT8m JgzM30mYfpKuGYTKIIV0sXaVdffb3/IZ2jT7W+7N7grqIrrLR8VNQOZWW5c+VUuBIq2y CRbFictaxOkJvWdN9FEP87Jic0qiimA1VYh77S80gzE/kpcHw1gPhN96fH7END8vTNV5 1Tcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7GVLwkBoBQvsqqw3nAk6UKRSkpB6+OGLB/eSxtj56TM=; b=Tf//jqPaHWM/ywvDOTZ5Sd2mh1ZKEimt9jipTx/oW92aAfsGyqqmDkTtXzL9PNyiiZ Biu0g26GW98CaXRiItf/sIgEJGmAMg8B2c9Xm1aBNYKBgJsykDf7adj1H1LIsZOKR4sy qjjbP2X0fzDPCNxDjRVjOg6vfHFg9cZZLB6PndYF0URvEjvnGKTTrAUwOireP7r06dat yFmF/zo9szqNoKLs6vU/L08e0ZGCN4ikhWVOY3Hpa1wyoNKvL0+r9LPLJJLqGMhsVHsd 4y2UrgD2FhmOqhCMLRVoD9pg7gw7Jq1s972RIbBkKumyfGlUOjHmYyBwJR53tiTX35Dx 5ApQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y86si351981pfi.19.2018.03.13.09.19.36; Tue, 13 Mar 2018 09:19:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933889AbeCMPfD (ORCPT + 99 others); Tue, 13 Mar 2018 11:35:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33018 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933840AbeCMPfB (ORCPT ); Tue, 13 Mar 2018 11:35:01 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8E0D710A1; Tue, 13 Mar 2018 15:35:00 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerry Hoemann , Guenter Roeck , Wim Van Sebroeck Subject: [PATCH 4.14 003/140] watchdog: hpwdt: Check source of NMI Date: Tue, 13 Mar 2018 16:23:26 +0100 Message-Id: <20180313152458.412390605@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jerry Hoemann commit 838534e50e2e5c1e644e30ab6cb28da88eb31368 upstream. Do not claim the NMI (i.e. return NMI_DONE) if the source of the NMI isn't the iLO watchdog or debug. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/hpwdt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -52,6 +52,7 @@ static char expect_release; static unsigned long hpwdt_is_open; static void __iomem *pci_mem_addr; /* the PCI-memory address */ +static unsigned long __iomem *hpwdt_nmistat; static unsigned long __iomem *hpwdt_timer_reg; static unsigned long __iomem *hpwdt_timer_con; @@ -474,6 +475,11 @@ static int hpwdt_time_left(void) return TICKS_TO_SECS(ioread16(hpwdt_timer_reg)); } +static int hpwdt_my_nmi(void) +{ + return ioread8(hpwdt_nmistat) & 0x6; +} + #ifdef CONFIG_HPWDT_NMI_DECODING /* * NMI Handler @@ -486,6 +492,9 @@ static int hpwdt_pretimeout(unsigned int if (!hpwdt_nmi_decoding) return NMI_DONE; + if ((ulReason == NMI_UNKNOWN) && !hpwdt_my_nmi()) + return NMI_DONE; + spin_lock_irqsave(&rom_lock, rom_pl); if (!die_nmi_called && !is_icru && !is_uefi) asminline_call(&cmn_regs, cru_rom_addr); @@ -842,6 +851,7 @@ static int hpwdt_init_one(struct pci_dev retval = -ENOMEM; goto error_pci_iomap; } + hpwdt_nmistat = pci_mem_addr + 0x6e; hpwdt_timer_reg = pci_mem_addr + 0x70; hpwdt_timer_con = pci_mem_addr + 0x72;