From patchwork Fri Oct 5 13:12:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 979471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42RVpj6S3qz9sRp for ; Fri, 5 Oct 2018 23:24:29 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lFeQ7hRa"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="FyV8VNZT"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42RVpj2kmQzF3Rr for ; Fri, 5 Oct 2018 23:24:29 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lFeQ7hRa"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="FyV8VNZT"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.27; helo=out3-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lFeQ7hRa"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="FyV8VNZT"; dkim-atps=neutral X-Greylist: delayed 476 seconds by postgrey-1.36 at bilbo; Fri, 05 Oct 2018 23:21:45 AEST Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42RVlY5jd3zF3RT for ; Fri, 5 Oct 2018 23:21:45 +1000 (AEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1F0BA211EC; Fri, 5 Oct 2018 09:13:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 05 Oct 2018 09:13:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id; s=fm3; bh=UTHvAlNHcGHZDAAaEIWcPH +8Bbi+DtUPe6AsA1D83QU=; b=lFeQ7hRaKu/JjS+/bMWVEcqZLPePSqeaOLL7HZ tkS291uuQZAlhgChuVIUZJgkFWMJhbKtu5hQrrSBkVW8P9RN1LPwQOO0Cu4c+Bhk FdMvEVCm8BJaskXmLOJG2LWkIF+dlxMd01osuNp+a/lLfMmrfYs9M7iuusItNt92 J3eNKH7C7m8lbe9W2SEDGmNdSKq6BBKhn94hn1KpHewwbxoWDmOb1GOzwQhyzeQR hTVAG7qgcgIleWZtyxZyq7ehjWUSUJysZvEjD3KLKVbW4GDZ5i6/o7b4Q1DBky3F z4nfQZR9WCUhD2ysh06aZiCoLfwj7nnk0LoiUkOiDuPvqyUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=UTHvAlNHcGHZDAAaEIWcPH+8Bbi+DtUPe6AsA1D83QU=; b=FyV8VNZT RIyfY+D5iCq3Jgzzr6LDIwhR1zO9GlZI2ownMReZ4TD3k2PQTCAzfZaDvZOzaJ9X CVnWnBJN3C64D5i+YYTb9YIta1q9EsAeM/n1SQrC0eySDmam1qxWdVKaBdvJUT+3 Mk8MFBijntDZkCOe4BTvKyfkjriJaAJbf2wHoOkSADcYzAl1Ox5Qfprir+OpoCWX U3xbhF2HSnQmv3CSzzCNEH0Ahaya4IRexQs57IWLxPmkQSSmf2YTM9jHjomVjlbs PxdkjgC502wHMtU8SHSJyVEGMa5IwjUAW8MlTe+HMiqRpfK3wHk1IQPYq78EZZX9 2YLZZGAzA8cdKA== X-ME-Sender: X-ME-Proxy: Received: from dave.ibm.com (unknown [118.211.19.207]) by mail.messagingengine.com (Postfix) with ESMTPA id CAE41E486E; Fri, 5 Oct 2018 09:13:43 -0400 (EDT) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 5 Oct 2018 22:42:54 +0930 Message-Id: <20181005131254.24662-1-andrew@aj.id.au> X-Mailer: git-send-email 2.17.1 Subject: [Skiboot] [PATCH] astbmc: Only mbox_init() if we mbox_flash_init() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , stewart@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Avoid setting up the hardware if we're not going to use it. Setting it up without using it is actively harmful as it prevents us succesfully entering Petitboot (we exit skiboot with locks held and checkstop the machine). Signed-off-by: Andrew Jeffery --- libflash/mbox-flash.c | 6 ++++++ platforms/astbmc/common.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libflash/mbox-flash.c b/libflash/mbox-flash.c index 3239be964b57..11ec90523d58 100644 --- a/libflash/mbox-flash.c +++ b/libflash/mbox-flash.c @@ -1134,6 +1134,12 @@ int mbox_flash_init(struct blocklevel_device **bl) if (!bl) return FLASH_ERR_PARM_ERROR; + /* XXX: We only support one blocklevel flash device over mbox. If we + * ever support more than one, move this out. The chances of that are + * slim though due to circumstances. + */ + mbox_init(); + *bl = NULL; mbox_flash = zalloc(sizeof(struct mbox_flash_data)); diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c index a616f24fd863..10aed3f72901 100644 --- a/platforms/astbmc/common.c +++ b/platforms/astbmc/common.c @@ -419,8 +419,6 @@ void astbmc_early_init(void) /* Setup UART and use it as console */ uart_init(); - mbox_init(); - prd_init(); }