Received: by 10.192.165.148 with SMTP id m20csp2482994imm; Sun, 22 Apr 2018 08:00:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/sdutmiKpJUVmKeeGxVloCZ50ZeoyHz3WsnSdA1IERr7EoziscxqLZSFeNjf26y+oQeBNR X-Received: by 10.98.101.131 with SMTP id z125mr16904497pfb.208.1524409214500; Sun, 22 Apr 2018 08:00:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524409214; cv=none; d=google.com; s=arc-20160816; b=lbxxbPrT1cAHf9Z/Ov2xHQyWT+AZHJybwzm+8/SpFC2eX0XuV0I1Zc/Zh8jZH2vog+ FIe9uT5UBdyg05Y3TTCW0vh9CIGg+2ZLFg3gVorAbmMI04e8g8+x0IFG7or5PQdikMNc EG/nyIWc42FD9VYXqHzoDUU5WqtYCBvFgr6CqkZMHhuOnoZrWSHKWvKC0cgTBEq+Jlxi ghC89qa1OocTyCe87vzqb87Thsottu7j+ME7pKTQx/UR/xihNZo1EhhX3tEXSKXUmemi kaRPK+3hiAlNbAV+2973hukE+oDkFtchvix7HhaZfF7j3pychmObmwHSTDyV2PSZ1ydL K3uQ== 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=QH/e4IU4k7dDJe0R7GDdzzFRTdyyFHeOnc2LNEyvINk=; b=TJo/qvXi+lEePF8HvKZ9/klDKHZ1yYBAcKMxn/f36pfSdyB3J5ehi5GSGwmnqNmtGo PdKAHGCBsHy4EG1fHEu7g9rP6OPrZv7KCOh17GDq7iNKPONdqjAe2nEu3yVetCqF1W1k 8OmgdLlyoMPcuOmkG5JdC0z6qXqPk7ShHm74g8PnMtx+up+aGKCAMLbSifhOfn3/Xpfw F2gZEAkH0GxaA6IaK3NMLKh1RuscWdIzJHPz1pYlj2FeyMsgBRxdcdJRPWKLifcrLueb dH60UiIBr4QPohVA3mYS7WDSW7C6BWpZglvNye4qSI5sF0Yqzi4wuw+IFldzX8gfvYvb 8pBg== 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 v32-v6si9907474plb.575.2018.04.22.08.00.00; Sun, 22 Apr 2018 08:00:14 -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 S1753678AbeDVO5x (ORCPT + 99 others); Sun, 22 Apr 2018 10:57:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55728 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756578AbeDVON2 (ORCPT ); Sun, 22 Apr 2018 10:13:28 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D6B76CE3; Sun, 22 Apr 2018 14:13:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Vasant Hegde , Stewart Smith , Michael Ellerman Subject: [PATCH 4.9 25/95] powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write() Date: Sun, 22 Apr 2018 15:52:54 +0200 Message-Id: <20180422135211.462498031@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Piggin commit 741de617661794246f84a21a02fc5e327bffc9ad upstream. opal_nvram_write currently just assumes success if it encounters an error other than OPAL_BUSY or OPAL_BUSY_EVENT. Have it return -EIO on other errors instead. Fixes: 628daa8d5abf ("powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks") Cc: stable@vger.kernel.org # v3.2+ Signed-off-by: Nicholas Piggin Reviewed-by: Vasant Hegde Acked-by: Stewart Smith Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/opal-nvram.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/powerpc/platforms/powernv/opal-nvram.c +++ b/arch/powerpc/platforms/powernv/opal-nvram.c @@ -59,6 +59,10 @@ static ssize_t opal_nvram_write(char *bu if (rc == OPAL_BUSY_EVENT) opal_poll_events(NULL); } + + if (rc) + return -EIO; + *index += count; return count; }