From patchwork Tue Dec 9 16:22:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 419168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A45CE1400D5 for ; Wed, 10 Dec 2014 03:22:58 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 8FD8B1A04F2 for ; Wed, 10 Dec 2014 03:22:58 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [122.248.162.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 23D1F1A0551 for ; Wed, 10 Dec 2014 03:22:54 +1100 (AEDT) Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Dec 2014 21:52:52 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp05.in.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 9 Dec 2014 21:52:51 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 4B0BC1258043 for ; Tue, 9 Dec 2014 21:53:13 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB9GNRh64456852 for ; Tue, 9 Dec 2014 21:53:27 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sB9GMn4U018558 for ; Tue, 9 Dec 2014 21:52:49 +0530 Received: from hegdevasant.in.ibm.com ([9.80.67.90]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sB9GMk1W018179; Tue, 9 Dec 2014 21:52:48 +0530 To: skiboot@lists.ozlabs.org From: Vasant Hegde Date: Tue, 09 Dec 2014 21:52:45 +0530 Message-ID: <20141209162242.27549.40005.stgit@hegdevasant.in.ibm.com> In-Reply-To: <20141209162219.27549.61942.stgit@hegdevasant.in.ibm.com> References: <20141209162219.27549.61942.stgit@hegdevasant.in.ibm.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14120916-0017-0000-0000-0000029DD9E6 Subject: [Skiboot] [PATCH 2/2] Enable warn_unused_result for fsp_fetch_data_queue() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" fsp_fetch_data_queue() internally calls fsp_queue_msg(). So ideally we should consume the result of this function. Signed-off-by: Vasant Hegde --- hw/fsp/fsp-codeupdate.c | 29 +++++++++++++++++++++-------- include/fsp.h | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/hw/fsp/fsp-codeupdate.c b/hw/fsp/fsp-codeupdate.c index 4f1a6a5..0d50f0c 100644 --- a/hw/fsp/fsp-codeupdate.c +++ b/hw/fsp/fsp-codeupdate.c @@ -304,6 +304,7 @@ static void fetch_lid_data_complete(struct fsp_msg *msg) uint32_t lid_id, offset; uint16_t id; uint8_t flags, status; + int rc; status = (msg->resp->word1 >> 8) & 0xff; flags = (msg->data.words[0] >> 16) & 0xff; @@ -327,10 +328,16 @@ static void fetch_lid_data_complete(struct fsp_msg *msg) chunk = MARKER_LID_SIZE - offset; if (chunk > 0) { buffer = (void *)PSI_DMA_CODE_UPD + offset; - fsp_fetch_data_queue(flags, id, lid_id, - offset, buffer, &chunk, - fetch_lid_data_complete); - return; + rc = fsp_fetch_data_queue(flags, id, lid_id, + offset, buffer, &chunk, + fetch_lid_data_complete); + + /* If queue msg fails, then continue with marker LID + * validation hoping that we have at least boot side + * information. + */ + if (rc == OPAL_SUCCESS) + return; } break; default: /* Fetch LID call failed */ @@ -341,10 +348,16 @@ static void fetch_lid_data_complete(struct fsp_msg *msg) if (lid_id == P_COM_MARKER_LID_ID && lid_fetch_side == FETCH_BOTH_SIDE) { length = MARKER_LID_SIZE; - fsp_fetch_data_queue(flags, id, T_COM_MARKER_LID_ID, - 0, (void *)PSI_DMA_CODE_UPD, - &length, fetch_lid_data_complete); - return; + rc = fsp_fetch_data_queue(flags, id, T_COM_MARKER_LID_ID, + 0, (void *)PSI_DMA_CODE_UPD, + &length, fetch_lid_data_complete); + + /* If queue msg fails, then continue with marker LID + * validation hoping that we have at least boot side + * information. + */ + if (rc == OPAL_SUCCESS) + return; } lock(&flash_lock); diff --git a/include/fsp.h b/include/fsp.h index dccc78c..ead1680 100644 --- a/include/fsp.h +++ b/include/fsp.h @@ -708,7 +708,7 @@ extern int fsp_fetch_data(uint8_t flags, uint16_t id, uint32_t sub_id, uint32_t offset, void *buffer, size_t *length); extern int fsp_fetch_data_queue(uint8_t flags, uint16_t id, uint32_t sub_id, uint32_t offset, void *buffer, size_t *length, - void (*comp)(struct fsp_msg *msg)); + void (*comp)(struct fsp_msg *msg)) __warn_unused_result; extern bool fsp_load_resource(enum resource_id id, void *buf, size_t *size); /* FSP console stuff */