From patchwork Fri Mar 27 09:22:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 6104621 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC93A9F2A9 for ; Fri, 27 Mar 2015 09:26:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 099E9203ED for ; Fri, 27 Mar 2015 09:26:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43A7820412 for ; Fri, 27 Mar 2015 09:26:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbbC0J0F (ORCPT ); Fri, 27 Mar 2015 05:26:05 -0400 Received: from mail.skyhub.de ([78.46.96.112]:58661 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340AbbC0JYv (ORCPT ); Fri, 27 Mar 2015 05:24:51 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1427448289; bh=bIuCkDVsPa7uk15uDlhPnSW/kIbSMqnzUUe7RVdExhE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=mqPS zg/5UvjJhEeB890oec5okwWfyhIHz6kHn9GmyCV4cZFguHdzxPbumKzIz6GXPJ7cgyn 72bkoFx1sO8vAVV+bDi6fieP9zVjT5LKGM/EXUk9AjUN7qtBUTpf1OursQNpKzejZn1 8Uw9jS6j096YrqUWdPyw/cqz+neCPDkcc= Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FTPf1u0c3zaz; Fri, 27 Mar 2015 10:24:49 +0100 (CET) Received: from pd.tnic (p5DDC6BAA.dip0.t-ipconnect.de [93.220.107.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BC0F71D99A0; Fri, 27 Mar 2015 10:24:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1427448289; bh=bIuCkDVsPa7uk15uDlhPnSW/kIbSMqnzUUe7RVdExhE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=mqPS zg/5UvjJhEeB890oec5okwWfyhIHz6kHn9GmyCV4cZFguHdzxPbumKzIz6GXPJ7cgyn 72bkoFx1sO8vAVV+bDi6fieP9zVjT5LKGM/EXUk9AjUN7qtBUTpf1OursQNpKzejZn1 8Uw9jS6j096YrqUWdPyw/cqz+neCPDkcc= Received: by pd.tnic (Postfix, from userid 1000) id 38BBF1617C6; Fri, 27 Mar 2015 10:23:01 +0100 (CET) From: Borislav Petkov To: linux-edac Cc: Borislav Petkov , "Rafael J. Wysocki" , Len Brown , Tony Luck , Tomasz Nowicki , "Chen, Gong" , Wolfram Sang , Lv Zheng , Naoya Horiguchi , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 4/5] GHES: Elliminate double-loop in the NMI handler Date: Fri, 27 Mar 2015 10:22:57 +0100 Message-Id: <1427448178-20689-5-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1427448178-20689-1-git-send-email-bp@alien8.de> References: <1427448178-20689-1-git-send-email-bp@alien8.de> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Borislav Petkov There's no real need to iterate twice over the HW error sources in the NMI handler. With the previous cleanups, elliminating the second loop is almost trivial. Signed-off-by: Borislav Petkov --- drivers/acpi/apei/ghes.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 0de3adcca03e..94a44bad5576 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -851,25 +851,18 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) if (sev >= GHES_SEV_PANIC) __ghes_panic(ghes); - ret = NMI_HANDLED; - } - - if (ret == NMI_DONE) - goto out; - - list_for_each_entry_rcu(ghes, &ghes_nmi, list) { if (!(ghes->flags & GHES_TO_CLEAR)) continue; __process_error(ghes); ghes_clear_estatus(ghes); + + ret = NMI_HANDLED; } #ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG irq_work_queue(&ghes_proc_irq_work); #endif - -out: raw_spin_unlock(&ghes_nmi_lock); return ret; }