Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp684346pxb; Tue, 5 Apr 2022 18:41:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL+HmfeJT4tXr1QdJRzRZmb5jN2Jy3xVA/ojmp1+05hGHoatjl+MPqm9pqAuURguuEP7Fi X-Received: by 2002:a05:6402:34d6:b0:419:4dc2:91c5 with SMTP id w22-20020a05640234d600b004194dc291c5mr6456429edc.329.1649209296923; Tue, 05 Apr 2022 18:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649209296; cv=none; d=google.com; s=arc-20160816; b=cWdzmJpBmgCXSV/YrjpDUmfMKthFtvbNk+bqgIuurIdprPU0fhSSXzX0rdLp5ixbOI qo+rE3QIIM412mP0yxApWfwuxeupgKtz/oWz2HpjJT8l70lTdNN6Zch2ZtlSHhrV8wMO o5ggB9vxAV9nyuuQh8jXNM7j0Fm7y+YpbhnHc8sB+VnyB9qycrAXwOQ2w3tmJXTSigQO KEwgDqLLO3X15TaDqWCGO15Rzh85A07/2cSgg7Sw+Rb2Xi5a1BoEwlsFzcuzPPh31xJx +2SqZL0yauN/blKISI24Q0H3Oix7wvzBK+ERo7NJ/5n8bI1XP/b24rI/Yio0Oar3Xuuw ONow== 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=YowCBQS9rT/X1blsaIpWFqYxToZow0Gxx9+TcsKnCqJtoXNxOf9t5sPbNJYO+Jhq9b PLX2o5LRUTVdRbHtyB4epaIBJuF519kUA9eyF6SgQKJSOfzd6ex+U3oniABeFjXxfagM lgqLO8TARK6XTKAoSWQhlKuX/Ta1H0pmeUn+lAeaq5n1mrSP5JMBKMve6o5Q7cxNwB5e Yw/GElqwJaZgs6WIUrDh0FZhePeTCd2wdKbPDnw3k188hj2M0MnAq/9nBr98O0NlXEgY YUBcUoD1tjBPwpS96DG0Lf9MfqDjfcaMrGV+XhDehR8DaWrsQdqHjdpZebdtY5bKA/fH 83Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VZgtBdLu; 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 b11-20020a056402278b00b00418c2b5bed1si9653702ede.435.2022.04.05.18.41.08; Tue, 05 Apr 2022 18:41:36 -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=VZgtBdLu; 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 S243020AbiDEPJR (ORCPT + 99 others); Tue, 5 Apr 2022 11:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345568AbiDEJni (ORCPT ); Tue, 5 Apr 2022 05:43:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB1BC3369; Tue, 5 Apr 2022 02:29:25 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 018CC6165C; Tue, 5 Apr 2022 09:29:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 168F2C385A0; Tue, 5 Apr 2022 09:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150954; bh=fR0LPZAFW7MV+r5mifjCwMPbuQwjL9+Zm/J+XCY09io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VZgtBdLuZE55Hdl8HjUB8H+zquUvtIaEHjZX5JyKQYUOXz2JYjBOYLRk91ofmCD/T oPCmx4Pmk3MbAkURdpS8J3XeSel27DxdY4P66uR6f7PaT5NnRrEVyrk7ccG2/cG72D H1/0rypxKRzZ8Vu0WTb91dQkybop7xRF2QSj+V5A= 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.15 240/913] hwmon: (pmbus) Add Vin unit off handling Date: Tue, 5 Apr 2022 09:21:42 +0200 Message-Id: <20220405070347.050547234@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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