Received: by 10.213.65.68 with SMTP id h4csp466005imn; Fri, 16 Mar 2018 08:35:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELvGAOIO2Kk4oI+zRPDWFemIc89oYSgtEStt9X3h3m5W57znIgfcoVKiUu6d8ojI2taIoE7r X-Received: by 2002:a17:902:b43:: with SMTP id 61-v6mr2586141plq.270.1521214528173; Fri, 16 Mar 2018 08:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521214528; cv=none; d=google.com; s=arc-20160816; b=TihG8wnAW92V9+kQo08AKCXd6AaoMI1FZcxLVBa9I/+2b5G6k4VhQPWYMbNUgRrAwT n0XiNWOZQLEFtdgKmWjdzY0Bd2lH8Rap+Nkeq/742keThSBier1y+RGRf+Zo8Q3/efKu nqE0QtS3uKCyZakDY/TsgL5ott2wxx0EQQUDM2KaP3aGox++2MSF5huDZmqyaZgippFE FWYQ5C9Gx4b4QSWsvWIrRjsYYPI6S/YVV0qTMQFb5VklqNPS2vIARPlfO/+5nFB0CJch vSFDJ4JIu7jFwYleRoL+VpgGEDb/Jciqvq0aDaZ7BYgMd/P4pDoBifh4d6b9bHw+6xoK jySQ== 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=A3E36YzjwoMCgLHS+JiIQnvKce+qnIbHMs/trqEeEns=; b=Kt1IOqYRE9fgD9RBMRMGkBJAiapItk9Ps8HaJNRjhr5DAo3uNtEF0kAr1ZMtvkCtov rcJestUhp8yAZcPWmUFcs/F58KD+fHp+9hYHO3SxeKw0Y3dtWL4yR7GWVNoLMiqOw/zL af0AcpFy4ZMvlLhUQWp0MgHHgXS3yw163lkclv5G43gds57ckWB8cPeHpG/79rJeBM0e zyxx1L+Y7uRzHpCEFuvCtsTD3XejgDdB+sugUUwo1iSHD6HOspFCiaubEgeYyzGQQnQZ kJtCNXg1u4xfMeI3ndvbIDkFcYEUX9pr0FXF854FlWRmqNUlK0VNaDY+LiVtFBLCW7lF 8b2A== 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 y16si73710pge.500.2018.03.16.08.35.14; Fri, 16 Mar 2018 08:35:28 -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 S933777AbeCPPdc (ORCPT + 99 others); Fri, 16 Mar 2018 11:33:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39008 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933410AbeCPPd3 (ORCPT ); Fri, 16 Mar 2018 11:33:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 94EF1CA4; Fri, 16 Mar 2018 15:33:28 +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.9 48/86] watchdog: hpwdt: Check source of NMI Date: Fri, 16 Mar 2018 16:23:11 +0100 Message-Id: <20180316152320.665528994@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152317.167709497@linuxfoundation.org> References: <20180316152317.167709497@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.9-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;