From patchwork Tue Jan 11 16:51:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12710053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10943C433F5 for ; Tue, 11 Jan 2022 16:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239436AbiAKQvY (ORCPT ); Tue, 11 Jan 2022 11:51:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiAKQvY (ORCPT ); Tue, 11 Jan 2022 11:51:24 -0500 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A3E5C06173F for ; Tue, 11 Jan 2022 08:51:24 -0800 (PST) Received: by mail-ot1-x333.google.com with SMTP id s21-20020a05683004d500b0058f585672efso19271730otd.3 for ; Tue, 11 Jan 2022 08:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nDLdRvmB3dM6G7qkWrksPE++6DCBZiL1lfTPNl7o1NY=; b=ZDYcSC50n35hJYdATnR4gvNcRW4hvG3xW8yBuC564F8wN1OYAiHY2f2yJyvBAF6+U9 HfAcxuhBdZ6UEpefYadnbr1VFw9Cj11zI3tGz8CXN34SCBs3MdP7qaiCTGuYghhtCF3Q vyMD3o2dClPK/4znMtEGnH9TNSeWsV8xme3lcgB0yR+nzbLR/I7IW9cRFxO/ROj0iXdQ qLnxQ9V728p/cV6lnZyZ9jwfm61uAZUEcqChfKWIvOQCEk2+mvEFHW+Ra8ebo6NaMxtG BJrhMTf2CsbI1lhyqeST4qy215iBferaesykf37B2YHHPxgJ0lKu5ayVrB0Yp4mPloBv dRAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nDLdRvmB3dM6G7qkWrksPE++6DCBZiL1lfTPNl7o1NY=; b=KJdtEPsPpKMuWSq0KOYqKyfEyBRdHAdU6M38KTgt/kshyso510GRgq8fSUehuq92AE 4G263tfMbV4GfncVsOXqRiOaJQLnpJLxc54PRH4pfJlCNxdsfiSMqUHdNkgDJ/EhY/D4 Fl4AH3iz3pw+rG7cehqO6gw27ofWwa4f2THJ4aaQWkeCN2mYXbe2NfRfgJlOGR3LRRHw 5MbooRJmdih04BDmSY1iG6cE7I3dLvYsKUaSes0y5y6cBu153wB+/mG1YE7rwreqoiaO NTeloe5yTZ1tn3ThGyubQbDtwvsMc+90TOMhuK3MCIp4PQQpsEnpm8plfe8dPMhdb1yp 82NA== X-Gm-Message-State: AOAM531GlyQbq6LZpUxBjf8aAix8QtpfP6oxq2KXIToyfR0twsIAs5Ia XMoFMvEtTb9Vs9D+w5fi4LQCgs2fsnE= X-Google-Smtp-Source: ABdhPJwbSd9WWx6fZCF0hdjF/KdeJt3a/6Hy1r4F/kBSctX/3lRqBHQe/1EYIFfRGYUEXbrnKviqmg== X-Received: by 2002:a9d:3603:: with SMTP id w3mr3979988otb.59.1641919883327; Tue, 11 Jan 2022 08:51:23 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c4sm2030636ook.16.2022.01.11.08.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:51:22 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 1/6] hwmon: (lm90) Reduce maximum conversion rate for G781 Date: Tue, 11 Jan 2022 08:51:11 -0800 Message-Id: <20220111165116.1298459-2-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net> References: <20220111165116.1298459-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org According to its datasheet, G781 supports a maximum conversion rate value of 8 (62.5 ms). However, chips labeled G781 and G780 were found to only support a maximum conversion rate value of 7 (125 ms). On the other side, chips labeled G781-1 and G784 were found to support a conversion rate value of 8. There is no known means to distinguish G780 from G781 or G784; all chips report the same manufacturer ID and chip revision. Setting the conversion rate register value to 8 on chips not supporting it causes unexpected behavior since the real conversion rate is set to 0 (16 seconds) if a value of 8 is written into the conversion rate register. Limit the conversion rate register value to 7 for all G78x chips to avoid the problem. Fixes: ae544f64cc7b ("hwmon: (lm90) Add support for GMT G781") Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 74019dff2550..cc5e48fe304b 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -373,7 +373,7 @@ static const struct lm90_params lm90_params[] = { .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT, .alert_alarms = 0x7c, - .max_convrate = 8, + .max_convrate = 7, }, [lm86] = { .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT From patchwork Tue Jan 11 16:51:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12710054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCFCDC433EF for ; Tue, 11 Jan 2022 16:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240516AbiAKQv0 (ORCPT ); Tue, 11 Jan 2022 11:51:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiAKQv0 (ORCPT ); Tue, 11 Jan 2022 11:51:26 -0500 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12EF5C06173F for ; Tue, 11 Jan 2022 08:51:26 -0800 (PST) Received: by mail-oi1-x230.google.com with SMTP id s9so13340924oib.11 for ; Tue, 11 Jan 2022 08:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nbcM8kn+wKmARe43xVL5ENoGwAPFM3BtzBzbfc4SPiw=; b=mLKFtZ9mG6UoKKMKA4Cwim1kEeU5AwobD7oNT91+9FngmN13FEtTgU5oLZluXR6EIB +EatSpq6x/9f/MJC4xxxGQMjHDVCTMxeWh/RizQzcbn0oB6TisFgALLjHVTwb9ehD8Vy 0pIlL7CxGgGbBrqIRKvjh0upCS6IkY/E65CFtQJgKjwVwq04U04cdSh0B9Ix2zgzksj6 p2bQY+UlmT+/g2T1PP0HVWx9uji8Udt4lG+elEe2RmFBhHDixTuvII7mELnwcH/qkI13 cMN5iapwEtlU3+awp+BX12dP1mY/1qiJibHcnOdtRYVEzRPihdMUrFIHr4Z2I0dx0TD6 WG0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nbcM8kn+wKmARe43xVL5ENoGwAPFM3BtzBzbfc4SPiw=; b=WZ011krytvhn1Qoza13S3E9nwUodbwL2QTtUmkSr6S1eKRuRBQujzBEYsEDpygzU99 LoPr4R79++BLco9+leV8urOSRU1fhWbQJkdfCfoE1/Rm7IokXu/JojQih54oPz1mnAb0 rNMprkUEou6GgTpX06hNZgehZ95FEJ5YwO3Cm2DHcD6hfojXpxG5zOSHTTWZXvnkhQZt Q3adPAY+ILxiL2l/pYaXR1TmTqHifd9ej+wXL8H9fs8G2gEu0nNdgvITasKNEvT25mNs LpsRgB8AqvmJ8n1qXlNL86I/2riQoA8AgKJHlWzGa/GPN7pc8yZbXnvFGmtlYQtMBhMC H7dg== X-Gm-Message-State: AOAM531K7LF2OyUB3KC67rJY5XbyhdsHMniUw0syMUg7acUTAvyD1nlR UB3DaBbKSbSaPn1hvzCAPtNvHbGHZkY= X-Google-Smtp-Source: ABdhPJxU2SmYZzlj27IF1cWcuEbABbtqZouze++EosyO/zQ61M1wecJUuB8wmrzsp0cDj+1RaFLiZw== X-Received: by 2002:a05:6808:10d0:: with SMTP id s16mr2401665ois.111.1641919885222; Tue, 11 Jan 2022 08:51:25 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k1sm2157162otj.61.2022.01.11.08.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:51:24 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck , Dmitry Osipenko Subject: [PATCH 2/6] hwmon: (lm90) Re-enable interrupts after alert clears Date: Tue, 11 Jan 2022 08:51:12 -0800 Message-Id: <20220111165116.1298459-3-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net> References: <20220111165116.1298459-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org If alert handling is broken, interrupts are disabled after an alert and re-enabled after the alert clears. However, if there is an interrupt handler, this does not apply if alerts were originally disabled and enabled when the driver was loaded. In that case, interrupts will stay disabled after an alert was handled though the alert handler even after the alert condition clears. Address the situation by always re-enabling interrupts after the alert condition clears if there is an interrupt handler. Fixes: 2abdc357c55d9 ("hwmon: (lm90) Unmask hardware interrupt") Cc: Dmitry Osipenko Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index cc5e48fe304b..e4ecf3440d7c 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -848,7 +848,7 @@ static int lm90_update_device(struct device *dev) * Re-enable ALERT# output if it was originally enabled and * relevant alarms are all clear */ - if (!(data->config_orig & 0x80) && + if ((client->irq || !(data->config_orig & 0x80)) && !(data->alarms & data->alert_alarms)) { if (data->config & 0x80) { dev_dbg(&client->dev, "Re-enabling ALERT#\n"); From patchwork Tue Jan 11 16:51:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12710055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E695BC433F5 for ; Tue, 11 Jan 2022 16:51:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240586AbiAKQv2 (ORCPT ); Tue, 11 Jan 2022 11:51:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiAKQv2 (ORCPT ); Tue, 11 Jan 2022 11:51:28 -0500 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD7E9C06173F for ; Tue, 11 Jan 2022 08:51:27 -0800 (PST) Received: by mail-ot1-x32b.google.com with SMTP id t6-20020a9d7746000000b005917e6b96ffso1382868otl.7 for ; Tue, 11 Jan 2022 08:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eMQQjcWyxC/slG+JpdjpvXwDi2oVNQYC2xhLo3KL95c=; b=Y34JyHdmwd2c8jW6307GMAw2wLOiXj7vz4PjRXZNC186BET5oQZTOahHKcomk1l8wg /vw6XoPDI6Tl/GH+Wgiq/TSxnx/2djI7npkTADVUyGR/lkA3ndVtRPRcLuquPlHkK7ks qKZ97ymtlMy8lVspPmLIutkEbcqsIfQgFoaSxqNbGxTWnysbsvkVkG2XuuE6Y5/XMbXL doe+nMKldALbum7c5f0lCyJfTFFXS5TQNCUihnrg2ekhDya2EVOYzqPYgWzZyJ9ARwSR PYiYBRts92engdcMq3KqJIHnLPcipQ5LWq4IEx7LBaO/qHZp6tkRb47TWZKOULHNcGlL Ubcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eMQQjcWyxC/slG+JpdjpvXwDi2oVNQYC2xhLo3KL95c=; b=3vU2C6sbIONIKvaQTp/Rm7PgpPOhjddVkzrfI9vrlheLJOmfhwxZgHnY/7OEHl9ngF Co6egc5OxNZ8AeP9RXVVAnaCgmUbvOULn6ndC1wfc1AIBLmlU9Smkj5nSgy6/547E0+E MQQZs18GjTnXrnQPHCk4F/yLNLf6/qZbsYfgXB2FphGId+5mgLwXbsHv3mvFVM0XurIS xBuR1eco/V8ipv8EpFoxtNdgnj2SvZS3AbFPvCyZjOlIc2v/WVk7qScd5oSA5Qyl+FZA zZqVFcnRmDVcdQS9hMnVgJ2wWp+m5i+ycO1ym1W04UgbT60/+rTJPkuDj0HGeFdwdoRf Y3Ig== X-Gm-Message-State: AOAM531pVD36SjvOCjuJxhlMD/IHhE8x2mR5FgQ4rrGJC2DwLDcDyoVR mf9CE6KinD6KARTR632m1fJEL7DbIjE= X-Google-Smtp-Source: ABdhPJwXbCNaOnezuT5Wz+uzMF27Ck0RDl5OhgJFaezG+QdTK2bJ3/JsEsPXBy+Cdtd5N6qtwbCvRQ== X-Received: by 2002:a9d:69c3:: with SMTP id v3mr4122938oto.81.1641919886996; Tue, 11 Jan 2022 08:51:26 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c15sm1984990ooq.30.2022.01.11.08.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:51:26 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck , Josh Lehan Subject: [PATCH 3/6] hwmon: (lm90) Mark alert as broken for MAX6654 Date: Tue, 11 Jan 2022 08:51:13 -0800 Message-Id: <20220111165116.1298459-4-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net> References: <20220111165116.1298459-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Experiments with MAX6654 show that its alert function is broken, similar to other chips supported by the lm90 driver. Mark it accordingly. Fixes: 229d495d8189 ("hwmon: (lm90) Add max6654 support to lm90 driver") Cc: Josh Lehan Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index e4ecf3440d7c..280ae5f58187 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -400,6 +400,7 @@ static const struct lm90_params lm90_params[] = { .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, }, [max6654] = { + .flags = LM90_HAVE_BROKEN_ALERT, .alert_alarms = 0x7c, .max_convrate = 7, .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, From patchwork Tue Jan 11 16:51:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12710056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C02DC433EF for ; Tue, 11 Jan 2022 16:51:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240945AbiAKQva (ORCPT ); Tue, 11 Jan 2022 11:51:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiAKQva (ORCPT ); Tue, 11 Jan 2022 11:51:30 -0500 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3888AC06173F for ; Tue, 11 Jan 2022 08:51:30 -0800 (PST) Received: by mail-oi1-x235.google.com with SMTP id g205so1626568oif.5 for ; Tue, 11 Jan 2022 08:51:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1pWD9vt2kj9gfWlBLbMoDglgEwpaNcbHn5GL0JmnGdU=; b=ke/cWzN6ikATs/caL+jVr3jYrWQvPGWXZrp9D/fYJqpO65rRyC/6omYvGOR1pyLYGV QbjXRBR+To8WN6APu1eqE/qjcDmxbpXciKDy2ZLESk/s41+/VSBxKrNA4VlRrV9/JCbj wmaNqKTa0Mlngxc+sjXkseAvJ6SETxItNRoFnqAJpIXEYZtiqkwST3E0i2uO3WvDWqfM 1eu93d4lBbQH7JWGhPvGD9LEkhP0isp/mc0zWElnSE/cNSc2Y/h0T4v9xLT7+yshFU2U rCXgmZwW+cTHHGndlsLFIiRKKv1KryqqWnPzbRYQYM+CSxxx3NhFts578MRvoHi+KbRW Kr0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1pWD9vt2kj9gfWlBLbMoDglgEwpaNcbHn5GL0JmnGdU=; b=VhNZmo88uXXDnEsBCgrueqj1kVZ6Oaa7zEpfF20/mdEgRK5TYS4F1aUUkhhXrnXenQ f0v7QOq8M2t/t7RQFSas5ymAezvRgIo3r5fEqzMlDkILKRBngRDCyGE8+epY4+mrCW+R 9nU9Hgw//cxuz2dD3T9HzJ/8I5I1FQFDgJ9yEz5VmMjNqHLxsahVc0YEGxG20zjVfz67 Vu8JcxorwAh2Q5CoKjR4g3csNDkKW5SCl8dddq5+HyFq395PMNEjgoKMh8bTNx+9i8Kq yh071uQFTJFW7Vgygg0CaIQJc3RpeQEDQ2S+MyEr7J7sDhKJiFjRA+zDjNjoSGWKza00 E0Iw== X-Gm-Message-State: AOAM530lvAaj6YQ26XZ94yAMlISHRUZ+4scPKqFibZ4kLGoCE95xn7c5 GC3lKDsU1sF5kMdokG1NeYP14tJiDK0= X-Google-Smtp-Source: ABdhPJyicht/WGF8WZA5PFZKvk84zyDxv0fDVsg5Tl5IXMQcnt5btxQ4uAJiPqeIe0hTUwvHXMt3rA== X-Received: by 2002:a05:6808:1a1e:: with SMTP id bk30mr2432359oib.26.1641919889325; Tue, 11 Jan 2022 08:51:29 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id f9sm2112231oto.56.2022.01.11.08.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:51:28 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 4/6] hwmon: (lm90) Mark alert as broken for MAX6680 Date: Tue, 11 Jan 2022 08:51:14 -0800 Message-Id: <20220111165116.1298459-5-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net> References: <20220111165116.1298459-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Experiments with MAX6680 and MAX6681 show that the alert function of those chips is broken, similar to other chips supported by the lm90 driver. Mark it accordingly. Fixes: 4667bcb8d8fc ("hwmon: (lm90) Introduce chip parameter structure") Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 280ae5f58187..06cb971c889b 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -419,7 +419,7 @@ static const struct lm90_params lm90_params[] = { }, [max6680] = { .flags = LM90_HAVE_OFFSET | LM90_HAVE_CRIT - | LM90_HAVE_CRIT_ALRM_SWP, + | LM90_HAVE_CRIT_ALRM_SWP | LM90_HAVE_BROKEN_ALERT, .alert_alarms = 0x7c, .max_convrate = 7, }, From patchwork Tue Jan 11 16:51:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12710057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0D23C433FE for ; Tue, 11 Jan 2022 16:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240789AbiAKQvc (ORCPT ); Tue, 11 Jan 2022 11:51:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiAKQvc (ORCPT ); Tue, 11 Jan 2022 11:51:32 -0500 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C0FC06173F for ; Tue, 11 Jan 2022 08:51:31 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id w19-20020a056830061300b0058f1dd48932so19201568oti.11 for ; Tue, 11 Jan 2022 08:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NN8jZHxmNR2+eehiNfF2xVHlflpLBNPp8ULvGMALP8A=; b=IPU4vczu2oaXdUd6fPPEt4bRButHTKO7xY9whNtesvOARqFQHeInT6SJuAVrIUC97D WbvFXM24S979OqtSIb04MI5lJVl1ptpdKrtKobc7fmFqCCDnl26fj3e2jhRheJNbcNQM 0ET/62qLysJUc8yioNR+z0VWL3lwS08XOKiLwoQI9If0rrcHV97DPLmatd/IBFNr/t7h Bg6u84ZiTliD44b1UyCdE/unL7+NqygbHwAez/Gcln9AbBtVdJ7U5unODatvIlSgSWX6 +zNbekx8Jtb39qsAiS3GjANzp0h5+RaX9t0TSY0gfkb6UJ7NoH5JSMMM9V/perl/lWxv LJ9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NN8jZHxmNR2+eehiNfF2xVHlflpLBNPp8ULvGMALP8A=; b=BPIGiemS1L6MXaRDWrDksTWdCdtI6E8+i3Bw3vX2Buwt6zLHNMESwRBHlxQthUmsNn lVG9HUbFk0vhxp+oJoKZTqngIFRo2Th9VxY+izAGad1MTIstd4UZLjTaabZ7jKdNGYbE B06LVXhGu9TZRUbgn9VYSMbixpYRsGeMuZfbcR9YXUktHUWM45m9OSSb4UU4BTsmvo6y KE4GYXvcrhN4AFyTdPMeEC+pa6nsvjZBTXC3srJmSLdmZuLB9WoTih79ELfjkwqv+DPb M3yOsLYWo/jtGttlrP7EvfDm/Bbx+dsWSeRKFpwKJWy9Rx91lAru5f+FP++abiunOxAT Eq8Q== X-Gm-Message-State: AOAM531Q17guM9HUK2BiYdgaUbYyLfitbYAalCXzMCiPoZR6R4bJ0O/x mxtg40zTnhUlSg5BGnzVFWgRRRyUhh0= X-Google-Smtp-Source: ABdhPJyclrJGDpr2HI8W/wyAp5nzbUf3bwvtfmcE932/Ab9iOOQxxDx2W0T5+CbNh2kNY9Ce6zcquA== X-Received: by 2002:a05:6830:4127:: with SMTP id w39mr3881190ott.98.1641919891064; Tue, 11 Jan 2022 08:51:31 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 184sm1746998oih.58.2022.01.11.08.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:51:30 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 5/6] hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649 Date: Tue, 11 Jan 2022 08:51:15 -0800 Message-Id: <20220111165116.1298459-6-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net> References: <20220111165116.1298459-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Experiments with MAX6646 and MAX6648 show that the alert function of those chips is broken, similar to other chips supported by the lm90 driver. Mark it accordingly. Fixes: 4667bcb8d8fc ("hwmon: (lm90) Introduce chip parameter structure") Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 06cb971c889b..ba01127c1deb 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -394,7 +394,7 @@ static const struct lm90_params lm90_params[] = { .max_convrate = 9, }, [max6646] = { - .flags = LM90_HAVE_CRIT, + .flags = LM90_HAVE_CRIT | LM90_HAVE_BROKEN_ALERT, .alert_alarms = 0x7c, .max_convrate = 6, .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL, From patchwork Tue Jan 11 16:51:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12710058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C893C433EF for ; Tue, 11 Jan 2022 16:51:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241242AbiAKQve (ORCPT ); Tue, 11 Jan 2022 11:51:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238513AbiAKQvd (ORCPT ); Tue, 11 Jan 2022 11:51:33 -0500 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D3FC06173F for ; Tue, 11 Jan 2022 08:51:33 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id h20-20020a9d6f94000000b0059100e01744so2323799otq.4 for ; Tue, 11 Jan 2022 08:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CjwEkdPCpLwHsgwAOflwQ9NFF1ZKkeRUh+fi4hqpiu0=; b=I0hZTT77ewUTBvMoH00Y5q+Y+vjN3BxVJ/XR/nwUm5lh4JmAm9hY1aNxRXSSa+QkqB bMiQ5wvl6tQCGZYSdxK7OGFP8qb3zLDs6+EQsngqidEtdImaIVi4ZcNORubZBPrVhmzo wWI3Gy0YVeCv0qSHKxl8engjja7ujK0dwjhTI6Tu2kIBS5973rMBMIYhVRH16W5tooDR 0MElKSTZF9herPD6xgP+L9a/4UGJcM0oY999T+tefYpXBju54Zbp3czeNeqLL5PeSTag rGeP5fvJg67KgXMfO+/fI+lid66mJEyVH0m78SikJxiacLNE6kbbq+/5cal2/tR2akct 01zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CjwEkdPCpLwHsgwAOflwQ9NFF1ZKkeRUh+fi4hqpiu0=; b=ipwqg/PPvueWK4jHgWPNa3+d44nlo455s1PFXaM4pQxvMpZs5IYR38s5MyU4VT63NV J/ZPuzCztLWklXpbGwIHfphUSYb0+u66CLg2c0ElSXkRqjqmxqS+Vq1U2y84IVcbvVnG i+CyS2pOwRXdDsU3mDR6cR1urEZ01sfFrZJKvqHdTCZNhuqpgl5rHpn9VZheUgT1Ng6Q OAeEBrt7JLCMdu0+ASLN/gjXTWFkFwtp7+Ckl12pkfEK4xKhiMJLUXpNRHbM110A4bzl z1PwifRQWmSUzmkqcMxLlbUVD8cYmTrinHSYxfrpqxf2UXA6hjFIPoNAb9qC07qyJZmC 5fmg== X-Gm-Message-State: AOAM531vSF8/SH/0/EwOBkQEDbOiybVN8ncfA0qWQccUCuaIInkwvnF7 E/tjKFIAPklq9sSa6uNgsYJ5XZ9ihBM= X-Google-Smtp-Source: ABdhPJyyyV91veL6VdhhSM+IzU9Uq+QTTcY5jyT8iFKpRXb4T2sd87XnuegjKfAZ94mJ61KLiVIeew== X-Received: by 2002:a9d:4b0b:: with SMTP id q11mr4072761otf.74.1641919892795; Tue, 11 Jan 2022 08:51:32 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id x5sm2148617otp.70.2022.01.11.08.51.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 08:51:32 -0800 (PST) Sender: Guenter Roeck From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck , Dmitry Osipenko Subject: [PATCH 6/6] hwmon: (lm90) Fix sysfs and udev notifications Date: Tue, 11 Jan 2022 08:51:16 -0800 Message-Id: <20220111165116.1298459-7-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net> References: <20220111165116.1298459-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org sysfs and udev notifications need to be sent to the _alarm attributes, not to the value attributes. Fixes: 94dbd23ed88c ("hwmon: (lm90) Use hwmon_notify_event()") Cc: Dmitry Osipenko Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index ba01127c1deb..1c9493c70813 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -1808,22 +1808,22 @@ static bool lm90_is_tripped(struct i2c_client *client, u16 *status) if (st & LM90_STATUS_LLOW) hwmon_notify_event(data->hwmon_dev, hwmon_temp, - hwmon_temp_min, 0); + hwmon_temp_min_alarm, 0); if (st & LM90_STATUS_RLOW) hwmon_notify_event(data->hwmon_dev, hwmon_temp, - hwmon_temp_min, 1); + hwmon_temp_min_alarm, 1); if (st2 & MAX6696_STATUS2_R2LOW) hwmon_notify_event(data->hwmon_dev, hwmon_temp, - hwmon_temp_min, 2); + hwmon_temp_min_alarm, 2); if (st & LM90_STATUS_LHIGH) hwmon_notify_event(data->hwmon_dev, hwmon_temp, - hwmon_temp_max, 0); + hwmon_temp_max_alarm, 0); if (st & LM90_STATUS_RHIGH) hwmon_notify_event(data->hwmon_dev, hwmon_temp, - hwmon_temp_max, 1); + hwmon_temp_max_alarm, 1); if (st2 & MAX6696_STATUS2_R2HIGH) hwmon_notify_event(data->hwmon_dev, hwmon_temp, - hwmon_temp_max, 2); + hwmon_temp_max_alarm, 2); return true; }