Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1785924ybl; Sat, 7 Dec 2019 02:37:18 -0800 (PST) X-Google-Smtp-Source: APXvYqx5yxGkzhNjJlrT8uHxhbxwEhljVV/EvLT1Blh/AGuTJi6/EY38mfdtCu8guN75HqFjtI2k X-Received: by 2002:aca:5657:: with SMTP id k84mr16535958oib.113.1575715037907; Sat, 07 Dec 2019 02:37:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575715037; cv=none; d=google.com; s=arc-20160816; b=RU/jdJNP30A0p23CevamZZ7it9be7ZEtqXVNVE6a9uAQzWk0wX83NSDZr8vUBV04lt zAK0U0HlF6aERqpaAzEtfOodFl1FOZLzu1JE6Vh4uSiAoV4pYOj2I+wBLGzdfm356XKt E4qaj+CMG3dA4Lz/SAehYcA8YrNJnkdxixjTNEvKGnRsOpnGOcEEqWu2fi75fjdP+vec w4IVm5WtQwJrESx1PtKT6q7IXkRNfltzbpu7wVmtP4gb8ZmJ9N1bvAMLeVPYWy8HgV1G WrIf1IwPCv2C0wTya86aeoX4VYPXXEoGhBJSq5+um6y+szN2ZiyHkP11l/Y/19a3JNPa 03ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kv+uiCSk7ztcAaXUEY/mWYEHBdM5XeIixtatRYfSz+Q=; b=HiloGmwquB6PJEZlf+BJcFj3UaQOC+4jNS+sUmtYSXh7qzEMfSPrwUn7xBK8zIXyYm 63QlWGn+vLQj7ISe84cEDJPDqVn/U5N55825TSGvYos26LoQklmI1+6bVeBKgQjr06qq UuWVxi/kPJ0BrJ2M6Zsn/IutVZ8NjsbZJj+Vt2rJ0uOGHJQsZ5EcKBL1I/64jjq+NTJL IMh+ZPxl8PC53VRpBEbbxg/uvxCiqpIE4w7hJhURM5iUVTMBGTwQgHYQ4yAMgkAlAKBX pBMcl/8//Ci+1DY5J+IhqF4TrI6mVV9eGpIrMajZ/TqMJYg439B4573A1Psm3MqU6e8r 5XLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IDF+m0Sc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z203si2088704oia.124.2019.12.07.02.37.06; Sat, 07 Dec 2019 02:37:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=IDF+m0Sc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726416AbfLGKdx (ORCPT + 99 others); Sat, 7 Dec 2019 05:33:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:33050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbfLGKdx (ORCPT ); Sat, 7 Dec 2019 05:33:53 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01E3424673; Sat, 7 Dec 2019 10:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575714832; bh=SuakieLmzH/APRkH24GmeiDVGJkhpgM0p3HYv5+YVNc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IDF+m0ScfxXqIXX35QX4SQRSrqb7oX3ILXORqiFbrHXbogC6e4NSV+ypIJiSM8iOd bIFoKctSRG1XWFJ0PrA/hPfvxbipFd3/BFCY2k392XDZqo8/Vz0PRkeyiuog7DZ+xJ BnAdWSMHDzl7WPZyrYA14DuHXcsitfLdHbHVfC08= Date: Sat, 7 Dec 2019 10:33:48 +0000 From: Jonathan Cameron To: Wolfram Sang Cc: Geert Uytterhoeven , 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: <20191207103348.58df9cd5@archlinux> In-Reply-To: <20191202092328.GE1266@kunai> References: <20191202085546.21655-1-geert+renesas@glider.be> <20191202092328.GE1266@kunai> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Dec 2019 10:23:29 +0100 Wolfram Sang wrote: > 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 =20 >=20 > Reviewed-by: Wolfram Sang >=20 > One minor nit, though: >=20 > > /* > > * need a delay here to make register configuration > > - * stabilize. 1 msec at least, from empirical testing. > > + * stabilize. =20 >=20 > This could be a one line comment now? >=20 Applied to the fixes-togreg branch of iio.git and tidied up. Thanks, Jonathan