From patchwork Wed Oct 14 20:48:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 530370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 78906140DB4 for ; Thu, 15 Oct 2015 07:49:15 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 5BEC51A074C for ; Thu, 15 Oct 2015 07:49:15 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id B9CAE1A0290 for ; Thu, 15 Oct 2015 07:49:09 +1100 (AEDT) Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Oct 2015 21:49:05 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Oct 2015 21:49:03 +0100 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: clg@fr.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id D57911B0805F for ; Wed, 14 Oct 2015 21:49:07 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9EKn2Kv25952326 for ; Wed, 14 Oct 2015 20:49:02 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9EKn2gD005457 for ; Wed, 14 Oct 2015 14:49:02 -0600 Received: from hermes.kaod.org (sig-9-83-54-8.evts.uk.ibm.com [9.83.54.8]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9EKn1HE005453; Wed, 14 Oct 2015 14:49:01 -0600 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 14 Oct 2015 22:48:53 +0200 Message-Id: <1444855733-29993-1-git-send-email-clg@fr.ibm.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15101420-0033-0000-0000-00000468B924 Subject: [Skiboot] [PATCH] fsp/rtc: consider TOD_RESET status as a permanent error 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" When the timeofday is considered INVALID by the FSP : System time is INVALID: 2015/10/14 20:13:53.305261 it will return a FSP_STATUS_TOD_RESET (0xA9) to any TOD read request done by OPAL. This status does not seem to recover after some time and stays invalid permanently. This is a problem for the kernel as the OPAL_RTC_READ calls are done in loops. The consequence is that the skiroot kernel hangs quite early in the boot looping on : [9163642153,3] RTC TOD in invalid state [9186642687,3] RTC TOD in invalid state [9204379669,3] RTC TOD in invalid state [9226043775,3] RTC TOD in invalid state [9240944791,3] RTC TOD in invalid state with other unpleasant consequences following. The system is left unusable and it is difficult for the user to know what is happening. This patch changes the TOD state in OPAL as a permanent TOD error when the time is considered invalid by the FSP. This breaks the loops that are done in the kernel on OPAL_RTC_READ calls and lets the boot complete. Signed-off-by: Cédric Le Goater --- Seen on the field after an update to 5.1.7. As of today, the FSP stills considered the time as INVALID on the system, which gives us an opportunity to test other possible fixes. Anyone knows how to fix this TOD status ? I lack the specs. hw/fsp/fsp-rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: skiboot.git/hw/fsp/fsp-rtc.c =================================================================== --- skiboot.git.orig/hw/fsp/fsp-rtc.c +++ skiboot.git/hw/fsp/fsp-rtc.c @@ -172,7 +172,7 @@ static void fsp_rtc_process_read(struct case FSP_STATUS_TOD_RESET: log_simple_error(&e_info(OPAL_RC_RTC_TOD), "RTC TOD in invalid state\n"); - rtc_tod_state = RTC_TOD_INVALID; + rtc_tod_state = RTC_TOD_PERMANENT_ERROR; rtc_read_request_state = RTC_READ_NO_REQUEST; break;