Message ID | 20230731092204.2933045-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 s11csp1971829vqg; Mon, 31 Jul 2023 05:14:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGs1aulos2Plc9WYvyLxhJ+taZxyXZ+JkgCDu2SNE71oMS0uSnZhQkBlmHjtuJ4VP/Xtoav X-Received: by 2002:a05:6e02:dd3:b0:346:59ee:bbd with SMTP id l19-20020a056e020dd300b0034659ee0bbdmr7325795ilj.3.1690805697768; Mon, 31 Jul 2023 05:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805697; cv=none; d=google.com; s=arc-20160816; b=J/lD/CW1qjek4+2VBRtg2qIewEgGxk6F/lK+2bvzd0kYRPip9NIHAip35u4w/ENwiO ZKlW963BnJDUwF65+kikJE9WgTM42cxThAOYlQCNhP+9RvIAiod72Jt1NoymlZ69T5gA aRUh3D1ms4u/1yGcfmQdJqHd1vfDYAPazn1XlyL95M7WVdD9wZNdj9QvEoSPYgaoG/OC 6G8Yc7N04zJ1bccHaKR3LbNzu3coX6FXwBWhqgFOw4zHPP9bJt6l50VYryVgsxPJr1sd s7dC7xxhZxfKboC6rDvPjzB1imtYBq4VzL23Ye4Rx8STCTW85yvA79rIvwBkClysCF+T 52XQ== 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=VvA4s9P3xdtnzACs7zx36srPHY2xosHFCEdn6jvHAMA=; fh=zU/5jTO0Nc/7/EkdPdSVeio61JjJielntXb/iXfBVLU=; b=VOOUTRXF79ieYm+e+lOogfPtfrCaDjPlGCP/p/1wisR8GWWVD+UgJsRpz76HfHXJh9 4ESV8lly6pT2+TbdkUCgyeBYOsm9rx7mS003xxp5Aq6BLwOrWbLGpDYqg9M7YnljPLrU wS8ylytHPo780S2e3CVicgOIKq2PZdbVbFMzJdtfJuFYKsjfpa5sgxOg/8b7Txzi4tUj HsV5TXawDtPc4UdmoepQcVOc6mMcE7DQLQx+WU98KGam5FLqHKtdjcjXEYXPnDC5rE6m iDjV0Gq1rN/zggrbd33pRgrc4tYXmdWuevIEJ4oDbyQGYqvJAGuqeYlxt0sKa8xL87bU 4Y5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=ONNl6rkG; 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 v10-20020a17090abb8a00b00267a487f014si8829040pjr.167.2023.07.31.05.14.44; Mon, 31 Jul 2023 05:14:57 -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=ONNl6rkG; 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 S231643AbjGaJYU (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Mon, 31 Jul 2023 05:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbjGaJX6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 31 Jul 2023 05:23:58 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61DA21702 for <linux-kernel@vger.kernel.org>; Mon, 31 Jul 2023 02:22:11 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-522aad4e82fso3165652a12.0 for <linux-kernel@vger.kernel.org>; Mon, 31 Jul 2023 02:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1690795330; x=1691400130; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VvA4s9P3xdtnzACs7zx36srPHY2xosHFCEdn6jvHAMA=; b=ONNl6rkGIzDE7tCT2Y+18Sqg5EC3k8ugs7hE6pi+8CmpINAWuCHJftXecKXI0j4BTT xL8gtLwRgkhnofWyqLo8RAnH42UIpstzBWqWnV6+2PE25zk4ud29EfHSFMBZ8wFOoAcf c1ljNJMKy3MnVzq47fD/wy5BX9oq+xp8h7Nx1Z+HxQpwAF+xtjAYKVEQWTZZe7MhR/6S HT+qy+qQCO7KZ/ORV/FGDpmge7hMstQB5mtbNuNBFQ4Apq4534hOmgKnkoh5fju842GV Rc8en1QpDA9kPKxBiRHpH2UD+OZAACtG6clXcdlPi7PP1K/1O/njkBZBUjqSkfjcEUf2 MkBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690795330; x=1691400130; 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=VvA4s9P3xdtnzACs7zx36srPHY2xosHFCEdn6jvHAMA=; b=EyFOb4UXWNNcN2d9LewWZwHpK42wUEn7ge/g90Q8eip6XbzjrEGwmW7zz9SaM+MAyb 7bjQEoGzwzUotxR9NUK7sixLYxe56IyS3P20YTRT2HPR/rvRnMrEvaYSpqT9t2KK28n2 N0+imLR9xT9BrjSvl00+8bK/3jfZ/2RqB5GdKUteZ5/6HyWI8M3/YUR8zEv6sv6HqjnC WKGuT2Q/MLONH9aZZoR4PHsFnUIQ+QO3D+SpLfFqwMDnttQiA0wkdrCCZztcPyiDR44H potv+LFNKTGRyBoJIBbqN1BqyoFwMFxtAscMkcH4skP4mBZPSezNtaPPCnHoJCl+a+sn fxEA== X-Gm-Message-State: ABy/qLaW2/3ptp0ga1kCeJOI4QXM+Qq4wO/yNiEJBf7/Y+Pfg7P2OBai sciGol0XZOp/GBcxVsW0sLir3w== X-Received: by 2002:a17:907:b13:b0:997:eab5:f1c3 with SMTP id h19-20020a1709070b1300b00997eab5f1c3mr5313306ejl.73.1690795329728; Mon, 31 Jul 2023 02:22:09 -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 i22-20020a17090685d600b00992ed412c74sm5837785ejy.88.2023.07.31.02.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 02:22:09 -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> Cc: vadimp@nvidia.com, Patrick Rudolph <patrick.rudolph@9elements.com>, Naresh Solanki <Naresh.Solanki@9elements.com>, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD Date: Mon, 31 Jul 2023 11:22:04 +0200 Message-ID: <20230731092204.2933045-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_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: 1772933117499632436 X-GMAIL-MSGID: 1772938275215408808 |
Series |
[v2] hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD
|
|
Commit Message
Naresh Solanki
July 31, 2023, 9:22 a.m. UTC
From: Patrick Rudolph <patrick.rudolph@9elements.com> MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook. MP2975 might be affected but needs verification. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> --- drivers/hwmon/pmbus/mp2975.c | 5 +++++ 1 file changed, 5 insertions(+) base-commit: cb7022b8976e3c4d12cea2e7bb820a2944e2fd7b
Comments
On 7/31/23 02:54, Vadim Pasternak wrote: > > >> -----Original Message----- >> From: Naresh Solanki <naresh.solanki@9elements.com> >> Sent: Monday, 31 July 2023 12:22 >> To: Guenter Roeck <linux@roeck-us.net>; Jean Delvare <jdelvare@suse.com> >> Cc: Vadim Pasternak <vadimp@nvidia.com>; Patrick Rudolph >> <patrick.rudolph@9elements.com>; Naresh Solanki >> <Naresh.Solanki@9elements.com>; linux-hwmon@vger.kernel.org; linux- >> kernel@vger.kernel.org >> Subject: [PATCH v2] hwmon: (pmbus/mp2975) Fix PGOOD in >> READ_STATUS_WORD >> >> From: Patrick Rudolph <patrick.rudolph@9elements.com> >> >> MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N. >> Fix that in the read_word_data hook. >> MP2975 might be affected but needs verification. > > Hi, > > According to MP2975 regmap datasheet for STATUS_WORD, bit 11 reports: > 11 POWER_GOOD_N 1’b0: PG is active. > 1’b1: PG not active has occurred > Is it the same what stays MP2971 and MP2973 docs? > I don't have a datasheet for any of the chips, so I can not confirm either way. The above looks like the standard definition, suggesting that MP2975 would not be affected. If that is the case, the commit should say that MP2975 is not affected according to the datasheet, but that this has not been confirmed on real hardware (unless you can confirm it). Thanks, Guenter > Thanks, > Vadim. > >> >> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> >> Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> >> --- >> drivers/hwmon/pmbus/mp2975.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/hwmon/pmbus/mp2975.c >> b/drivers/hwmon/pmbus/mp2975.c index 28f33f4618fa..27bb39370662 >> 100644 >> --- a/drivers/hwmon/pmbus/mp2975.c >> +++ b/drivers/hwmon/pmbus/mp2975.c >> @@ -297,6 +297,11 @@ static int mp2973_read_word_data(struct i2c_client >> *client, int page, >> int ret; >> >> switch (reg) { >> + case PMBUS_STATUS_WORD: >> + /* MP2973 & MP2971 returns PGOOD instead of >> PB_STATUS_POWER_GOOD_N. */ >> + 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)); >> >> base-commit: cb7022b8976e3c4d12cea2e7bb820a2944e2fd7b >> -- >> 2.41.0 >
On Mon, Jul 31, 2023 at 11:22:04AM +0200, Naresh Solanki wrote: > From: Patrick Rudolph <patrick.rudolph@9elements.com> > > MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N. > Fix that in the read_word_data hook. > MP2975 might be affected but needs verification. > > Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> > Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Applied, after rephrasing description to indicate that MP2975 is likely not affected. Also added Fixes: tags. Guenter > --- > drivers/hwmon/pmbus/mp2975.c | 5 +++++ > 1 file changed, 5 insertions(+) > > > base-commit: cb7022b8976e3c4d12cea2e7bb820a2944e2fd7b > > diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c > index 28f33f4618fa..27bb39370662 100644 > --- a/drivers/hwmon/pmbus/mp2975.c > +++ b/drivers/hwmon/pmbus/mp2975.c > @@ -297,6 +297,11 @@ static int mp2973_read_word_data(struct i2c_client *client, int page, > int ret; > > switch (reg) { > + case PMBUS_STATUS_WORD: > + /* MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N. */ > + 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));
diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c index 28f33f4618fa..27bb39370662 100644 --- a/drivers/hwmon/pmbus/mp2975.c +++ b/drivers/hwmon/pmbus/mp2975.c @@ -297,6 +297,11 @@ static int mp2973_read_word_data(struct i2c_client *client, int page, int ret; switch (reg) { + case PMBUS_STATUS_WORD: + /* MP2973 & MP2971 returns PGOOD instead of PB_STATUS_POWER_GOOD_N. */ + 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));