From patchwork Tue Oct 9 07:32:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 981072 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Tprl431Nz9s9G for ; Tue, 9 Oct 2018 18:34:15 +1100 (AEDT) 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="VlKYHyJ1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ydnIAF1Z"; 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 42Tprl2PfKzF3DS for ; Tue, 9 Oct 2018 18:34:15 +1100 (AEDT) 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="VlKYHyJ1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ydnIAF1Z"; 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="VlKYHyJ1"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ydnIAF1Z"; dkim-atps=neutral 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 42TpqH48TyzF3Bm for ; Tue, 9 Oct 2018 18:32:59 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2EF1421D0A; Tue, 9 Oct 2018 03:32:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 09 Oct 2018 03:32:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references; s=fm3; bh=rJLe1h1ZRl5T6FdlwUuYgI5RRPzvE98/IkQ8KQezc1o=; b=VlKYHyJ1Lyyc Njsh4jFkvgtX4QBR8ZOvBW883lbC2sSKTAFB5JjPkcPTh9ABZxVXTAe+BJQbgmyX 5TQXEaoYfLVrUywkFOVTVBBc5Q46Ect0coHeOC/S8/NXAOePBC5DpRg1S+P49Yp8 HF/bxSsIYKr6+favxof8HlHQIB4YK+mEJ32M7xBc2ff4pNBXi2uHADfGtv4wN1B9 8R3zRIByzeBmTQ8vBtt3BMW9X5lI65JWpdMYIkZiBxjpq/KEeNomJynlqu8gKTVl MSQI+uIGCAEiyVJ2KPok+3qI2S9hEO1dT4ZU2J9M2sDSSiXwuqxpoGPdMNREIlWE +Bf0vC2oDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=rJLe1h1ZRl5T6FdlwUuYgI5RRPzvE 98/IkQ8KQezc1o=; b=ydnIAF1ZFSG/JCmi/gqW36QeHIvIvdqpu0AaHKVT9S7m0 DWAwOJfQufirFp+cSGPa/fI6xhw4CXumtFuS+ylV+Ic9S0GB271qGZRe0BpXb9ED 5Rfqp23ZMNKp20jWdsKebp9iSD1npTIbvOYCMhxNEHyUWf4mFw8scotw8D57nj53 RJiDEyFzcaq2pvkq4ZbR2eqeaVqAUMOSurr3aF1eMCVL/TbFD8Gh5k+L1yWV14k3 GoEPPHWsQ2pIR0COmVhYZ+YOy33HeiPYmz37h0uNbOlbCEVXx+SQxEyh+Qo8bX6g +ZE2eL34OuHDuDKBJ1NPYepiPj8B9PAMr/AGPMLzg== X-ME-Sender: X-ME-Proxy: Received: from dave.ibm.com (50-203-181-99-static.hfc.comcastbusiness.net [50.203.181.99]) by mail.messagingengine.com (Postfix) with ESMTPA id 19DFDE4307; Tue, 9 Oct 2018 03:32:56 -0400 (EDT) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Tue, 9 Oct 2018 00:32:30 -0700 Message-Id: <20181009073237.16251-5-andrew@aj.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181009073237.16251-1-andrew@aj.id.au> References: <20181009073237.16251-1-andrew@aj.id.au> Subject: [Skiboot] [PATCH v3 04/11] core/flash: Unlock around blocklevel calls in NVRAM accessors 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: dkodihal@in.ibm.com, Andrew Jeffery , anoo@linux.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This ensures progress when we don't have interrupts available for IPMI. Signed-off-by: Andrew Jeffery --- core/flash.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/flash.c b/core/flash.c index 15eb7443faac..83c1112636e6 100644 --- a/core/flash.c +++ b/core/flash.c @@ -118,8 +118,13 @@ static int flash_nvram_start_read(void *dst, uint32_t src, uint32_t len) goto out; } + nvram_flash->busy = true; + unlock(&flash_lock); + rc = blocklevel_read(nvram_flash->bl, nvram_offset + src, dst, len); + lock(&flash_lock); + nvram_flash->busy = false; out: unlock(&flash_lock); if (!rc) @@ -147,8 +152,14 @@ static int flash_nvram_write(uint32_t dst, void *src, uint32_t len) rc = OPAL_PARAMETER; goto out; } + + nvram_flash->busy = true; + unlock(&flash_lock); + rc = blocklevel_write(nvram_flash->bl, nvram_offset + dst, src, len); + lock(&flash_lock); + nvram_flash->busy = false; out: unlock(&flash_lock); return rc;