From patchwork Mon Dec 3 18:05:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10710191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 749B21057 for ; Mon, 3 Dec 2018 18:06:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 671282B47E for ; Mon, 3 Dec 2018 18:06:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 589312B10A; Mon, 3 Dec 2018 18:06:46 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8B2E2B10A for ; Mon, 3 Dec 2018 18:06:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B69956B69A4; Mon, 3 Dec 2018 13:06:44 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B19F66B69DD; Mon, 3 Dec 2018 13:06:44 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E3F76B6A31; Mon, 3 Dec 2018 13:06:44 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by kanga.kvack.org (Postfix) with ESMTP id 722C66B69A4 for ; Mon, 3 Dec 2018 13:06:44 -0500 (EST) Received: by mail-ot1-f69.google.com with SMTP id r24so3731836otk.7 for ; Mon, 03 Dec 2018 10:06:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=oKQiBv4c8SCObAeH6gAm7qQfsLUE0f47p7oCQKPtu88=; b=mErsXF5Vv4XjtbLqu6ymoKoFFcr+Bzka7iwyn0bSJiJO31yICw/H21Fc2fQ0xxco/n 8FLxSV4CPquQsCiAZjlHPOVhZA0vESrsSKcnNDv0VWWyE6BN5cPv5k6KqEwzujlTf5VI xTFxHsKeOUWOGuIeYeYIpQyfQ+olfMzTEzVImKZaaYgXcZsImcYaEUaWRowXUvB8uj6F adpkniXS3VAdkJgoq96tzli+/IZuKVFfmzNSO3v6ath0Rsmyl8S4VeG+D/z7eVR4TN9Y SN+MXLgpH3HnLDV5DE4v6PTuADYgqAaaaOdZ3gU1k3Qj6j03SCN9xUUtyd+loZIVPCgb tGVw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com X-Gm-Message-State: AA+aEWZO1Wy4XZcf7NqhQMF1AkTCfSJ9lV6V9qkOG5Wkqah+A82RrD1O 9aZdQ4izzwYqg59mPmcK2piVwp1FFfhWItM6LlRvzUtqDLeOKH9NIVk+FTvCeuC7i7zqh9Xog0N VBQgavptEohmdDV3iAnRNsLI2EKN+PV9C4OQHjjP50QQqea+5fwV6jiuxOhsVgAgpkw== X-Received: by 2002:aca:b4c5:: with SMTP id d188mr10692048oif.309.1543860404190; Mon, 03 Dec 2018 10:06:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/UqyQZ3ajxPF3eMv7M2kcMtCjJbmWxMOCZiyFe8lEmZFdqWQ+619sCMVbBnF8pTgzSRH1hK X-Received: by 2002:aca:b4c5:: with SMTP id d188mr10692019oif.309.1543860403471; Mon, 03 Dec 2018 10:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543860403; cv=none; d=google.com; s=arc-20160816; b=pYHFw67g29jXt7MuYNvC5ciKPBSShdII7+G+e6rItbK9If959Uyhgozvd7ujBlZUp1 pa5409dBvfq8xwdPZUNKFQHknZHm3GvUBQiKWIDZO8IjbVDpCkpYR9QpspxZu4Q9rLVq NhKcjx+X5Xs1BIp/aocqlLzTJe57I5l85Lu5hfJGX+LL7NGlAyN4xuPkc7almnnmzlht XGX2eZ3RCsnbb+HSdfTPqUYkOm3bql8xggXsDI9J1s9+tAfw7tgjzY96U5WMYU36+ilQ dD6a18tV/APbfnYDDfT9BBzpyCJvp9LkkECO4SAsJhUN2kFuDNtv6NAjgZ3GhqDSqKik ChwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=oKQiBv4c8SCObAeH6gAm7qQfsLUE0f47p7oCQKPtu88=; b=Tl0tcnmYfe0tCfPaKHn+HLbi/abyi1YWRUIUnjTCseDGXkW5jP5n2KEzWimTSXVIVU 55DPIitKz309N8ygvJMUAlOd9fDnY70Um2Gwki365c+3+mAjXX6gc1Xkccd2Pbbi4vOd 2Jbab6bdAdL3RC8HuYC19++5mqCeG50iV98VAgYXU6N7ZCFvk6dcwxuywmL2rHxAAwyO vMVQJctPOAu66UbHaHOh8nz6Zegx96l2hv0AbUgDVNVpEFwtm23Tutwy9HvYWHN8sXvb qsIZkXBW0mZd+RGXdZFBUAaQBlIg9x8RyJx8DvOvHFosUJgb0d5VYySQU2Ui3eFw+Y0+ 2EPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id r137si6131581oie.147.2018.12.03.10.06.43 for ; Mon, 03 Dec 2018 10:06:43 -0800 (PST) Received-SPF: pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of james.morse@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=james.morse@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E6CA7168F; Mon, 3 Dec 2018 10:06:42 -0800 (PST) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22BD73F59C; Mon, 3 Dec 2018 10:06:39 -0800 (PST) From: James Morse To: linux-acpi@vger.kernel.org Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Borislav Petkov , Marc Zyngier , Christoffer Dall , Will Deacon , Catalin Marinas , Naoya Horiguchi , Rafael Wysocki , Len Brown , Tony Luck , Dongjiu Geng , Xie XiuQi , Fan Wu , James Morse Subject: [PATCH v7 02/25] ACPI / APEI: Remove silent flag from ghes_read_estatus() Date: Mon, 3 Dec 2018 18:05:50 +0000 Message-Id: <20181203180613.228133-3-james.morse@arm.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181203180613.228133-1-james.morse@arm.com> References: <20181203180613.228133-1-james.morse@arm.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Subsequent patches will split up ghes_read_estatus(), at which point passing around the 'silent' flag gets annoying. This is to suppress prink() messages, which prior to commit 42a0bb3f7138 ("printk/nmi: generic solution for safe printk in NMI"), were unsafe in NMI context. This is no longer necessary, remove the flag. printk() messages are batched in a per-cpu buffer and printed via irq-work, or a call back from panic(). Signed-off-by: James Morse Reviewed-by: Borislav Petkov --- Changes since v6: * Moved earlier in the series, * Tinkered with the commit message. * switched to pr_warn_ratelimited() to shut checkpatch up shutup checkpatch --- drivers/acpi/apei/ghes.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index ab2dae6fc7e4..e8503c7d721f 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -324,7 +324,7 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len, } } -static int ghes_read_estatus(struct ghes *ghes, int silent) +static int ghes_read_estatus(struct ghes *ghes) { struct acpi_hest_generic *g = ghes->generic; u64 buf_paddr; @@ -333,8 +333,7 @@ static int ghes_read_estatus(struct ghes *ghes, int silent) rc = apei_read(&buf_paddr, &g->error_status_address); if (rc) { - if (!silent && printk_ratelimit()) - pr_warning(FW_WARN GHES_PFX + pr_warn_ratelimited(FW_WARN GHES_PFX "Failed to read error status block address for hardware error source: %d.\n", g->header.source_id); return -EIO; @@ -366,9 +365,9 @@ static int ghes_read_estatus(struct ghes *ghes, int silent) rc = 0; err_read_block: - if (rc && !silent && printk_ratelimit()) - pr_warning(FW_WARN GHES_PFX - "Failed to read error status block!\n"); + if (rc) + pr_warn_ratelimited(FW_WARN GHES_PFX + "Failed to read error status block!\n"); return rc; } @@ -700,7 +699,7 @@ static int ghes_proc(struct ghes *ghes) { int rc; - rc = ghes_read_estatus(ghes, 0); + rc = ghes_read_estatus(ghes); if (rc) goto out; @@ -937,7 +936,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) return ret; list_for_each_entry_rcu(ghes, &ghes_nmi, list) { - if (ghes_read_estatus(ghes, 1)) { + if (ghes_read_estatus(ghes)) { ghes_clear_estatus(ghes); continue; } else {