From patchwork Thu Sep 3 13:47:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Povlsen X-Patchwork-Id: 11753621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 797EB14E3 for ; Thu, 3 Sep 2020 13:48:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4DE0C2071B for ; Thu, 3 Sep 2020 13:48:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gqgWTmOp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="UltIK/pT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DE0C2071B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZJnkIWZ9ISELidTxm5QKodc2W/amfW6pyBE0xGWsvVI=; b=gqgWTmOpGlnPTGFDH4FN35oDtD X4ZBP1GUg8Duj0h4iIDNM63JhQGLHmY2cJ0L8Tvhymq+hOr3FdQv4FP5JOHz2CWtg1mt9+I0xfFJv 7n4Hbs7F1Z4nvGbGGi70jadfVYQGI1Qw7cuN4AogX6IvNM8RxdxrwPYcP6DtzQd7+92mEpZZZ6Za0 JdEB1KvjKu7x1onPLIoB6ZBba0KIZPcYKoA64fMWOW9sExUh3x86RSZlNpmNJHJ9fhY0XeqvvHpnf mGQqy74B6vsLkpdX4uHx/titlJYFS+u158gDjC/JJWIbj7/O8LLJ1++b0ktJUql65iE1pBpMSvGm7 1UVhDHMQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpaB-0001Fh-Ud; Thu, 03 Sep 2020 13:47:19 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpa9-0001F4-2h for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 13:47:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1599140837; x=1630676837; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yAlQCfI87sxPe78LUN486EmZ8/vrFT3DkpttqgEbkLI=; b=UltIK/pT6UwZv9jpM+SxgGSCBOn0mR76dOtJjhIqBsfQmuhk7Mw0YUVW Z3xY4z/WwaZxgi/HRhMrkfNvQspenTVkOz0PMwt9MJiD0W9mJNtjRYTO7 HNvSt19HJ+uGKUuJtnjD6W+h7PB+yd8LzPE+hPfGqdhIxWfmGkhL0Ygqg Dcn+QLDAYRagzVPvJi2hVf8csaH7P0eG2SZBkFRFJoa3NvUscWuZPQibo 0JVHxfYZJ7WmTpEBdB2irG7NKbQpHFiT7biNSfpZlvL2gQHupHULGGs3n TNmnzSiP72ggP6M11vaLfl0HWNRqkWNoXQi9xycPJfo/OrwfCOnzHzuv2 Q==; IronPort-SDR: fg+MNFt/hACS4QNbg/H6mQOCtEp4dzqSAZUSVAvmahPMw5Qyd0tkbuTD8auWo12N6Helz72fXD cvf0wTwnnYCBBIAaJvsAHb83XO/9jwSjDEYSrrA9jJh4TYKkRaY6DihEyqAHPfVtKq0l8gU4Mn UlIFHeICeyPaoVSqMySs/ZwYZFQssTBXHEsI38n8gQ1Gp1es9jZyUsE7QTgEZREIxJ1vFs814/ ITTqronlWeJLAXiBsulEHiSJJabTct4sTB2qHvuxLJqqjYOI5n6Wh4+QqMGLM56YqPXIDSA8aL 2dk= X-IronPort-AV: E=Sophos;i="5.76,386,1592895600"; d="scan'208";a="87817699" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Sep 2020 06:47:16 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 3 Sep 2020 06:46:32 -0700 Received: from soft-dev15.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 3 Sep 2020 06:47:10 -0700 From: Lars Povlsen To: Guenter Roeck Subject: [PATCH] hwmon: sparx5: Fix initial reading of temperature Date: Thu, 3 Sep 2020 15:47:04 +0200 Message-ID: <20200903134704.8949-1-lars.povlsen@microchip.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_094717_260153_BFFE873F X-CRM114-Status: GOOD ( 12.65 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hwmon@vger.kernel.org, Jean Delvare , linux-kernel@vger.kernel.org, Microchip Linux Driver Support , Lars Povlsen , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If the temperature is read before the internal calibration is completed, the driver returns -EIO. Instead it should return -EAGAIN to encourage repeating the operation. Signed-off-by: Lars Povlsen --- drivers/hwmon/sparx5-temp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.27.0 diff --git a/drivers/hwmon/sparx5-temp.c b/drivers/hwmon/sparx5-temp.c index 1a2b1026b026..98be48e3a22a 100644 --- a/drivers/hwmon/sparx5-temp.c +++ b/drivers/hwmon/sparx5-temp.c @@ -56,7 +56,7 @@ static int s5_read(struct device *dev, enum hwmon_sensor_types type, case hwmon_temp_input: stat = readl_relaxed(hwmon->base + TEMP_STAT); if (!(stat & TEMP_STAT_VALID)) - return -EIO; + return -EAGAIN; value = stat & TEMP_STAT_TEMP; /* * From register documentation: