Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3963752pxb; Mon, 4 Oct 2021 13:50:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYnk4W5Ed2mSHN5rmElC4cFtfQo5b8F2lqa5SicXMFn/+hcgt6szdbTkHpLkVq8bqYMGMR X-Received: by 2002:a17:906:25d4:: with SMTP id n20mr20078138ejb.399.1633380645199; Mon, 04 Oct 2021 13:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633380645; cv=none; d=google.com; s=arc-20160816; b=jNxcXI79/eMM3iTKlEzS0ZgYU8UCsAqk5ve8dkoNcwSG062MbtrcOI16UQ0pxreeYr Igav0F52orPZBfJKeloa6R7OXNJyMzxSTQg7qKB8gcXxgQ1sMagVSzJEhEA633WwmP57 vzrYBsI++wS6Vdp8WGBAdrjamqsRSXNBYfSkxgtC2tchV5v7wSZ2HgqDI7Ut1PQ+H4sG Hmbbu5jm3mz6/NwuMk57leNiZnii8B8BS5moeV2yg0G4falhQKQbQZfK48f7G/xrjLRl LJpCi/m15nDsU6WUgjVQGiBG6FvMZGJYLesSdgRJxx+9U8L0Sdp/Px2q+yQRrqdgRE13 QLvA== 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=YEFc4zbG9ZFdn4azZtPpavuLNUkxeqbdLng+TXLxv3k=; b=npnwvVQCReTyKUmJgKYxL22NN26QVhHB6COqnMB1wGJ99JCMF2hl1ZhRah+Fygs81n kiNlaDIY0A95x/57NufIi3KpyJDWu/V+e93f7A1oc/QhbE7Vm+JHJWQTffpuCRpVsgiB CxBOHnE6uAhjiiKEnVlc9eEgJjGGnc1OmFe6sulTypQQ+o3M1U40RKCohqyboDOvyP2P owD02FYdqRFULElCJVjoECpVQ8Xtap2RwGxhy0ZXk3bO8bR7qOG54QN9GvkuiM11uLdq FV51a1iXtXxsoyaul4NNEMsLECAetYjhuF3yoB5qy3r7f5E0O5746/ZP77UjtMZLAXfE y1cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Uyn5Qn/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si7363798edt.106.2021.10.04.13.50.21; Mon, 04 Oct 2021 13:50:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Uyn5Qn/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238575AbhJDNkq (ORCPT + 99 others); Mon, 4 Oct 2021 09:40:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:53144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238558AbhJDNio (ORCPT ); Mon, 4 Oct 2021 09:38:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 930DF6323D; Mon, 4 Oct 2021 13:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353469; bh=HAXHvd38nLZh1//qgjGynSrYXsQ4pGRzDCFaDW+elBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uyn5Qn/pSaAt6jH0SlhOCk5wK+hu4X6gEdJGSEOlZ8KoRDFvPIskokWHLB56o6dYy 4EoVO5LQT53mUfL87phqfMhnDUDzyNkTTd/nPpadG3prD9WHW+dmuij/e9T5KIt5Pa D4nFEI49/5GQSKi+W0t8Rg8ZYCtDJI5sKG3sOWq8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eddie James , Guenter Roeck , Sasha Levin Subject: [PATCH 5.14 141/172] hwmon: (occ) Fix P10 VRM temp sensors Date: Mon, 4 Oct 2021 14:53:11 +0200 Message-Id: <20211004125049.523260646@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eddie James [ Upstream commit ffa2600044979aff4bd6238edb9af815a47d7c32 ] The P10 (temp sensor version 0x10) doesn't do the same VRM status reporting that was used on P9. It just reports the temperature, so drop the check for VRM fru type in the sysfs show function, and don't set the name to "alarm". Fixes: db4919ec86 ("hwmon: (occ) Add new temperature sensor type") Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20210929153604.14968-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/hwmon/occ/common.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c index 0d68a78be980..ae664613289c 100644 --- a/drivers/hwmon/occ/common.c +++ b/drivers/hwmon/occ/common.c @@ -340,18 +340,11 @@ static ssize_t occ_show_temp_10(struct device *dev, if (val == OCC_TEMP_SENSOR_FAULT) return -EREMOTEIO; - /* - * VRM doesn't return temperature, only alarm bit. This - * attribute maps to tempX_alarm instead of tempX_input for - * VRM - */ - if (temp->fru_type != OCC_FRU_TYPE_VRM) { - /* sensor not ready */ - if (val == 0) - return -EAGAIN; + /* sensor not ready */ + if (val == 0) + return -EAGAIN; - val *= 1000; - } + val *= 1000; break; case 2: val = temp->fru_type; @@ -886,7 +879,7 @@ static int occ_setup_sensor_attrs(struct occ *occ) 0, i); attr++; - if (sensors->temp.version > 1 && + if (sensors->temp.version == 2 && temp->fru_type == OCC_FRU_TYPE_VRM) { snprintf(attr->name, sizeof(attr->name), "temp%d_alarm", s); -- 2.33.0