From patchwork Thu Nov 28 06:07:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1201889 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NnGG45HZz9sP4 for ; Thu, 28 Nov 2019 17:06:46 +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="DQlgoNfH"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="EVE1rDK2"; 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 47NnGG2V5RzDqyY for ; Thu, 28 Nov 2019 17:06:46 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-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="DQlgoNfH"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="EVE1rDK2"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47NnFs2ddHzDq7W for ; Thu, 28 Nov 2019 17:06:23 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9B3E022781 for ; Thu, 28 Nov 2019 01:06:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 28 Nov 2019 01:06:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=pR+S6ZXW9UEhbhuwhRQXTktx45 hbPVCkJ+ULLfVP2dM=; b=DQlgoNfHHc/1PG2Ko2CaKDDUqRcv0w2CB0qqYhuD0z OUvf7bNjTZKa/SEhVOSL24UBkXBRnUeBNau2gOMyDik1kFkx4rzv5RIHaY8t3NHu vsydq5Ssvv+QCoDtVgB3AYQHIuLnr2epTuAi/AI/xsjeunKzv/YPLhocHFK1mCdP q9W+m3JSuK208CYOEStl/9EzLjajqdkDuFktLEZpFLXtwCDageL0KUUoXNHvfisc Xu0uBsjwk3jLIzmnQAegBlVMIGCG+7cSzAORQau6d62qLXtbAobxUSL8cfsvdWyh n87N+Skhp0FPPe+3Eb2UocFec2HuxZOtYqSvy52WJXYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=pR+S6ZXW9UEhbhuwh RQXTktx45hbPVCkJ+ULLfVP2dM=; b=EVE1rDK2KbBrwUFtHwKjI2S2l1OazgKM8 ggvGZCofnpywG4wvSCl84KRUkTOHq+bER0+PxsKCGEpx8x4Z2kt3mkZlvg+z8hER faxrgS49YlmE/r1BQ35c4aqSuQncSHjeiF5Zw7zJvtN9cj8mt7KfsZfZmmjawg2C D7AsnXImXwaIV0r/wlyJDV1WD/q4M5JUJsOIEEq2n6YeQM/L1oz5sKwSG8k6+Eim vEZECcMzN7ynml0byJ5LqVnWTZ0KpI0BkHfHxdOyzsy39tPXK5JPplmNFOaZHd+r +VsR/7tIqYVbyuWAzV2//SU+UKZ7BLinq36FO0Y8FLvXO556aHrjA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeiiedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegrjhdr ihgurdgruheqnecukfhppedvtddvrdekuddrudekrdeftdenucfrrghrrghmpehmrghilh hfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from mistburn.au.ibm.com (bh02i525f01.au.ibm.com [202.81.18.30]) by mail.messagingengine.com (Postfix) with ESMTPA id 2DD81306009F for ; Thu, 28 Nov 2019 01:06:17 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 28 Nov 2019 16:37:42 +1030 Message-Id: <20191128060742.28955-1-andrew@aj.id.au> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Skiboot] [PATCH] libflash: ipmi-hiomap: Document error handling strategy in write path 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: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Reads explicitly validate window state after the LPC operations have completed, but this is not necessary in the write path. Explicitly document the behaviour to make the implicit behaviour clear to future readers. Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 7327b83a320c..0328101c69d6 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -810,6 +810,15 @@ static int ipmi_hiomap_write(struct blocklevel_device *bl, uint64_t pos, if (rc) return rc; + /* + * Unlike ipmi_hiomap_read() we don't explicitly test if the + * window is still valid after completing the LPC accesses as + * the following hiomap_mark_dirty() will implicitly check for + * us. In the case of a read operation there's no requirement + * that a command that validates window state follows, so the + * read implementation explicitly performs a check. + */ + rc = hiomap_mark_dirty(ctx, pos, size); if (rc) return rc;