From patchwork Tue Apr 3 17:08:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 10321575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D5ED602C8 for ; Tue, 3 Apr 2018 17:09:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DFF428740 for ; Tue, 3 Apr 2018 17:09:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 028632856B; Tue, 3 Apr 2018 17:09:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2EE12856B for ; Tue, 3 Apr 2018 17:09:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752639AbeDCRIy (ORCPT ); Tue, 3 Apr 2018 13:08:54 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:32955 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752576AbeDCRIw (ORCPT ); Tue, 3 Apr 2018 13:08:52 -0400 Received: by mail-oi0-f66.google.com with SMTP id 126-v6so16664317oig.0; Tue, 03 Apr 2018 10:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nECTDkqF+CqA2lu2R1kMCmoSbnkRea/WyzvJZvYNot4=; b=lSzWvJc0WYcd22KEeR+ivD59HE9pfOqXmxyZEjYVCff0QSfIU50bDplgLPItq/9iJC uKkTtqv3AocOmRy4xn7GupWD4aYHhAdb6UsQ1F+H7AzlP2TYGvwfONBv19s4nbHAMtGN WKJUDJVIj1/BbuQXgr5T1keRBGNuBY281Il5Ekd2a0/p7A2FxOFs1OC4bomBmLwAiukl av0+swG7CGqLeGHe/Owcwx2dXZtudGKRUSdo27bZeuJidx4SUEsFTj2D3cORxnbEr98U XMzvPvW2u9jMHe6D7/z3cfEpOyzDhJbNwGnVeel6hoFRznT15+JIM0YmsuswWmuSX/w6 QOJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nECTDkqF+CqA2lu2R1kMCmoSbnkRea/WyzvJZvYNot4=; b=Lfm1VFwsGaCNq0SJnqy/+M06fgXi/d4G11ytpQdvQHkV8LiiJBdmJtLkfIPYMP3E91 1Gfs7yWI7UzHXeUpgnPUJeqTLKYiWRaHXjQkUF2yzqpJLkRGLQKXUYwxi09ggShxiQrb pZHFYctYNklntA6UmNfge/2kQgYk+sKrtD1NAAhH1ZX9UGhTP94YmRyLfUY1n9Y41mE3 oIk1DkxzCerPD7jpUaTHQn/TYLSJvtEc2iV81gSAz0al2QS6fYGyJ2odP9WutegsSeO1 KNEPojoWBHAAcsXBCjI8GWFpxjPxjLAGLoOm9k7J1cFCe3R/lxZApmGFl3cmzI3tY/sl nWYg== X-Gm-Message-State: ALQs6tD3idAk2PvWmSRuo5osrsBvRWdGEz23PVcvUvUpJSVkh0Ygxe+p 90qGBivgJsh9UdjVV+Lawv2Aoe+8 X-Google-Smtp-Source: AIpwx49LY6ZzV508jnHY5489gn+HkdoLlfgYcaQEHqae8fHCN9nrVCBsgQ0skhkZq8WVVH/mre6WWA== X-Received: by 2002:aca:e008:: with SMTP id x8-v6mr7678278oig.345.1522775331256; Tue, 03 Apr 2018 10:08:51 -0700 (PDT) Received: from nuclearis2_1.lan (c-98-197-2-30.hsd1.tx.comcast.net. [98.197.2.30]) by smtp.gmail.com with ESMTPSA id p35-v6sm1763878ota.72.2018.04.03.10.08.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 10:08:50 -0700 (PDT) From: Alexandru Gagniuc To: linux-acpi@vger.kernel.org Cc: rjw@rjwysocki.net, lenb@kernel.org, tony.luck@intel.com, bp@alien8.de, tbaicar@codeaurora.org, will.deacon@arm.com, james.morse@arm.com, shiju.jose@huawei.com, zjzhang@codeaurora.org, gengdongjiu@huawei.com, linux-kernel@vger.kernel.org, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, Alexandru Gagniuc Subject: [RFC PATCH 2/4] acpi: apei: Swap ghes_print_queued_estatus and ghes_proc_in_irq Date: Tue, 3 Apr 2018 12:08:28 -0500 Message-Id: <20180403170830.29282-3-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180403170830.29282-1-mr.nuke.me@gmail.com> References: <20180403170830.29282-1-mr.nuke.me@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move ghes_print_queued_estatus() above ghes_proc_in_irq(). In a subsequent patch, the NMI handler will be updated, and the print functionality will be used in ghes_proc_in_irq. This simply makes the subsequent diff look sane. Signed-off-by: Alexandru Gagniuc --- drivers/acpi/apei/ghes.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 25cf77a18e0a..2c998125b1d5 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -870,13 +870,12 @@ static atomic_t ghes_in_nmi = ATOMIC_INIT(0); static LIST_HEAD(ghes_nmi); -static void ghes_proc_in_irq(struct irq_work *irq_work) +static void ghes_print_queued_estatus(void) { - struct llist_node *llnode, *next; + struct llist_node *llnode; struct ghes_estatus_node *estatus_node; struct acpi_hest_generic *generic; struct acpi_hest_generic_status *estatus; - u32 len, node_len; llnode = llist_del_all(&ghes_estatus_llist); /* @@ -885,30 +884,22 @@ static void ghes_proc_in_irq(struct irq_work *irq_work) */ llnode = llist_reverse_order(llnode); while (llnode) { - next = llnode->next; estatus_node = llist_entry(llnode, struct ghes_estatus_node, llnode); estatus = GHES_ESTATUS_FROM_NODE(estatus_node); - len = cper_estatus_len(estatus); - node_len = GHES_ESTATUS_NODE_LEN(len); - ghes_do_proc(estatus_node->ghes, estatus); - if (!ghes_estatus_cached(estatus)) { - generic = estatus_node->generic; - if (ghes_print_estatus(NULL, generic, estatus)) - ghes_estatus_cache_add(generic, estatus); - } - gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node, - node_len); - llnode = next; + generic = estatus_node->generic; + ghes_print_estatus(NULL, generic, estatus); + llnode = llnode->next; } } -static void ghes_print_queued_estatus(void) +static void ghes_proc_in_irq(struct irq_work *irq_work) { - struct llist_node *llnode; + struct llist_node *llnode, *next; struct ghes_estatus_node *estatus_node; struct acpi_hest_generic *generic; struct acpi_hest_generic_status *estatus; + u32 len, node_len; llnode = llist_del_all(&ghes_estatus_llist); /* @@ -917,12 +908,21 @@ static void ghes_print_queued_estatus(void) */ llnode = llist_reverse_order(llnode); while (llnode) { + next = llnode->next; estatus_node = llist_entry(llnode, struct ghes_estatus_node, llnode); estatus = GHES_ESTATUS_FROM_NODE(estatus_node); - generic = estatus_node->generic; - ghes_print_estatus(NULL, generic, estatus); - llnode = llnode->next; + len = cper_estatus_len(estatus); + node_len = GHES_ESTATUS_NODE_LEN(len); + ghes_do_proc(estatus_node->ghes, estatus); + if (!ghes_estatus_cached(estatus)) { + generic = estatus_node->generic; + if (ghes_print_estatus(NULL, generic, estatus)) + ghes_estatus_cache_add(generic, estatus); + } + gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node, + node_len); + llnode = next; } }