Message ID | 20230728082527.3531940-1-Naresh.Solanki@9elements.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp312949vqg; Fri, 28 Jul 2023 02:42:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlHCnmnYshsKzCyuOVgvKhLBaoya1Ot11pQjw3JEariEaa/OsgZ70v0s40sgkWy0TDIYmCSY X-Received: by 2002:a17:907:75da:b0:992:528:abe with SMTP id jl26-20020a17090775da00b0099205280abemr1610393ejc.53.1690537336620; Fri, 28 Jul 2023 02:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690537336; cv=none; d=google.com; s=arc-20160816; b=FAoz15RCrKJTkeDOolsxsuRcgDPD/bhHg1nswi0ycyJeBPMUDi5gKqfKUO2gfEwizE A1z7rYy1VKWwSUzPNH+MgBLJClPJWALHDneyS72LR5ilkuA0tItOwCEfP/Oly/FY5hcP FCUN6plUSkLyUM1VDYZ+nasiQRn7+WADxjex/2Re+dvBha6U5lxw84HYvkC27N7gcnbt ppz1Jq01T1C/U+6S550J4wNxxOUl+QcWvPW54cyForDlcLKjr264HuqBK5AX91ygW91E h87a82g09b33p+AjEa32K0c4lfVZg7cyhF1PDJkBxxozoQo1AlkHGjH2RZs7ij7BlkeV z2pw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=K+/sikRBn/Qq/vhiRc3RFGPx8ZtUHA2efcREJGjKdqM=; fh=/6OmkISz2jasWA5ktD7Ct/RQ5jfIZG0BSS+/WFT7oFk=; b=x9csuLtCiPFKsrdwdMOTnn54J02nUNq0XHpN4SvL0rbTmnJzh+ynM0gW5fsKefrsz0 IgHUDlUaeQ9Ko8gGFceUzhUZi4CaRqwqMGkMDotxq5mzJAu5w3Bb+xvATSBXOExqTzg0 W69+iB9/8LBcrKcTpaRT2QrcIDO4xZ+WXJbtnccAC2+ibHDEArqsCvvPfHAHbWgnzbGC 7Eq0Nzc52JjEPCNkC1DQkHurseHK40K3sOzExM+TKXwa5eWmdtR/eoMuNxe8NvW5wYW5 k0s7AZSvUNvAOi/XHg0VkGqQ2QIgXbYr9BQsurIfWklO0YgUInnhmk7HKp64lwX/D65I 7bTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=a6wvT+Hp; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a1709063c4f00b00987d66e6d26si2351776ejg.250.2023.07.28.02.41.52; Fri, 28 Jul 2023 02:42:16 -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=a6wvT+Hp; 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 S233791AbjG1I1U (ORCPT <rfc822;hanasaki@gmail.com> + 99 others); Fri, 28 Jul 2023 04:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235013AbjG1I0M (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Jul 2023 04:26:12 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 487304497 for <linux-kernel@vger.kernel.org>; Fri, 28 Jul 2023 01:25:32 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fe11652b64so3262876e87.0 for <linux-kernel@vger.kernel.org>; Fri, 28 Jul 2023 01:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1690532730; x=1691137530; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=K+/sikRBn/Qq/vhiRc3RFGPx8ZtUHA2efcREJGjKdqM=; b=a6wvT+HptneOSc+E4hHf1hdtSU8Ut4nKTvXZ+ldBeA3GKR3OCW4sBA+dpkeyDnLnXr 3Y2DooqKud8CCL1CLCxaz1T0leNINHQroqb31w7CGsI8aVpui9SXzFUCGHS1WbI2TncQ E4CAE04FidMlyKcFY6gfqcHbXKgD1XcpC7LvnNeJKeMdO49e8DvkR5Pv1BVXlg3MpTS7 ypDP2jAAowOrm+M9ZbzeN8KCaJEvP0lp6gQiMyh4/yXPYXGr7g4LcbiAN1Q7BnmByaew RzS87VhK07u9g2nk7VsP93D2jVs+4BGlToY4alPzwbIW+GiDHaYLTu3SwBbW2BQ0TVMT BheA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690532730; x=1691137530; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K+/sikRBn/Qq/vhiRc3RFGPx8ZtUHA2efcREJGjKdqM=; b=DYVxHG+K3zdOa+xFoKfpvt6SnHfkvmi6T8FmUTAD1l7C228xqfPZrk8Eh5xYEsI+RY cXc3fmx3oFivHYMlYuyonSiLd+097WFQ6j0RPOPx0fkHklydNL8NUi6ZI83njtzBVtC4 hbPKVHtVsyODS2cAh/wbeA9e0p2cf9x8ZErjFVV4D7zgrDJXE3zc36ZuigAMx0aVi3v8 6ib0osM+hYEXxEsNZZZHDRM7d7E/8pv0b6es+7QwvubpEOzL/ocQXncGejA44pMweiUf WEsFGzwoWnm2Lfbq5XpUu9HFvExt1LBJscwqErBd0JoM2cQT0lAlqa1k5BtwYMdYq3Nj b/qg== X-Gm-Message-State: ABy/qLbFu7zUm5Vy0a7qlBMvrNTsDMb1T+2eGVVOIrxrWuk/xfzl62wQ TbvVDIPrSeKLG/fmXvhk6QHRRQ== X-Received: by 2002:a19:711d:0:b0:4f8:5905:8e0a with SMTP id m29-20020a19711d000000b004f859058e0amr1025135lfc.6.1690532730535; Fri, 28 Jul 2023 01:25:30 -0700 (PDT) Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id w11-20020a1709064a0b00b0099bd0b5a2bcsm1753729eju.101.2023.07.28.01.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 01:25:30 -0700 (PDT) From: Naresh Solanki <naresh.solanki@9elements.com> X-Google-Original-From: Naresh Solanki <Naresh.Solanki@9elements.com> To: Guenter Roeck <linux@roeck-us.net>, Jean Delvare <jdelvare@suse.com>, krzysztof.kozlowski+dt@linaro.org Cc: linux-hwmon@vger.kernel.org, Patrick Rudolph <patrick.rudolph@9elements.com>, Naresh Solanki <Naresh.Solanki@9elements.com>, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD Date: Fri, 28 Jul 2023 10:25:26 +0200 Message-ID: <20230728082527.3531940-1-Naresh.Solanki@9elements.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772656878238941734 X-GMAIL-MSGID: 1772656878238941734 |
Series |
hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD
|
|
Commit Message
Naresh Solanki
July 28, 2023, 8:25 a.m. UTC
From: Patrick Rudolph <patrick.rudolph@9elements.com> MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> --- drivers/hwmon/pmbus/mp2975.c | 4 ++++ 1 file changed, 4 insertions(+) base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11
Comments
On 7/28/23 01:25, Naresh Solanki wrote: > From: Patrick Rudolph <patrick.rudolph@9elements.com> > > 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 ? Either case, this appears to affect most Monolithic chips, but not all of them. Please limit the statement to known to be affected chips. > Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> > Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> > --- > 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. > + 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
Hi Guenter, On Fri, 28 Jul 2023 at 15:30, Guenter Roeck <linux@roeck-us.net> wrote: > > On 7/28/23 01:25, Naresh Solanki wrote: > > From: Patrick Rudolph <patrick.rudolph@9elements.com> > > > > 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. > > > Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> > > Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> > > --- > > 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 >
On 7/28/23 04:28, Naresh Solanki wrote: > Hi Guenter, > > > On Fri, 28 Jul 2023 at 15:30, Guenter Roeck <linux@roeck-us.net> wrote: >> >> On 7/28/23 01:25, Naresh Solanki wrote: >>> From: Patrick Rudolph <patrick.rudolph@9elements.com> >>> >>> 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. Thanks, Guenter >> >>> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> >>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> >>> --- >>> 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 >>
On 7/28/23 04:28, Naresh Solanki wrote: > Hi Guenter, > > > On Fri, 28 Jul 2023 at 15:30, Guenter Roeck <linux@roeck-us.net> wrote: >> >> On 7/28/23 01:25, Naresh Solanki wrote: >>> From: Patrick Rudolph <patrick.rudolph@9elements.com> >>> >>> 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. Maybe Vadim can check / confirm. Guenter >> >> 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. >> >>> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> >>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> >>> --- >>> 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 >>
Hi On Fri, 28 Jul 2023 at 19:56, Guenter Roeck <linux@roeck-us.net> wrote: > > On 7/28/23 04:28, Naresh Solanki wrote: > > Hi Guenter, > > > > > > On Fri, 28 Jul 2023 at 15:30, Guenter Roeck <linux@roeck-us.net> wrote: > >> > >> On 7/28/23 01:25, Naresh Solanki wrote: > >>> From: Patrick Rudolph <patrick.rudolph@9elements.com> > >>> > >>> 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 <patrick.rudolph@9elements.com> > >>> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> > >>> --- > >>> 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 > >> >
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); + ret ^= PB_STATUS_POWER_GOOD_N; + break; case PMBUS_OT_FAULT_LIMIT: ret = mp2975_read_word_helper(client, page, phase, reg, GENMASK(7, 0));