Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp710514pxb; Tue, 5 Apr 2022 19:47:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1SbrVHqIAsEH+Ey9M1X3L9bYS2sn6K2l644KBR9o70SS58nKEHdUydfovRQZ7cvqiDJ2i X-Received: by 2002:a17:906:3a4f:b0:6cf:86e0:586c with SMTP id a15-20020a1709063a4f00b006cf86e0586cmr6261825ejf.626.1649213273520; Tue, 05 Apr 2022 19:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649213273; cv=none; d=google.com; s=arc-20160816; b=iObewZ2hh4EdDg50SZGzm8taxk3HT65fhFZLfS4TG6aIR4JQXzHr5qhaSehiXYPao9 abVFYQ/AmLRzKF5Wpx0lIs8zR1mXuDVRHP9KE6/FMqHT+trUqVnKLBmNaLJOjuXrqjB+ YKvkIi9il8YTsSsFU8cXe6fmhricoxt1kjGKDQMPomw1+mmO/KH8CAaEaezsQIbHDBLp 3pOBjiZ/wb/fDS/Gicx8nUHXnopCkPuvpk1Ruf0OLJ2IxAOwRsEbI2x9uJH4EK+tfj9K hibmYOmY6aqrC3Lp6PQG2sYfng4BKKByNxNnonl9YerNnvPwa0Qy0vPklAx1zW60DtFH tEXQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/cHoScGQlSWBaqm8yFRKdo7IGF1dPYSwX7aJ4FDJigA=; b=FTVxQF6RP+VeHtxEVM1LmYfpVEmopq5P8y5+ZNH7rDfMOKLVrOdx3uE5ThSjo7wKlZ H6zHLfxigrZpZjkN1/rYeqT1RoctI77LSgpLWCMdLzbHC9m+7UBYhqXvOwpjCr5wKCX0 xzjCrMFm10+BOh+cZDU0pjtRULytb63H4vhq7rlMc1XR9o5Ir8r417F4RORixcxpZxiT O7HhjhkN5ufLIoOj4Fvic3rjuHq8NbItFpJOK9k3XoXQgc0s0XzjHJVwlviX0dYbQ91b RYXHt2l4pP6eTah1BHoXkouIWrtYwrgrXY+4ICsmrcGvPBWlQ0SKTTjw9TgvWjyM19JA VVQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sh1xkgtK; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vp14-20020a17090712ce00b006dfb07cee44si9115120ejb.814.2022.04.05.19.47.27; Tue, 05 Apr 2022 19:47:53 -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=@linuxfoundation.org header.s=korg header.b=Sh1xkgtK; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240750AbiDELfI (ORCPT + 99 others); Tue, 5 Apr 2022 07:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244715AbiDEIwf (ORCPT ); Tue, 5 Apr 2022 04:52:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E97F1AF34; Tue, 5 Apr 2022 01:42:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1DCC2B81A32; Tue, 5 Apr 2022 08:42:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88BBDC385A0; Tue, 5 Apr 2022 08:42:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148154; bh=fR0LPZAFW7MV+r5mifjCwMPbuQwjL9+Zm/J+XCY09io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sh1xkgtK2W6unx+AzZd/ycrz/He8hi5lYSyJ1E2GjlPjUYvnDGSlxBNEwbb6Oywb+ xyDDmW5vI6cBL8BKbRM4qqE/zWJViqSen2cUnKQ4dd30vtzPIXWMYFhPm+x5IA33G1 2Q9V1SVFq0NQhcCaxrCMScPlARNocuWux4EqQ7v4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brandon Wyman , Guenter Roeck , Sasha Levin Subject: [PATCH 5.16 0253/1017] hwmon: (pmbus) Add Vin unit off handling Date: Tue, 5 Apr 2022 09:19:26 +0200 Message-Id: <20220405070401.772891949@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Brandon Wyman [ Upstream commit a5436af598779219b375c1977555c82def1c35d0 ] If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well. Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults. If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear. Signed-off-by: Brandon Wyman Link: https://lore.kernel.org/r/20220317232123.2103592-1-bjwyman@gmail.com Fixes: b4ce237b7f7d3 ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers") [groeck: Dropped unnecessary ()] Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/hwmon/pmbus/pmbus.h | 1 + drivers/hwmon/pmbus/pmbus_core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h index e0aa8aa46d8c..ef3a8ecde4df 100644 --- a/drivers/hwmon/pmbus/pmbus.h +++ b/drivers/hwmon/pmbus/pmbus.h @@ -319,6 +319,7 @@ enum pmbus_fan_mode { percent = 0, rpm }; /* * STATUS_VOUT, STATUS_INPUT */ +#define PB_VOLTAGE_VIN_OFF BIT(3) #define PB_VOLTAGE_UV_FAULT BIT(4) #define PB_VOLTAGE_UV_WARNING BIT(5) #define PB_VOLTAGE_OV_WARNING BIT(6) diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index b1386a4df4cc..ca0bfaf2f691 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -1373,7 +1373,7 @@ static const struct pmbus_limit_attr vin_limit_attrs[] = { .reg = PMBUS_VIN_UV_FAULT_LIMIT, .attr = "lcrit", .alarm = "lcrit_alarm", - .sbit = PB_VOLTAGE_UV_FAULT, + .sbit = PB_VOLTAGE_UV_FAULT | PB_VOLTAGE_VIN_OFF, }, { .reg = PMBUS_VIN_OV_WARN_LIMIT, .attr = "max", -- 2.34.1