Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1315952ybl; Mon, 2 Dec 2019 01:25:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwvpCyZRqO7snh8XkR49UubG0FxEGOattRgvipcOLa0iO2fiIqlrkaTYq+WXOpWVI3KwX+T X-Received: by 2002:a05:6402:b8b:: with SMTP id cf11mr2760806edb.2.1575278712955; Mon, 02 Dec 2019 01:25:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575278712; cv=none; d=google.com; s=arc-20160816; b=IpHn289Ale8D8nfRvv38ULDULOpUiFQPB+ICgr53vteNs/crWJVfbXiZwV5AsvHrUU VGLORw7j2vnyBq+XMOiF2Niyz2iZonzhoO3PjPrQIHteBkbAhMbf+QqLrnn4YPg1drYa Ufp9e8xOzuvg5uLWqV2Rr+VnZ4Y1MHdfTLeBZI/Jmx+4s89xUcX+P1BJv1VCbe5DDKUd AlebKz+4nwhjPa+BQq1jNWdcizdhELmTEWawy+KWeDUhb4CA0pWHZWERKQdRoUYgnmJa 7XWqvGhMvPUWyhZGbDAZS6trKL/JIzTcg5Dgs4UfcvzSXs3iOjAk3yZNp/vWY/D7bVWv wlOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FV8NINLTFKJaFcVx+2V7qXTlBfdEIjV7bc/Kxt1C9gI=; b=oMUPTti1jaAjMewxEk0itkQZ8+U1+1s2AZxMuKtoxlH6BBgAmL4Fz6oTUurv7et00X uFqrQ69bGZcfp9G+BbMfjhqrmbdKQ3lDJGjccha3zYj6mR7dnuy6NKAc7wk4zoXfI6Kh RZtWjvjmYiQ8HWwkVA3/gyQhHW77TgkH+htg43bZFTnQI5dtor66fJnbeN29Ew3u8NA5 Z4sbtaDZruJzl28sCc8ca6XVdENgGMTf6nTV+aqXfE5HIQVQraA2g6q5Hi8PoROQwcVP zwhUbvoU026zrABf0UO3oJynD8CihKyK+SQQqM1tZlrKo5CtbfM5ZGNxUPvP22yHTYpJ uhBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si26774390edt.411.2019.12.02.01.24.49; Mon, 02 Dec 2019 01:25:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbfLBJXc (ORCPT + 99 others); Mon, 2 Dec 2019 04:23:32 -0500 Received: from sauhun.de ([88.99.104.3]:42296 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbfLBJXc (ORCPT ); Mon, 2 Dec 2019 04:23:32 -0500 Received: from localhost (p54B3363C.dip0.t-ipconnect.de [84.179.54.60]) by pokefinder.org (Postfix) with ESMTPSA id 737A92C04A3; Mon, 2 Dec 2019 10:23:29 +0100 (CET) Date: Mon, 2 Dec 2019 10:23:29 +0100 From: Wolfram Sang To: Geert Uytterhoeven Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jacopo Mondi , Wolfram Sang , linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iio: adc: max9611: Fix too short conversion time delay Message-ID: <20191202092328.GE1266@kunai> References: <20191202085546.21655-1-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="a1QUDc0q7S3U7/Jg" Content-Disposition: inline In-Reply-To: <20191202085546.21655-1-geert+renesas@glider.be> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --a1QUDc0q7S3U7/Jg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 02, 2019 at 09:55:46AM +0100, Geert Uytterhoeven wrote: > As of commit b9ddd5091160793e ("iio: adc: max9611: Fix temperature > reading in probe"), max9611 initialization sometimes fails on the > Salvator-X(S) development board with: >=20 > max9611 4-007f: Invalid value received from ADC 0x8000: aborting > max9611: probe of 4-007f failed with error -5 >=20 > The max9611 driver tests communications with the chip by reading the die > temperature during the probe function, which returns an invalid value. >=20 > According to the datasheet, the typical ADC conversion time is 2 ms, but > no minimum or maximum values are provided. Maxim Technical Support > confirmed this was tested with temperature Ta=3D25 degreeC, and promised > to inform me if a maximum/minimum value is available (they didn't get > back to me, so I assume it is not). >=20 > However, the driver assumes a 1 ms conversion time. Usually the > usleep_range() call returns after more than 1.8 ms, hence it succeeds. > When it returns earlier, the data register may be read too early, and > the previous measurement value will be returned. After boot, this is > the temperature POR (power-on reset) value, causing the failure above. >=20 > Fix this by increasing the delay from 1000-2000 =C2=B5s to 3000-3300 =C2= =B5s. >=20 > Note that this issue has always been present, but it was exposed by the > aformentioned commit. >=20 > Fixes: 69780a3bbc0b1e7e ("iio: adc: Add Maxim max9611 ADC driver") > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Jacopo Mondi Reviewed-by: Wolfram Sang One minor nit, though: > /* > * need a delay here to make register configuration > - * stabilize. 1 msec at least, from empirical testing. > + * stabilize. This could be a one line comment now? --a1QUDc0q7S3U7/Jg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl3k2AwACgkQFA3kzBSg KbYq0Q/+Il7PVUqvCgQtgmQ4xQh7vOIyBSHMrRk/xrEKta+veYjdWAjzKxhOuSKk Vqo3/mRePBeyeYvlOb4eLa9adhbyJdEfcKHsG4DMYUe8ZJbgefvKsTNUSw/JqD+0 xVc3bwHZfbYA6EbsYe8okHvzfayJ5froXtVSwyuHrj4ihgXAuQQq3sj6hDTeNYYf ho3Z9FhmDd8ggGaMo21GYBRVXmxC4y1WnbXV7ZcrVEdQ5nrBZVwsxLVPYoc+WWDE yHVEnWf76DiesnoEedpE+ePx1kEvVFrS16lCpehRxYnvr4KW+8s/TLiwuJifV0/X P155awtC15gZO8L/ylWtpwSglpkTNCnGpX62ZGdWWbM//yLCo8QTRsaOdcsHzwqz aglQlT/6rfmstBOAcYAZgkLK+AoaCUri/5FOrl+ycCkdhJYgrXdF9VfaCqXNxn+Q FV3RCAl43qhabVPb277IVDHR8nrHp1SboTEjJcAZ7CIQihb5ghEdp0pS/Q61Saj5 KmOHvhPPf5IFdYZt9W7cpxXfL7Q0xvdrGpTVzu2OWYxbM98ObLiVdwcKzJ4j5Ptx nL154/0j9Lz/sd9vlBHQlbr9j9JzZarEqtccMl9Kj7YeFn354G7ifaKKrPmDX3uR zlW2UFqD8eApf0dE+95Q4gIld76pyGwJcTpqN3oYx+n/6Ku3Qhs= =KodC -----END PGP SIGNATURE----- --a1QUDc0q7S3U7/Jg--