Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp913934ybg; Fri, 18 Oct 2019 09:11:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3b0xJ7v0hmokWyi/XutlVU2ghNANlTiQZcGdn5QSngQ4+QpJxIJR0A958XEf6FXYMeYCe X-Received: by 2002:a17:906:3e41:: with SMTP id t1mr9634913eji.103.1571415111648; Fri, 18 Oct 2019 09:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571415111; cv=none; d=google.com; s=arc-20160816; b=ucuxHXpY7egULY+eMVdEVTMCetXmsxBQnzO5jk1mNCJLDp/3fS1e6lWweJUn9Ma3Qr f47MvBzSg2ISzPipO8HLWk7tV1nA0U6m8UmQwa9s43VW0Fs4oi9NqMmQ+35FRMcnyHvn hGBHEMnBnQ7zYMbOhTu1EF8d2gAIVgR88GiXZpaWmnAg5Amfj6BDRebKjUvnej4WxNtN ZRBl03mTd+lVq79Q4JfEP2IvBQl0HlTSvont34u1L0HKf4Xw166vgODfiUVOvaF7+EJe x+tORfTAy3vZeOxlM2Lw/69+R0U5mpwvOnJwxAD8v6D7rtK6RxP7vdY0MqLsGToZOxzi zELQ== 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:dkim-signature; bh=TL3Bg7r1MXFPw1qs6Uz1yY89VM2LxUEc4gTHtQnByTU=; b=c1z6zHR/+B/nRG/1I/4RQudwnh79TgIZGQ4y7cyMMCFlbfRO4s+qo3Ggo00E9diVCN EbsR8/vgaLeTUqvI1BjlRE9Cd38bmYBw4ws2dSED9jlpv3ke4T2WRlV9yyTk3EPWJTFa n/f7OHLlQQxYhY6xE+px5AdXa6iivD3dSJNd+zL2bMolUozZ3sMrP5I9fWpFqHqMOvFn PVKg7Y34CK5/C9jv+TW2WenTKtqyH6haZPd4cGTOBKV8G9UiEAGzo26fbLwl1D7kJ5SI e5WL4PR4V1ckiijk9rBBJrN7jQzHDcJqnXCZzapV/YjY5h9xd2MIvZxoNZuqTJuADoxt nMjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Zy0xVF3g; 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 k6si4441746edb.235.2019.10.18.09.11.28; Fri, 18 Oct 2019 09:11:51 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=Zy0xVF3g; 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 S2436652AbfJQNlI (ORCPT + 99 others); Thu, 17 Oct 2019 09:41:08 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:44719 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436617AbfJQNlH (ORCPT ); Thu, 17 Oct 2019 09:41:07 -0400 Received: by mail-pl1-f195.google.com with SMTP id q15so1143661pll.11; Thu, 17 Oct 2019 06:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TL3Bg7r1MXFPw1qs6Uz1yY89VM2LxUEc4gTHtQnByTU=; b=Zy0xVF3gW175CXK55XKrdH/JLGDt7X4DOFuNpbYIGPoM14uKARAnqw7WcnM8zChdKb pbzT13T67DsiJMFD8fgtHQ+/frSFrC+UkMZW4iPyvvaq5sUKJ7UmEHRwJH26u54fHRCK gaRy6kNkw4M0jkSIbEYXiSOOx6wMx3Lw+lso7kMfXPgKd1iTKBTK8F2s8g9Dsltqpezj n/+7TK0janpFmElAtHDN8Y1DLiLud+0DWAlLN8KsMGNTbrz/gUueF5kRvLknPkadhuFH +0Su+pFYBqDdpfqgLPtkeH2LvTO74p3Gkpk4w4okqdvDKWSZC4dbUEZuHR22tWaUvDLW Baqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=TL3Bg7r1MXFPw1qs6Uz1yY89VM2LxUEc4gTHtQnByTU=; b=fvpDt/DM+Cc/6hd6uycFP5jPqo/JMDoJgOAJe5FEt6x/plgYLG+0f5iifbrTT6KTZP h2b31N+AU7eZU6X1Vlf+XDl5MhmX7BPzRDfV+0Sg22hdBfaUoW6PSDCbHjLzP34ByiYC JhWszThwxnzJWIRKrQ4VwcuxS140UG3uTSTN6EduoHvvnWKFygz9IJXKW5k3MkAjkgn3 /HVeq4OfxZTJKgjA/D2pu3oQ8zFIdpetEiTqK4VklhQgEwUbbfyVPW8M6gRTCVvewvCL bYf/ygt7dEqoYxK1R0vhPkt26Oinq6FmRxmIx0Wmv7ToQfiE8fDh3SQ+k4zrQQ/tJIT1 pdqA== X-Gm-Message-State: APjAAAUlbV0kv5VTHSkwyvXDG0JyIt/72DgntMTFO8yLFrTU7BDDtgqc Ua6wEcKnSQ6gjutQ1vTpTug= X-Received: by 2002:a17:902:ab82:: with SMTP id f2mr4192546plr.39.1571319667155; Thu, 17 Oct 2019 06:41:07 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p189sm2717695pfp.163.2019.10.17.06.41.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2019 06:41:06 -0700 (PDT) Date: Thu, 17 Oct 2019 06:41:05 -0700 From: Guenter Roeck To: Kyle Roeschley Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: (tmp421) Allow reading at 2Hz instead of 0.5Hz Message-ID: <20191017134105.GA6766@roeck-us.net> References: <20191014140310.7438-1-kyle.roeschley@ni.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191014140310.7438-1-kyle.roeschley@ni.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 14, 2019 at 09:03:10AM -0500, Kyle Roeschley wrote: > Our driver configures the device to read at 2Hz, but then only allows the > user to read cached temp values at up to 0.5Hz. Let's allow users to read > as quickly as we do. > > Signed-off-by: Kyle Roeschley Applied. Thanks, Guenter > --- > drivers/hwmon/tmp421.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c > index a94e35cff3e5..83a4fab151d2 100644 > --- a/drivers/hwmon/tmp421.c > +++ b/drivers/hwmon/tmp421.c > @@ -127,7 +127,8 @@ static struct tmp421_data *tmp421_update_device(struct device *dev) > > mutex_lock(&data->update_lock); > > - if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) { > + if (time_after(jiffies, data->last_updated + (HZ / 2)) || > + !data->valid) { > data->config = i2c_smbus_read_byte_data(client, > TMP421_CONFIG_REG_1); >