From patchwork Fri Jun 15 18:33:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Kennington X-Patchwork-Id: 930152 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 416q1f1nLPz9s3R for ; Sat, 16 Jun 2018 04:35:50 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="LpMnwmw5"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 416q1f0GLNzF0tP for ; Sat, 16 Jun 2018 04:35:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="LpMnwmw5"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=flex--wak.bounces.google.com (client-ip=2607:f8b0:4002:c05::24a; helo=mail-yw0-x24a.google.com; envelope-from=3haykwwmkdaexblhpphmf.dpnmjovyqqd-efwmjtut.p0mbct.psh@flex--wak.bounces.google.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="LpMnwmw5"; dkim-atps=neutral Received: from mail-yw0-x24a.google.com (mail-yw0-x24a.google.com [IPv6:2607:f8b0:4002:c05::24a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 416pzM66TrzF0l6 for ; Sat, 16 Jun 2018 04:33:44 +1000 (AEST) Received: by mail-yw0-x24a.google.com with SMTP id w7-v6so7921316ywf.1 for ; Fri, 15 Jun 2018 11:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:message-id:subject:from:to:cc; bh=LcUQlZExGyfuOsgFOlsT1jnPnTOTaIwEolI4AIPAjoo=; b=LpMnwmw5CO4jO9MDLFu/QjhWUuh0fM7toLqVAnx4SRNocYnsPWpQ6ahtJfWpjhBZsm WLOVBUSMdUBpOS2PfNexUqbfxwrv82Cqs3c5d91s/0cjLgnqdIpELwbfi02xWYynkbKb ZkvFofCjW0f5KBj+iwjWwmLtXgvl9RM9+LOnbRhCbAptnWV3MJZucrCbYt62nLTx7Nxt q5eLbDoRmlL/9ncc3kszVLiVg/iulPWMRjKTJZYynuzIJ+uWL9UHh7skSlDQzLBAL9xg f4Pk0Bh30AuyWOdRfY7pIVhCVBLiTs48o417vJ5JS0lQpfdd1RiEwOYAAicLJ6XEJjV4 IAAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=LcUQlZExGyfuOsgFOlsT1jnPnTOTaIwEolI4AIPAjoo=; b=f2pxzyZ7k6GddLbImQpIc+TWBL/W2SXAm3nNna6br2564LEwnfUv4DDm5ps4kivS8Y nOOI5Lh4rEu72qOA7j+25q9XjaiVFAqhLXJR6C7fRYgPbUQSEeFqoyEAuId+xDtIWRD0 G72Lml1qIPijF3pqe7MCKRv+cw4CKo90n17b2FxF0mW5ezJbTEFnv6kMC3RhT9Gx9L/P vdsiv+86F4Pl8hYRu4oa0DwXFDzugo+qXfI7V1YDrt259ZLA0sMqd/jZjKLeqK0j/wHo Fh5kHAcAlLK+xghBzLQ5rCuxMvqVSpIMWma7yq9VwY4JGFjvrMqcucD95Q3ytYzzAoUb YFQA== X-Gm-Message-State: APt69E09UZf3eD8kyhQF6iKMy/3yW1IQ5ULWBsCyVpRtXFCBk1FNw0cu xmanVmZFqxA88Uc6cCXtfqyQoQ+/FDY6NiT8bFxdH+t0EEH2QlHmyFRZEXCsWVNlPugIpT5Yy+O XZy+XKD4bjgtLn1mXuy3i1aj0z990dP8ci1xcZDFyNhxS0YErWygWRBsmMnzaFzU= X-Google-Smtp-Source: ADUXVKLuhyP9Gxf4B/ogLcoeYKUVXujRfx/m/YRrT0LBMzi1xpxaNYRDHNC7JUsSTxKe297BnP19eL8= MIME-Version: 1.0 X-Received: by 2002:a81:9146:: with SMTP id i67-v6mr767963ywg.181.1529087620711; Fri, 15 Jun 2018 11:33:40 -0700 (PDT) Date: Fri, 15 Jun 2018 11:33:32 -0700 Message-Id: <20180615183332.249253-1-wak@google.com> X-Mailer: git-send-email 2.17.0 Subject: [PATCH] ipmi/powernv: Fix spurious warnings at boot From: "William A. Kennington III" To: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "William A. Kennington III" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Sometimes we have stale messages showing up in the recv queue that are being processed by the pollers. We don't want to print out warnings for these messages not having an outstanding request as they can be expected when doing a kexec from the petitroot environment or from another running kernel. Signed-off-by: William A. Kennington III --- drivers/char/ipmi/ipmi_powernv.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c index e96500372ce20..36b07f26cebd9 100644 --- a/drivers/char/ipmi/ipmi_powernv.c +++ b/drivers/char/ipmi/ipmi_powernv.c @@ -31,6 +31,12 @@ struct ipmi_smi_powernv { spinlock_t msg_lock; struct ipmi_smi_msg *cur_msg; struct opal_ipmi_msg *opal_msg; + + /** + * Marker denoting if we should be draining the ipmi queue of any + * outstanding messages + */ + bool in_drain; }; static int ipmi_powernv_start_processing(void *send_info, ipmi_smi_t intf) @@ -96,6 +102,7 @@ static void ipmi_powernv_send(void *send_info, struct ipmi_smi_msg *msg) if (!rc) { smi->cur_msg = msg; + smi->in_drain = false; spin_unlock_irqrestore(&smi->msg_lock, flags); return; } @@ -121,8 +128,14 @@ static int ipmi_powernv_recv(struct ipmi_smi_powernv *smi) spin_lock_irqsave(&smi->msg_lock, flags); if (!smi->cur_msg) { + bool in_drain = READ_ONCE(smi->in_drain); spin_unlock_irqrestore(&smi->msg_lock, flags); - pr_warn("no current message?\n"); + /** + * We don't want to print spurious errors if we are draining + * leftover messages prior to sending our first message. + */ + if (!in_drain) + pr_warn("no current message?\n"); return 0; } @@ -226,6 +239,11 @@ static int ipmi_powernv_probe(struct platform_device *pdev) spin_lock_init(&ipmi->msg_lock); + /* Our channel may have stale messages from a previous kernel + * let the recv code know we haven't actually sent anything yet + */ + ipmi->in_drain = true; + rc = of_property_read_u32(dev->of_node, "ibm,ipmi-interface-id", &prop); if (rc) {