From patchwork Tue Dec 20 14:16:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vipin K Parashar X-Patchwork-Id: 707462 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 3tjfyl4n70z9t0v for ; Wed, 21 Dec 2016 01:18:23 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tjfyl42X7zDwYB for ; Wed, 21 Dec 2016 01:18:23 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tjfxk3cQzzDwJS for ; Wed, 21 Dec 2016 01:17:30 +1100 (AEDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBKEETTd102016 for ; Tue, 20 Dec 2016 09:17:28 -0500 Received: from e28smtp07.in.ibm.com (e28smtp07.in.ibm.com [125.16.236.7]) by mx0a-001b2d01.pphosted.com with ESMTP id 27f2adp8j2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 20 Dec 2016 09:17:28 -0500 Received: from localhost by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Dec 2016 19:47:24 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 20 Dec 2016 19:47:22 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id CBB51E005A for ; Tue, 20 Dec 2016 19:48:02 +0530 (IST) Received: from d28av07.in.ibm.com (d28av07.in.ibm.com [9.184.220.146]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uBKEHE9F22282362 for ; Tue, 20 Dec 2016 19:47:14 +0530 Received: from d28av07.in.ibm.com (localhost [127.0.0.1]) by d28av07.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uBKEHDd0030902 for ; Tue, 20 Dec 2016 19:47:14 +0530 Received: from Workstation.in.ibm.com (workstation.in.ibm.com [9.124.35.242]) by d28av07.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uBKEHAQ6030579; Tue, 20 Dec 2016 19:47:11 +0530 From: Vipin K Parashar To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails Date: Tue, 20 Dec 2016 19:46:59 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16122014-0024-0000-0000-0000036BA6CE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16122014-0025-0000-0000-0000107E2F7D Message-Id: <1482243419-23041-1-git-send-email-vipin@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-20_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612200177 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vipin K Parashar Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Added check for OPAL_WRONG_STATE error code returned from OPAL. Currently Linux flashes "unexpected error" over console for this error. This will avoid throwing such message and return I/O error for such OPAL failures. Signed-off-by: Vipin K Parashar Reviewed-by: Mukesh Ojha --- arch/powerpc/platforms/powernv/opal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 2822935..ab91d53 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -866,9 +866,10 @@ int opal_error_code(int rc) case OPAL_NO_MEM: return -ENOMEM; case OPAL_PERMISSION: return -EPERM; - case OPAL_UNSUPPORTED: return -EIO; - case OPAL_HARDWARE: return -EIO; - case OPAL_INTERNAL_ERROR: return -EIO; + case OPAL_UNSUPPORTED: + case OPAL_HARDWARE: + case OPAL_INTERNAL_ERROR: + case OPAL_WRONG_STATE: return -EIO; default: pr_err("%s: unexpected OPAL error %d\n", __func__, rc); return -EIO;