From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE4B9C433DB for ; Mon, 8 Mar 2021 00:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A005764FCF for ; Mon, 8 Mar 2021 00:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233383AbhCHAbU (ORCPT ); Sun, 7 Mar 2021 19:31:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233358AbhCHAbG (ORCPT ); Sun, 7 Mar 2021 19:31:06 -0500 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868CAC06174A; Sun, 7 Mar 2021 16:31:06 -0800 (PST) Received: by mail-ot1-x32e.google.com with SMTP id a17so7623840oto.5; Sun, 07 Mar 2021 16:31:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3rM9/pP2BdU9S9K45RbV/1PyW9E84N2VnvEOvgoysKo=; b=eQGiPKxpjQVwNXAAfD2+DrADN3mZLlzwN/UkcPJf8DId+9uHEuqGSbKA34m0aQZRSf mhrtlQGpZgrwhdhVhu2WRKsMOb6HtkUXgcAUYK5EYwbIUCp+um1trazcRcvWlcud7SPE WqlNeZsqpk0V16lni0RA0muIT7XgTow6W8J8Z5e2hOuCZXkS7ASW+/kpJ8kI6U7B4m2d fjmfjaeq51Wce2d3YDXIVCvFTXa4/zxmaaLzYPdBLRZxzoUrs9Bfj0jstcF7bzgXIPGr Cdd/Cm0dY3yfBl3W+l8e/1MqyUpcERRiyczyT2NTdbh0Wmr5u0lnTQ15M7WiHCqO5b+L jPkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3rM9/pP2BdU9S9K45RbV/1PyW9E84N2VnvEOvgoysKo=; b=DCawbQ7n39YqcmWa1VzzOtdKB1Y+yY9XiIDiBo6MuVPJbRsIGNacjaxY3q53GPEH6S ew0T9bTNP+Z2Gd0gPIz0a6gwygHSc7+NwY/IiT8RRnqrCysie1iLSwTFte0hG/uxhOiJ c6uYPev12MmGD/xhZiSuFCFJh/F2qyCi1j/zckgeexLTg/WeU23E19Jei5gfjnGc+xRK z0+1U5f4t0NuejIt0oqPmtdt9zMxefssyO44GpUpjZET48MRhZczuxvePNEfhhp4u4in kKvdGnLe1No5CNS9Cgi/ohVhina9byRezrRNZz3GwJUr3iKF4Zsc+Ux5XpO+XGc0aJpf fCqw== X-Gm-Message-State: AOAM533k8nYU3C0BmhtZgHloM/8puOGpCMnjbAv4TcMoDYN7XtmgScZD /5o5x/oz8p5pFvF1tMZL8SNx4maE9Z4= X-Google-Smtp-Source: ABdhPJxcY/PsIuP1QCQMExD7EUhuFX98c3eff4h+efhDQPwCezNogvk6E36EWcbQhjtWGcTuIAS86g== X-Received: by 2002:a05:6830:1de9:: with SMTP id b9mr17379623otj.137.1615163465375; Sun, 07 Mar 2021 16:31:05 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e82sm2039691oob.37.2021.03.07.16.31.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Mar 2021 16:31:04 -0800 (PST) Sender: Guenter Roeck Subject: Re: Errant readings on LM81 with T2080 SoC To: Chris Packham , "jdelvare@suse.com" Cc: "linux-hwmon@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" References: <8e0a88ba-01e9-9bc1-c78b-20f26ce27d12@alliedtelesis.co.nz> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1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3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <96d660bc-17ab-4e0e-9a94-bce1737a8da1@roeck-us.net> Date: Sun, 7 Mar 2021 16:31:02 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8e0a88ba-01e9-9bc1-c78b-20f26ce27d12@alliedtelesis.co.nz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/21 2:52 PM, Chris Packham wrote: > Hi, > > I've got a system using a PowerPC T2080 SoC and among other things has > an LM81 hwmon chip. > > Under a high CPU load we see errant readings from the LM81 as well as > actual failures. It's the errant readings that cause the most concern > since we can easily ignore the read errors in our monitoring application > (although it would be better if they weren't there at all). > > I'm able to reproduce this with a test application[0] that artificially > creates a high CPU load then by repeatedly checking for the all-1s > values from the LM81 datasheet[1](page 17). The all-1s readings stick > out as they are obviously higher than the voltage rails that are > connected and disagree with measurements taken with a multimeter. > > Here's the output from my device > > [root@linuxbox ~]# cpuload 90& > [root@linuxbox ~]# (while true; do cat /sys/class/hwmon/hwmon0/in*_input > | grep '3320\|4383\|6641\|15930\|3586'; sleep 1; done)& > 3586 > 3586 > cat: read error: No such device or address > cat: read error: No such device or address > 3320 > 3320 > 3586 > 3586 > 6641 > 6641 > 4383 > 4383 > > Fundamentally I think this is a problem with the fact that the LM81 is > an SMBus device but the T2080 (and other Freescale SoCs) uses i2c and we > emulate SMBus. I suspect the errant readings are when we don't get round > to completing the read within the timeout specified by the SMBus > specification. Depending on when that happens we either fail the > transfer or interpret the result as all-1s. > That is quite unlikely. Many sensor chips are SMBus chips connected to i2c busses. It is much more likely that there is a bug in the T2080 i2c driver, that the chip doesn't like the bulk read command issued through regmap, that the chip has problems with the i2c bus speed, or that the i2c bus is noisy. In this context, the "No such device or address" responses are very suspicious. Those are reported by the i2c driver, not by the hwmon driver, and suggest that the chip did not respond to a read request. Maybe it helps to enable debugging to the i2c driver to see if it reports anything useful. Even better might be to connect an i2c bus analyzer to the i2c bus and check what is going on. Guenter