Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1691577pxb; Fri, 24 Sep 2021 09:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqDePvZEJFh8YOrTO4XpIX6trBXW+G1rdhBCqTmyyz/HwYvRCBJbVZBseSbfN6jK60l7Pk X-Received: by 2002:a17:906:e216:: with SMTP id gf22mr11990946ejb.357.1632502073849; Fri, 24 Sep 2021 09:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632502073; cv=none; d=google.com; s=arc-20160816; b=U+ZnINoivYXsGoIEK970/MeIGCfBkqjW5QkfR57G1PA1ioPfunJtJufjLwUqaH+nGS udkOZcDvwvebkYzmhFMMqH55TggQMVKHLL+UOfBnhPLH42e36G254DqE24hbe3ETQ0ti KLWqp9Y1dtaYXdpRzaOW0Ls/msrN3/kSA9JnbTQK91olVtAa2JZLy5ZHPJmGR1sA2TnA r/tohObwAPFVs4e9U1R7cmhz9Y0ENo9f+0StXHlT1KMJy5t/zsDXAQLxe7s0ikxoypFH X6Q+8QT8cVZ/xeHEP2fk+LNQi3Yj1krRQLyV05Vl5CQNlqHNmEc7PtaeFHWdReMdNSIn JBWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=gaw8hq1tP5dFMMFBJGf09r+9kBtQt8HO+1SL++A5V4w=; b=kNMRXewah/iwY+njfjzcOqg37gSbnrW8li0lxORtbIiKD+W39VN1xNIBXpqEjwuXju Gt7vKJ9KqDdr/6CetPNPMG8Y9cP28rLA5/mzxk1Awi9quIYr9S18cWi0rNiSE7HLONj6 PpRh3yMJeBIU/DvyxHB4zl0EDmF4Ue1wWsXitBq/X78u2T2nJrungPpUoRA7gGP/zVVt jsoljp9iTuvpEYOR28wr48d7TBPYGqRB9SKNFhQK6yRX5PgTLKFzRpBWqT1ru+L5rxCp mhtqTDTlKgD5Va6l+2DcmSjuFLGqw1FSoZJKxTTgeaxxBxZ2GzXptltd3HxAQOYlHQp0 oDzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XLAuCVry; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si9023134ejm.464.2021.09.24.09.47.29; Fri, 24 Sep 2021 09:47:53 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XLAuCVry; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245569AbhIXMBe (ORCPT + 99 others); Fri, 24 Sep 2021 08:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245069AbhIXMBd (ORCPT ); Fri, 24 Sep 2021 08:01:33 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B844C061574; Fri, 24 Sep 2021 05:00:00 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id j11-20020a9d190b000000b00546fac94456so12820874ota.6; Fri, 24 Sep 2021 05:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gaw8hq1tP5dFMMFBJGf09r+9kBtQt8HO+1SL++A5V4w=; b=XLAuCVry5neZjaz6bhGYS8n3Dcffaosa/A5/Kt2OIj7WPDqyzsoBf3azQZQQZ9MpPG eDVul+SKHKWmwZqd/Sy0gmfkypXqXB5ngtmdgHtH4MwUTBeudVy75fTFTbWu3UmGvkmm TykqUajoYG1iJ7QyiX/vW6ynaMxOlho8l12SCzrjcP5TGqG9xvtGcUGfAGg2/7ijdUWz NENu7OH/wsfFH+ycPOwHmD9ksnBog9qH9vMLHXYMn2AItsymzKvVjDi3RrzV28DkvH5N U7K0w5ktkw9i55K41PShTKYhoJviortNeQ2ZlNqEOcIsa1/GmM/tAUlsD79YbWZN6l08 AzmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=gaw8hq1tP5dFMMFBJGf09r+9kBtQt8HO+1SL++A5V4w=; b=SL/zLSK4Bx73Fc6l4gsoZDj4HQF1NN04Oxv0Z4jIXQRPCc+RbE5hZqw6aavhfjhLgh YZbxDYSok10y9oJZi7FvAH+YqDCz70JIkG63Tnu6yabIFaCL8/EDfvvrMsWBlglGgTOw Ou+i2Bs4Ym/3viHXVnJDd7+j0ogwP9qhGAUVcEv+w6dL99YnG+zjiPIICFXhesr3kQ9+ Vqkbs9kbZWYLNbAGsVOt/mvcRlloqlbE5qScDLna8LP3mPF68e7N8SFQwiamZGNznl1U Oeq3YCgrrQJ3CsuxnTNQYvzzEJiuCzGqgVTGhJ+qsxt3llTHEGiDxqqLVM8iFyz6g38o f4+A== X-Gm-Message-State: AOAM532mWjWxkIdLuTEQbEeV6lBQLg41LffGWIfZb6SjH+I2cNYBEUjF WxZz4vsrVcuXPa4fpunGrtozeg+wD4Q= X-Received: by 2002:a9d:654b:: with SMTP id q11mr3570243otl.184.1632484799865; Fri, 24 Sep 2021 04:59:59 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id v16sm2046200oiv.23.2021.09.24.04.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 04:59:59 -0700 (PDT) Sender: Guenter Roeck Date: Fri, 24 Sep 2021 04:59:58 -0700 From: Guenter Roeck To: Paul Fertser Cc: linux-hwmon@vger.kernel.org, Jean Delvare , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] hwmon: tmp421: report /PVLD condition as fault Message-ID: <20210924115958.GA2695448@roeck-us.net> References: <20210924022020.GA3032273@roeck-us.net> <20210924093011.26083-1-fercerpav@gmail.com> <20210924093011.26083-2-fercerpav@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210924093011.26083-2-fercerpav@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 24, 2021 at 12:30:10PM +0300, Paul Fertser wrote: > For both local and remote sensors all the supported ICs can report an > "undervoltage lockout" condition which means the conversion wasn't > properly performed due to insufficient power supply voltage and so the > measurement results can't be trusted. > > Fixes: 9410700b881f ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips") > Signed-off-by: Paul Fertser Applied. Thanks, Guenter > --- > > Changes from v2: > - Add Fixes: tag > > Changes from v1: > - Trivial rebase > > drivers/hwmon/tmp421.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c > index e6b2b31d17c8..3a789f21188c 100644 > --- a/drivers/hwmon/tmp421.c > +++ b/drivers/hwmon/tmp421.c > @@ -182,10 +182,10 @@ static int tmp421_read(struct device *dev, enum hwmon_sensor_types type, > return 0; > case hwmon_temp_fault: > /* > - * The OPEN bit signals a fault. This is bit 0 of the temperature > - * register (low byte). > + * Any of OPEN or /PVLD bits indicate a hardware mulfunction > + * and the conversion result may be incorrect > */ > - *val = tmp421->temp[channel] & 0x01; > + *val = !!(tmp421->temp[channel] & 0x03); > return 0; > default: > return -EOPNOTSUPP; > @@ -198,9 +198,6 @@ static umode_t tmp421_is_visible(const void *data, enum hwmon_sensor_types type, > { > switch (attr) { > case hwmon_temp_fault: > - if (channel == 0) > - return 0; > - return 0444; > case hwmon_temp_input: > return 0444; > default: