Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp773062pxj; Fri, 11 Jun 2021 11:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7+Jc3WvwhreLfG65d0lmxuAy2XiShGCC3exG7+K09DSPYqQVsVstGWYhimcZYyEQcM5P8 X-Received: by 2002:a17:906:1986:: with SMTP id g6mr4727957ejd.265.1623434715348; Fri, 11 Jun 2021 11:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623434715; cv=none; d=google.com; s=arc-20160816; b=CG5gz2m8giYoILZIlkDggaOPXK0pkWrSeR3vlUUkGT/baosZOksg/089Q1z7s2L5QF BuEgfc7U2rM8INMDfR9M8p3BkVVtRRhACIDZgeLUNA7M6qsHmKzOh3BvYEgjgxX3DQQ9 8CQz/WYX7bi03JBvXVqZrWG8DOKuM0cNL6tHUdCL3XdJ3BOSXZUVjJaFjyA6YkyqbAfv RWSoXqTYcCssDXMIsiqw2EqP4E5AXT4R0IS6BLADpxXJVvlokNGvDlsJL18/6KXIbrLN 2NMO4K1wN6tgw+RUuvR/BYHrZMGQrjoBZJsObgHHbee1YYhNoBjPz+W5aVlDkhaIyWqN dEGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=1qIOcGLff/MvBnjHoOC70cLWuS4MNtVvUh9mpj0pVX0=; b=pjH8b5g+veCijtHILxYtQ6ZKbg79VUFk1LoG78aBSTNxlq0R1hrHKEqsnpKRRLBImq fE/gZ7/PpmlFPVvYsYsOsLCpAKZ2Drs1vONHDbU/YgbIo+zVDi2ZbfeSvnnsDlK0KZCX RGwnJFJzmlJR6a+vvZ1q360RSfGwgFuwDwRL4bkDmlw+aOjffmhs3kYZlvUeqjV8sAK2 yQ22BS0k0qVu8A64A8kfWhK/ev3lHDfadFqkl6sYQHeLr93YmtgMwAtd+p9YRbvbY4YF 2LUFO8qyu+kvPr0lxPelYiOWt+Z8ngoEP2XrYwUSHEs4Ic+haOkW4HEYuDA5QcDu98tT Mlfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id zh6si5397472ejb.453.2021.06.11.11.04.51; Fri, 11 Jun 2021 11:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230455AbhFKSFQ (ORCPT + 99 others); Fri, 11 Jun 2021 14:05:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:42398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230350AbhFKSFH (ORCPT ); Fri, 11 Jun 2021 14:05:07 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 7847261411; Fri, 11 Jun 2021 18:03:08 +0000 (UTC) Date: Fri, 11 Jun 2021 19:05:03 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Chris Lesiak , linux-iio , Linux Kernel Mailing List Subject: Re: [PATCH v2] iio: humidity: hdc100x: Add margin to the conversion time Message-ID: <20210611190503.0cdda724@jic23-huawei> In-Reply-To: References: <20210610104136.00002e4e@Huawei.com> <20210610134432.1752842-1-chris.lesiak@licor.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Jun 2021 16:55:20 +0300 Andy Shevchenko wrote: > On Thu, Jun 10, 2021 at 4:47 PM Chris Lesiak wrote: > > > > The datasheets have the following note for the conversion time > > specification: "This parameter is specified by design and/or > > characterization and it is not tested in production." > > > > Parts have been seen that require more time to do 14-bit conversions for > > the relative humidity channel. The result is ENXIO due to the address > > phase of a transfer not getting an ACK. > > > > Delay an additional 1 ms per conversion to allow for additional margin. > > This is crucial and not so visible in the code, see below. > > > Fixes: 4839367d99e3 ("iio: humidity: add HDC100x support") > > Signed-off-by: Chris Lesiak Small process note. For IIO at least, please don't send new versions of patches as replies to earlier series. Whilst it doesn't matter that much here, for large series it can get very confusing and runs the risk of be picking up the wrong patch versions. A new thread is much easier to deal with. Jonathan > > --- > > drivers/iio/humidity/hdc100x.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c > > index 2a957f19048e..91790aa8beeb 100644 > > --- a/drivers/iio/humidity/hdc100x.c > > +++ b/drivers/iio/humidity/hdc100x.c > > @@ -166,7 +166,7 @@ static int hdc100x_get_measurement(struct hdc100x_data *data, > > struct iio_chan_spec const *chan) > > { > > struct i2c_client *client = data->client; > > - int delay = data->adc_int_us[chan->address]; > > + int delay = data->adc_int_us[chan->address] + 1000; > > + 1 * USEC_PER_MSEC; > > > int ret; > > __be16 val; > > > > @@ -316,7 +316,7 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) > > struct iio_dev *indio_dev = pf->indio_dev; > > struct hdc100x_data *data = iio_priv(indio_dev); > > struct i2c_client *client = data->client; > > - int delay = data->adc_int_us[0] + data->adc_int_us[1]; > > + int delay = data->adc_int_us[0] + data->adc_int_us[1] + 2000; > > + 2 * USEC_PER_MSEC > > > int ret; > > > > /* dual read starts at temp register */ > > Above might require to add #include . >