Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4229734rwb; Mon, 31 Jul 2023 03:51:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlF5rRsoFJlVIBVC3Uase+57s9Fcr8LdlBbEEkf/IdIxa5kE1dG+HFvtomAUK48gtGP9oC7/ X-Received: by 2002:a17:902:c20c:b0:1b8:adc:7c3d with SMTP id 12-20020a170902c20c00b001b80adc7c3dmr9544540pll.40.1690800687241; Mon, 31 Jul 2023 03:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690800687; cv=none; d=google.com; s=arc-20160816; b=qUj8jK7CLlx3n566Muz7tcPo7mnJaA8kgW3Du82fzxBRKwVGj0R2TvGcj8Pniw01qK nocItQ+lRPy4z/4fJ28qPzS9W9Edn+zFUjccfKVzdLrZvn8XDtlDCaPlsgVqlCLsANg8 y6ZFqJHUtlLvnkbhn3mPoReGJ7ozA5q+PSgbGFkPf3V21rzsKh/HcS1DooWYkTI8Ysng C90ZSi5zQW9O4NBqkSr0NSCTsC93NIxYVS1BWiaiJ4Yo9v0gFVaThL5JWq40d6WE44sf IiPHw1Z03OdB0vJ87mt6Rs2UT4f6+e2i3QDkX5uBYAEyVaB9tCMDj6+TZyy14fmT1qDB xa9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZqOCi2n1NavpFlE8N26eyv2e5UnlllC9f92WXhukPKI=; fh=mLnScaqdySOg+EhxWXGSsYSvhjtnCtcY78oMnKgrMRo=; b=ZCBD/iRh8K+O71cw0A0DBTeSwfRxt5xVStY57CIGvCLgV59JQK4BgPhUL3bWy5RfHK cO3L8nuetqGGdOC36wS3uUD4qtvolz+bZkK/dYXKHSGzgbJEtwPD5Yf43zslJUbjKyEH EUsGPWBiDFOhgW+YWPrElt6/Yq2CHIMXuiCDtqMaUVSAJ92dYsYEZMEdK4AWbbW7JpYz W1HgYptkj9zr9uOuFVRCjCjnT9Zvp2lfsp0Wj0A+chujEMWr6cXdeAEs5mnSOYRuVal1 IyWSgbwWFL5H89mW6Vn9NShV5OQbzQgqfzcr37VCi9D59ksMWortc6KHr+AWTJLgP4Ps zlNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=cYAJPeYL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a170902a38600b001b9d5f07068si6895475pla.585.2023.07.31.03.51.15; Mon, 31 Jul 2023 03:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=cYAJPeYL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjGaJIi (ORCPT + 99 others); Mon, 31 Jul 2023 05:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjGaJId (ORCPT ); Mon, 31 Jul 2023 05:08:33 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6378D107 for ; Mon, 31 Jul 2023 02:08:32 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3a36b30aa7bso3254590b6e.3 for ; Mon, 31 Jul 2023 02:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1690794511; x=1691399311; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZqOCi2n1NavpFlE8N26eyv2e5UnlllC9f92WXhukPKI=; b=cYAJPeYLtVVoiLUwCyjZ8P38cbBUwPis0IrA6N3kL/xfsVxo7qe0AWLuUePHBqoOVl 6ctaUU6EdYF3voWE7ZmEABrE/xHm4sUfqS9Kv9UiJhwi0YkQk4oRBCYQrhDztsNQp6Jg aYs10i8JktYMjQINoMiWuJM8FTf/LCICmGSMLJ5HxNGfEB5ufTTdWvvxa7GRnHfRuLi7 xgoijvAFN4/5DHx/aTeWekfrA2ukUz96iGfrJ4lw8/YO7fjz/E/syai/5bE9mjN9pxEV gcfAO9gYKcC0c1BqdsRIZ3zqIPo0GlPqp6h8Ur2WPTSgFqR632SikI9UDhgQdL55f04+ jLUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690794511; x=1691399311; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZqOCi2n1NavpFlE8N26eyv2e5UnlllC9f92WXhukPKI=; b=aCvBiJ+I9QiASnpbW09ZXf9Oii54xPMpF/Vjq+eLPoRcWEE2K9uYNnEfes99UbBTGj 0R/5Qb3/eZqQsxbEFc7CSYNCKV+KRbJp3r1LbNU8iPn6WBEHfdzzDBcmUijC/dapV9Bb 7//JTVD0vXj+auhAtXpZ+cYi4g46vyCjDdDPNJVcx4zbTqnUnVY5NCOBNxFTfiju4aIp vc5BwByTKCW8p9QXbHydPcp9LT+EepRFC6B59rVhLRm3vJXHR8tokUUyna9gtjvp4qvj R4/EpSfLyW2qT8N6qrYBmDTvsuxm8/kYwaFQ1eoDJ7zbeYK/OC9f+NK0zcNbbacE70M/ ePOQ== X-Gm-Message-State: ABy/qLaw+xMazL2XafaDTmdrBgroLoVZt39AnwE9/0fPmXRS8loSSqAD Z213c8b7p3OdEDDNScZvBSs0FLQBrTpBIdrf92ZnRQ== X-Received: by 2002:a05:6808:f91:b0:3a3:640d:ed71 with SMTP id o17-20020a0568080f9100b003a3640ded71mr12058385oiw.10.1690794511632; Mon, 31 Jul 2023 02:08:31 -0700 (PDT) MIME-Version: 1.0 References: <20230728082527.3531940-1-Naresh.Solanki@9elements.com> <1cc12337-759e-c932-0303-b1b78e254c27@roeck-us.net> In-Reply-To: From: Naresh Solanki Date: Mon, 31 Jul 2023 14:38:20 +0530 Message-ID: Subject: Re: [PATCH] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD To: Guenter Roeck Cc: Jean Delvare , krzysztof.kozlowski+dt@linaro.org, linux-hwmon@vger.kernel.org, Patrick Rudolph , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Fri, 28 Jul 2023 at 19:56, Guenter Roeck wrote: > > On 7/28/23 04:28, Naresh Solanki wrote: > > Hi Guenter, > > > > > > On Fri, 28 Jul 2023 at 15:30, Guenter Roeck wrote: > >> > >> On 7/28/23 01:25, Naresh Solanki wrote: > >>> From: Patrick Rudolph > >>> > >>> MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. > >>> Fix that in the read_word_data hook. > >>> > >> Datasheets are not public, so I can not verify, but the code below > >> only handles MP2973 and MP2971. What about MP2975 ? > > I dont have MP2975 to even verify. I'm not sure if its applicable. > >> > >> Either case, this appears to affect most Monolithic chips, but > >> not all of them. Please limit the statement to known to be affected > >> chips. > > Yes. With what we observed, this affects mp2973 & mp2971. > > Will update accordingly. > > Please also add a comment that MP2975 is likely affected but can not be > confirmed due to lack of a datasheet. I have the datasheet for MP2975 but haven't verified it on real HW. Regards, Naresh > > Thanks, > Guenter > > >> > >>> Signed-off-by: Patrick Rudolph > >>> Signed-off-by: Naresh Solanki > >>> --- > >>> drivers/hwmon/pmbus/mp2975.c | 4 ++++ > >>> 1 file changed, 4 insertions(+) > >>> > >>> diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c > >>> index 28f33f4618fa..410b6eae6d02 100644 > >>> --- a/drivers/hwmon/pmbus/mp2975.c > >>> +++ b/drivers/hwmon/pmbus/mp2975.c > >>> @@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page, > >>> int ret; > >>> > >>> switch (reg) { > >>> + case PMBUS_STATUS_WORD: > >>> + ret = pmbus_read_word_data(client, page, phase, reg); > >> > >> if (ret < 0) > >> return ret; > >> > >> Please add a comment explaining what is going on. > > Sure. > >> > >>> + ret ^= PB_STATUS_POWER_GOOD_N; > >>> + break; > >>> case PMBUS_OT_FAULT_LIMIT: > >>> ret = mp2975_read_word_helper(client, page, phase, reg, > >>> GENMASK(7, 0)); > >>> > >>> base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11 > >> >