From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f12.google.com (mail-pj2-f12.google.com [74.125.227.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D0555625E3 for ; Wed, 9 Sep 2026 20:37:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.140 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788986270; cv=none; b=n5pcjAmi+OL6SDkNqR/8wKXfI48yxGAPt2vnCnDuBxo2osvmtD0/GWgoWyuki+or8tFJJF7UtN7fgtrRt4YS/cczDNHtk/wRbShfPf5BtJd3TEOxILoEMUBgBOOBfp9OpftqmEHie33Oj8J24U3QtfnSKEtFXzUNKFE3CI2ggYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788986270; c=relaxed/simple; bh=5Hm9gfjEI1Q2doQp1W1IdtzLqqaU+0usRSw9PAqTEB0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=riJf0cScyb4VLDG3EXSLASgs3Gayb+QdsMmOQt1JAPRALaGT0LXPXWrEvJ6NR7DRJA6IZRVA7mx2n6UpVjtTDHwJMlpCefs9Ikk3X6XKdWOdUcCtg9mhp2MWq5atwDpIRWUZu4m0AxLV0kgFOY1kHJ5Kh7Z3kgzoOtRNw0XFw78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eEjEpjaf; arc=none smtp.client-ip=74.125.227.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eEjEpjaf" Received: by mail-pj2-f12.google.com with SMTP id d9443c01a7336-2d90ba1d807so9104685ad.3 for ; Wed, 09 Sep 2026 13:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788986264; x=1789591064; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to:content-type; bh=8ck0b/tvXvZ/1fxlfkYlwHFNSdW5hjtPnNTOS43Hbuw=; b=eEjEpjafyAx0EMcn7QDeHBJvrqY9VpJoVW/oCyJB/ptPlt3+pg/OIEoID3hJId/mQO 2epXyGjI2Wq0T6012WCjZUMfWA30/GHqT+2mTZq7th0PvA+UQnVJ0h9MCPPtvICRESl0 ruM48B/BBD1ja8Hf6I4J2TaucDGpv8fLf/cj9OZOlnPXr3nv7yXIaui/yL/7CjRHIQ1T 7ihsRvWCQkKKXgaWggyIWfVU46H/c2sAXH2FFGchcwBHAYR9X+4ckHaxFMHzZ+4hldSg FWS8E5MdmYeo6NY+ZlJqQ7xy0VcyKrq0JRWzMP3Udus+412lVRudkxiSxQJIGH0Xnn/+ mogA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788986264; x=1789591064; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8ck0b/tvXvZ/1fxlfkYlwHFNSdW5hjtPnNTOS43Hbuw=; b=Q3lzAKNZb+gHO9KJkwqnlxuOgiqzNfG0+4kdkZYZeKcx7dEOF1dsmjwb75yd4kIJUM TPHFSsXOCtHoTw6Lza+fFF0kXLy/HZYn1+djjByy54p7ZxEiBxdoNM3MkG1DMMp7SPca x6qSTvA3ClmYAq1jYqMqcXNzxYmp3usB/m4l3HOmQK0LLSIsKVxixWvbGQGICeQZ+BO2 ahpuYRCLbtIiwyatA9MKhxn6PlPcFLprTgrEnlU/pJg4PTdthL7EeC01Qlh0i3P6o/pA 6BQPPSn9S3hlVhhJg/0OoUlvKUW7iMBh9OALlfijZyUu+Wf9TBpoHbsehNQznO8IhqE5 /rLw== X-Forwarded-Encrypted: i=1; AKwUvBzy4Y4/bv0SFq4PRL4LoBzHvojRR7XST7BuEcCVZRjYNuRrf7G5yTm7kcswnI/zLJR3TXCLeB3JM79SFTA=@vger.kernel.org X-Gm-Message-State: AFuF++khhXhrmt260aMO68QMjYDa1XNxykeG0I6spZByvlA69rbjtfot wLWrct8XCd0lpx0sjI+iwswGSpGVwSM331mrkGbgtAKaaTBA8BX0Uw26FlpUHA== X-Gm-Gg: AYBFou3U92tNtDdYXBS4Na7/NPKMmO1fCYOdq758XASVrMgvYfdG73tONkQFxYoowLT wJQnMPJvgJ3dQMVd9Rg20iX6+PiVeeIrvru+6ZgB8udNEt8/6dyRr79jMrWDDAg7cOVnyn8D/rH q1Nkw45Q9uxxCDr8h5moHITk3FaNzibelMoEtS8JWU5sOLOSmwF7xqKR/vCb0M69/ElQ4syQe+5 ahZVrVEwQZ3jUR7RCpZ5NC+C2uetvrpYN7Pco25AhgF4l1vGy+zHToNX/kPSXn4bcx1hMQk6aoy Codb06TbXHBGZsbmEOOP4+SWtM0lowIRk6BhFiKKE4KgRlw3fkA3pMpfpOcIYtCoF8Jh0W30rUw UzhzLqNeUzB0eZcD4JuzWvDfK2Xlgh4Tc4fSYWdl+ElsMrJVEnPiIf5GbDpCWFQ6dxYthoOJlfG RCz12bYOkGDbr43fISySk3YSVqkSyNEdiSbb7VX2O3Cfh1k4OFUJh5GAJs9grQFPh+VOqKjdCQj EkmqTA4LyXo X-Received: by 2002:a17:90b:558c:b0:38e:57a3:f218 with SMTP id 98e67ed59e1d1-39d70ae1a5emr4704439a91.13.1788986264483; Wed, 09 Sep 2026 13:37:44 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39d770bc2e1sm1226801a91.1.2026.09.09.13.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 13:37:43 -0700 (PDT) Sender: Guenter Roeck Date: Wed, 9 Sep 2026 13:37:42 -0700 From: Guenter Roeck To: Ali Ahmet Memis Cc: Ming Yu , Ming Yu , Jean Delvare , Lee Jones , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: (nct6694) do not expose enable on DTIN temperature channels Message-ID: References: <20260803102148.14196-1-ali@iusegentoo.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260803102148.14196-1-ali@iusegentoo.com> On Mon, Aug 03, 2026 at 10:21:48AM +0000, Ali Ahmet Memis wrote: > The driver registers 26 temperature channels, all advertising > HWMON_T_ENABLE, and indexes the enable bitmap with the raw channel: > > data->hwmon_en.tin_en[channel / 8] |= BIT(channel % 8); > > tin_en is two bytes and only covers the 5 THR and 5 TDP channels > (index 0-9). The 16 DTIN channels (index 10-25) are enabled by the > firmware and were never meant to carry an enable bit. Because the > control structure is packed, writing temp17_enable and above indexes > past tin_en into the fin_en bytes that follow it, so it toggles fan > enable state instead; nct6694_hwmon_init() then sends the whole > structure back to the device, and reads report fan state as temperature > state. It stays within the structure, so this is not a memory safety > problem, but on a board that uses the fan channels it is not harmless. > > Give the DTIN channels a temperature config without HWMON_T_ENABLE so > the core never creates their enable attribute. The enable path is then > reachable only for the first 10 channels, which stay within tin_en, and > fin_en is left alone. The DTIN input and limit attributes are unchanged. > > Fixes: 197e779d29d8 ("hwmon: Add Nuvoton NCT6694 HWMON support") > Suggested-by: Ming Yu > Link: https://lore.kernel.org/all/20260802124730.20387-1-ali@iusegentoo.com/ > Signed-off-by: Ali Ahmet Memis Applied. Thanks, Guenter