Received: by 10.213.65.68 with SMTP id h4csp451864imn; Tue, 13 Mar 2018 09:29:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELvlhcOB13eUqpH81Ry0LXm2kXW49NQA/ooWykCsHK+94K2ee6miJRNaYcR36Atkbyf+wzSQ X-Received: by 10.99.97.130 with SMTP id v124mr946138pgb.351.1520958543238; Tue, 13 Mar 2018 09:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958543; cv=none; d=google.com; s=arc-20160816; b=YnSmYqMMeyIY+DDeS0LfNy1a28HFzhoLlNCPBd241YphDIQEAFR7JkrUXvD52fmCDC sOCkgFQlEAkPirJ29vsNMzphyRVNzwEebed2XXWmfBvK4UTnmV4v1Ez0j5SidyA3b2qS 1kYkIbp651J112frGWsQa2fOw5ufAXlCb6mtuZl5+jG/QalKtmkyss5rtQwOku3/bl9V MhNhMS1W+KYZKstF6z8KpsfVov2z8PcMaWs57pFn4zbO7Haj+0DXRAnoZAjvNJ8km5o0 WQVEMYgjoyt01Nw6M0eJ2k40RjIEdtSFSVE58sWQV2kdxGZliXbUldOR4KJWHMSS+MQJ Gfnw== 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=EohaFwRcw2i6Snyg/c6EBHjMhy8XjkwcZELeJm0EafI=; b=Kan8P74uZdicV0utxdyaG22NsZPfJItXvSvuzsL69MqUBr08X2ui164NCs+yiDK9Lz XXBjXbXmJyGPF+XaEiJkFv5JlLo07cSMW2s+pvZjxaKNMyZ5YNa6LCvg5HvgK3daN6Vi 2/xoxG9J48WM7HDNGHwjNPRM4DaOiJfQerZ1bGLA/V1F/neuOrpfP+y6K9W0hQ4L3+qm otWxG55I+M68k93V4JFcIG4/poObNcFgCdk5WA/ZR4kRTgxxgH3nhO06upWYau33kNJR vHY5BSM/imncgukgH4pjEwz3wQeslK9f5BA4dsqAeEdxkieTHeQUkERUvrPSRNKd1Qbe f2Fg== 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 n25si308758pgc.87.2018.03.13.09.28.48; Tue, 13 Mar 2018 09:29:03 -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 S932608AbeCMPdq (ORCPT + 99 others); Tue, 13 Mar 2018 11:33:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60818 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933604AbeCMPdn (ORCPT ); Tue, 13 Mar 2018 11:33:43 -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 C7CDB1011; Tue, 13 Mar 2018 15:33:42 +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.15 105/146] watchdog: hpwdt: Check source of NMI Date: Tue, 13 Mar 2018 16:24:32 +0100 Message-Id: <20180313152328.544025086@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@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.15-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;