From patchwork Wed Nov 25 08:31:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ananth N Mavinakayanahalli X-Patchwork-Id: 548434 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 411A6140306 for ; Wed, 25 Nov 2015 19:31:21 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 2B4021A039E for ; Wed, 25 Nov 2015 19:31:21 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp03.in.ibm.com (e28smtp03.in.ibm.com [122.248.162.3]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id A8C811A036D for ; Wed, 25 Nov 2015 19:31:16 +1100 (AEDT) Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Nov 2015 14:01:13 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Nov 2015 14:01:10 +0530 X-Helo: d28dlp01.in.ibm.com X-MailFrom: ananth@in.ibm.com X-RcptTo: skiboot@lists.ozlabs.org Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id D05EEE0054 for ; Wed, 25 Nov 2015 14:01:45 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAP8V9mW22610040 for ; Wed, 25 Nov 2015 14:01:09 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAP8V92W026497 for ; Wed, 25 Nov 2015 14:01:09 +0530 Received: from thinktux.in.ibm.com ([9.109.222.190]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tAP8V8FW026344 for ; Wed, 25 Nov 2015 14:01:08 +0530 From: Ananth N Mavinakayanahalli To: skiboot@lists.ozlabs.org Date: Wed, 25 Nov 2015 14:01:07 +0530 Message-ID: <20151125083107.2269.32029.stgit@thinktux.in.ibm.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15112508-0009-0000-0000-0000090BD017 Subject: [Skiboot] [PATCH] FSP: Give up PSI link on shutdown X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 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" Since we are anyway on the way to standby and apparently the other hypervisor also does this. Tested-by: Vipin K Parashar Signed-off-by: Ananth N Mavinakayanahalli --- hw/fsp/fsp.c | 22 ++++++++++++++++++++++ include/fsp.h | 1 + platforms/ibm-fsp/common.c | 1 + 3 files changed, 24 insertions(+) diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c index b53c3f0..220b97e 100644 --- a/hw/fsp/fsp.c +++ b/hw/fsp/fsp.c @@ -569,6 +569,28 @@ static void fsp_start_rr(struct fsp *fsp) */ } +/* + * Called on normal/quick shutdown to give up the PSI link + */ +void fsp_reset_links(void) +{ + struct fsp *fsp = fsp_get_active(); + struct fsp_iopath *iop; + + if (!fsp) + return; + + /* Already in one of the error states? */ + if (fsp_in_hir(fsp) || fsp_in_reset(fsp)) + return; + + iop = &fsp->iopath[fsp->active_iopath]; + prlog(PR_NOTICE, "FSP #%d: Host initiated shutdown." + " Giving up the PSI link\n", fsp->index); + psi_disable_link(iop->psi); + return; +} + static void fsp_trace_event(struct fsp *fsp, u32 evt, u32 data0, u32 data1, u32 data2, u32 data3) { diff --git a/include/fsp.h b/include/fsp.h index a61bd58..7ea162d 100644 --- a/include/fsp.h +++ b/include/fsp.h @@ -802,6 +802,7 @@ extern void fsp_ipmi_init(void); /* Reset/Reload */ extern void fsp_reinit_fsp(void); extern void fsp_trigger_reset(void); +extern void fsp_reset_links(void); /* FSP memory errors */ extern void fsp_memory_err_init(void); diff --git a/platforms/ibm-fsp/common.c b/platforms/ibm-fsp/common.c index 59a890b..dc3a002 100644 --- a/platforms/ibm-fsp/common.c +++ b/platforms/ibm-fsp/common.c @@ -222,6 +222,7 @@ int64_t ibm_fsp_cec_power_down(uint64_t request) if (fsp_sync_msg(fsp_mkmsg(FSP_CMD_POWERDOWN_NORM, 1, request), true)) return OPAL_INTERNAL_ERROR; + fsp_reset_links(); return OPAL_SUCCESS; }