Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp486781rdf; Tue, 21 Nov 2023 08:00:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxM77LWI3DxXZmKLuqNT2sQWD4blHONxZNyj1QWeNac+2YjuPaoZlqYCkJMKMGz66wOrPO X-Received: by 2002:a17:90b:350e:b0:283:9a71:4578 with SMTP id ls14-20020a17090b350e00b002839a714578mr9491948pjb.37.1700582404882; Tue, 21 Nov 2023 08:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700582404; cv=none; d=google.com; s=arc-20160816; b=AsCNJn1Mz40ZJgaX8FqUynhNSks0OkJAfvgVM4ZXDHiV+16zK1SUQYYqy/JjlFFE4v 8cFvHyE5wj9GKXGaH8bP/of1WBdNaz5Vn5ekoQNTCNKWQHbNnVvUMNsA511/JGvD6fZX RYAG+20/iwS6jL8Hf882X8cow+gQ8bFqrjKDS53L0DWgNO13q08KdoUmLBVb5xAfmh3D ocxbGIwJAhYxhb4LX7OVujquyghy7gb5VPcdwr8PF4fXTBtuQ239TF/Ji7yCVFl5JxTB 684em14kHTxDfMtg6cvL+vUZmjVUncpg5/sJs6GZE135bg9P9uYikydGDk76MqSdBksG H7cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Fq3/SeE6KNYDBQttCmY4nSF67urFZudHZ9zaRpvfJak=; fh=ggDe2hCABdhwmBjYSig27+eDVHOAwsQ/7OKY9cqtB5g=; b=xRWfRw2nGm/75egWI7TC7Z5j9YyFj4uhoToWelEJDynqikVNUJ+P1lI7iRbFO/U5Ew g1VU1bpQG/+zm55IG6zm0Y2k3Mp5jeeQpXGmQpVEBzbELldCfKUmOX84m8zRE9Mc/4aL bUIMihxMXGrUMhRPs0/lzoyP8EZU6K+vaWlZv0KOAmR0xcUFuErM7/jx3F/2PrGR1g/+ U9b7edZrkKy9at2zcbxJW5y58w0WilVUmXJOmY/6y2br6VnoFVbEqn4ArsXR0B0TG/rB 4NwmMs7hKbXJ5m6on8eEo4VSNBeVe8GHhdxcV8SAkhp48a4QVFk60ruT8EVoHRg4R9A7 tXkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=awDCcdZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ci5-20020a17090afc8500b002839e721d0dsi8949337pjb.77.2023.11.21.08.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=awDCcdZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CA44980291F1; Tue, 21 Nov 2023 08:00:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234708AbjKUP77 (ORCPT + 99 others); Tue, 21 Nov 2023 10:59:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234855AbjKUP76 (ORCPT ); Tue, 21 Nov 2023 10:59:58 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA0B197; Tue, 21 Nov 2023 07:59:55 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cf669b711fso13619515ad.2; Tue, 21 Nov 2023 07:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700582395; x=1701187195; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=Fq3/SeE6KNYDBQttCmY4nSF67urFZudHZ9zaRpvfJak=; b=awDCcdZ4mkaiRtHxio++m6oTzwWw30ShpEYZd4oCsc7XzvvZ5OMqWTfXUR++QFk+4L iNXo1HMHGkFbtBrnpKrh9PB1pEXf+VV67kqmaGb62EX+ta3Sb1PLYcsxt5hcJXJx9hNp Vxhx1mYi2ljm/lvcYab8LuYOp9Qeeh7e6hRTBZLSrDQPhzx4Ur0q6PiqXor5mnJQoC7g bU+qlnKCzxmeCvQquBxGtiCGf6m6FbGjvqYzZ70SO9zoFF3TufUVHXMLhs/wHW/qe+mv /m6pspBijBSNUof69SPeOiKNm2hMJAkPiztfzlf7TBCD0cNJdW7NMWoSSyPHG167k+UO 6j0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700582395; x=1701187195; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fq3/SeE6KNYDBQttCmY4nSF67urFZudHZ9zaRpvfJak=; b=LE6oSJV2TWcMBGoDvKY39s8b9KyQiWxjM86QHsVg/sqUhOrFq81/zmJMzZtrxxjNgS IfyXvGIQv0okYhXKR00rOJy3qHmFaAcZhgRsX/0ObjbmC9i4NTltxIyAOggO1xf9p9fF cQ0d25lvlPWGOs7Q8DI2zJfcvWeBsqIq1aWreKBC2Ts7r/YsorJwc5qC5jH2dySAXroE PfQeMvBRUMo6CtMf9cebipKm7HeQ0ZfU22M+v2Nv6UacCtNgkJaMyPFHw0/nzYpCjZ7e Q43xI7uFPgTPuT4/59aJcn+uZjgGHsHkc7bKYVNamQxNAzCQf7XHFkXwAGnyznb9gpAF uhlQ== X-Gm-Message-State: AOJu0Yw8mSPzWJTmd2PSW1ywr27SpvgH0X8JXY08BBJ9jbIoAyiaxZ/W yJ9hCsFWsLmtGEpenReU/gBe+Ey8Wak= X-Received: by 2002:a17:903:2301:b0:1cc:5589:7dba with SMTP id d1-20020a170903230100b001cc55897dbamr11433532plh.43.1700582394533; Tue, 21 Nov 2023 07:59:54 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id j6-20020a170902da8600b001a98f844e60sm8104668plx.263.2023.11.21.07.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 07:59:54 -0800 (PST) Sender: Guenter Roeck Date: Tue, 21 Nov 2023 07:59:53 -0800 From: Guenter Roeck To: Xing Tong Wu Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, xingtong.wu@siemens.com, tobias.schaffner@siemens.com, gerd.haeussler.ext@siemens.com Subject: Re: [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode Message-ID: References: <20231121081604.2499-1-xingtong_wu@163.com> <20231121081604.2499-3-xingtong_wu@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231121081604.2499-3-xingtong_wu@163.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 08:00:04 -0800 (PST) On Tue, Nov 21, 2023 at 04:16:04PM +0800, Xing Tong Wu wrote: > From: Xing Tong Wu > > Setting the fan speed is only valid in manual mode; it is not possible > to set the fan's speed in automatic mode. > Return error when attempting to set the fan speed in automatic mode. > > Signed-off-by: Xing Tong Wu Applied. Thanks, Guenter > --- > drivers/hwmon/nct6775-core.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c > index 88300fb99bb9..83f1da5acd22 100644 > --- a/drivers/hwmon/nct6775-core.c > +++ b/drivers/hwmon/nct6775-core.c > @@ -2553,6 +2553,13 @@ store_pwm(struct device *dev, struct device_attribute *attr, const char *buf, > int err; > u16 reg; > > + /* > + * The fan control mode should be set to manual if the user wants to adjust > + * the fan speed. Otherwise, it will fail to set. > + */ > + if (index == 0 && data->pwm_enable[nr] > manual) > + return -EBUSY; > + > err = kstrtoul(buf, 10, &val); > if (err < 0) > return err;