From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 3B6E1416D17 for ; Tue, 1 Sep 2026 15:52:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788277953; cv=none; b=eiA7o5SzY2fjk70jTy1c7EO01TGNNxDlDtQcI5diBA58v6ZWl03WFs4n2a7jtS/RoQqABOiT0NABFNauePrlWPwTExIuUlkJ4WSxBPwNtFWgALLxJ7rA2O63vxTIN7PJVbyqWsIAewvFz/d/KRnszqnfOHt3jQoCDuqXtcGLtlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788277953; c=relaxed/simple; bh=qo4B/VQg4R+HIO7ngGNWGs2o3buHaJOuHDhTIuyaKDk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=H8PpLn565zKpzC+LwmWoGiqZezLxJsTsPZXk+RpkLOok58UfwO9FnJXoNI4UHdLAP4hkxH8xXxlqu74mE99syDmE0c7JFLeNZPNxVfivytqOLtvl7hcXyXhd/NYIZqgUVbHhhH4kq57/J9h4zsFPGkOfWRqo4AiX2O6Px9dQc1Q= 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=A4Jpl0Xm; arc=none smtp.client-ip=209.85.214.174 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="A4Jpl0Xm" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2d6d28aa26cso7445375ad.2 for ; Tue, 01 Sep 2026 08:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788277952; x=1788882752; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0WYsUBtiu7T2+UaZ7oUOCjJO0hwH1VaOOpnsEx1gGuc=; b=A4Jpl0XmDBWBX9V4rg3KonHfeoBLqepqSv5eGC8+zN8XWA8xIzCglUKJ62wLTsh6Oa k2CdGTatiYDzu4I0YlNsbHX+IFEgb6+thcVK01sohBv6IWbB6ZO2u2tmRl2vR9KEzVZI T1ZqkDeSsBw9JQR8ysiVTYupvXI9GFl83rfa7juPfQ7d/jJntiRznFzvnUEwH8SB16Tl wdKhNL0B8uXfL0Gkpe33WS48tZcfxqkYWMhfwqi1LQpzOSwVdBfqtCBwsDCnqC7wyGut H/yxxQiRj2dDneFA6aEnAHQorKkBJrk4ehhatIM6Z/FQ4GFjgfB5r/QIoM+oA8HvNSVS D2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788277952; x=1788882752; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=0WYsUBtiu7T2+UaZ7oUOCjJO0hwH1VaOOpnsEx1gGuc=; b=QJ/j18yIolfMwU0x5SQceoABMrPS7GVhkUh/vCaF81ojI+yqi+L118QeGq+ZLYFzuT ONotFHg9R9Ez8Mlae+CtxtJrVai/vgsZmNfEqkYfidI3vOqlJRUBWcEcyAq1aYiNzA/z jIw+cu2itUqRT14JpC5M7qlAd3mnMGKJmpr2WwdthVbO/ktt5x20KgM6oaRbuuqJzKU0 95oekRFcZXoRYX8+luCo8cjY/Yh384VWO9hkqpFu/kzCh/i8zYVUf5Q3Q1nboT1lnpmg V3DdaiioevCFcGQa2wLNqO53jInclQXFVd355rsPx5UVcALCCWEHgoSRH5EZD3E+7bNA w6xA== X-Forwarded-Encrypted: i=1; AKwUvBylJV8NdRhkTclb5cu7Mv1V52+B+JuwC4PdQwiunP/5/a0aa79ixT/V8TiP2Ya25ASuR9eI2NdF9po1@vger.kernel.org X-Gm-Message-State: AFuF++kySrvy5+4qvfqN/W+7jsqHjuam9Y3ggxVpXsbrqouSh01UbYrU nIWOTYwvEs18jg/YDyM1Y1AKRJmFi9uoYsdUwge0nQHSKVIAuaeVYbtk X-Gm-Gg: AYBFou1xDM1VBa42W7uuPy6OX5OC7DgeRLCuvF2iozPT2CfOKjTfVCfciF077v2gcvJ l1XAynvhZyZ9LKjMwSzHl5ARcnffsQSCbVo0clT9xYzrGno/hmEPdelBGSWxHVlnkDm4EOZ8bJb BXfLL2FlyFJmPMO09Xv2x5OkENLlT9CpVrqFfDrvEHTFs2QQB3AqcfoHLxouudt1PV72/Z2oryE RPxlEJ2YOKwRpaLQ2qx6AlfS9ff8Mm+oUJZJMV2yce1NvHt246xvrJpIT3S3YCP4w8LMgSdNCkF GMhOJhh8jCD2bHu+fO6nAWCdifEobdCqDIoZerEaX7I7eEynGIuMmpwgEjO/30bUMxt1CN9k1ri QcNPgmmdXuIixDrGHPSJAb/1nn9sN62/cIzoDwayVSsohMMKbl8hhB+JwQOi6uidvf3ry7tegrL H2qVGQYQlWc+seEOJUZu0suRFl6jXAr829EdOyqkCgdZ3MSWyj2Ap0wMmVVNMpnA/WyYNx3nKXa mSbXaX8cRaIYUS06Neolh4/q9Rbs1ZN3Z1lc0Vs4zWMtu8lbw== X-Received: by 2002:a17:903:3803:b0:2c8:2808:3ec9 with SMTP id d9443c01a7336-2d74df0328amr583020155ad.12.1788277951579; Tue, 01 Sep 2026 08:52:31 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:da43:aeff:fecc:bfd5? ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dadd6348f0sm795365ad.23.2026.09.01.08.52.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Sep 2026 08:52:30 -0700 (PDT) Sender: Guenter Roeck Message-ID: <4cc20c64-bd95-4689-81b3-3f01d9c3bc8e@roeck-us.net> Date: Tue, 1 Sep 2026 08:52:29 -0700 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/2] dt-bindings: hwmon: Add starfive,jhb100-fan-tach To: Conor Dooley , Changhuang Liang Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "linux-kernel@vger.kernel.org" , "linux-hwmon@vger.kernel.org" , "devicetree@vger.kernel.org" References: <20260830011941.40199-1-changhuang.liang@starfivetech.com> <20260830011941.40199-2-changhuang.liang@starfivetech.com> <20260831-dominion-data-c8b6f691dd5b@spud> <20260901-contrite-cathouse-f50c63af6323@spud> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0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Q7LUXCs0JaGVVP25Z2hMkHBwx6BlW6EZLNgzGI2rswSZ7SKcsBd1IRHVf0miwIFYy j/UEfAFNW+tbtKPNn3xZTLs3quQN7GdYLh+J0XxITpBZaFOpwEKV+VS36pSLnNl0T5wm0E/y scPJ0OVY7ly5Vm1nnoH4licaU5Y1nSkFR/j2douI5P7Cj687WuNMC6CcFd6j72kRfxklOqXw zvy+2NEcXyziiLXp84130yxAKXfluax9sZhhrhKT6VrD45S6N3HxJpXQ/RY/EX35neH2/F7B RgSloce2+zWfpELyS1qRkCUTt1tlGV2p+y2BPfXzrHn2vxvbhEn1QpQ6t+85FKN8YEhJEygJ F0WaMvQMNrk9UAUziVcUkLU52NS9SXqpVg8vgrO0JKx97IXFPcNh0DWsSj/0Y8HO/RDkGXYn FDMj7fZSPKyPQPmEHg+W/KzxSSfdgWIHF2QaQ0b2q1wOSec4Rti52ohmNSY+KNIW/zODhugJ np3900V20aS7eD9K8GTU0TGC1pyz6IVJwIE= In-Reply-To: <20260901-contrite-cathouse-f50c63af6323@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/1/26 03:14, Conor Dooley wrote: > On Tue, Sep 01, 2026 at 01:24:39AM +0000, Changhuang Liang wrote: >>> On Sat, Aug 29, 2026 at 06:19:40PM -0700, Changhuang Liang wrote: >>>> +patternProperties: >>>> + "^fan@[0-9a-f]+$": >>>> + $ref: fan-common.yaml# >>>> + unevaluatedProperties: false >>>> + >>>> + properties: >>>> + reg: >>>> + description: >>>> + PWM channel index. The driver allows two fans to share the >>> same >>>> + PWM channel, or each fan to use a dedicated channel. >>> >>> Doesn't matter what the driver can do, the description should describe what >>> the hardware supports. >>> pw-bot: changes-requested >>> Does this fan-tach controller provide the PWMs? >>> If so (although Guenter may correct me), I think the fan-tach controller needs >>> to be. >>> >>> If you don't do that, I think you're going to run into problems with having >>> multiple nodes with the same unit address when two fans share a pwm? >>> >>> I think what you're supposed to do is drop "reg" and replace it with "pwms", >>> but once again Guenter may correct me there. >>> e.g. aspeed,g6-pwm-tach.yaml >>> >> >> Perhaps I can refer to aspeed,g6-pwm-tach.yaml and change "^fan@[0-9a-f]+$" to >> "^fan-[0-9]+$", which would remove the reg property. In fact, the driver does not >> use reg either. >> >> Our fan-tach controller does not include PWM. The JHB100 SoC will have a separate >> PWM controller. (This controller uses the same IP as the JH7110 SoC, but there are >> some differences in driver implementation.) >> >> The JHB100 has 8 PWM channels and 16 fan tach channels. >> >> So currently we expect the Device Tree to be configured like this: >> >> pwm0: pwm { >> compatible = "starfive,jhb100-pwm"; >> }; >> > >> >> fan0: pwm-fan0 { >> compatible = "pwm-fan"; >> pwms = <&pwm0 0 40000 0>; >> }; > >> >> fan-controller { >> compatible = "starfive,jhb100-fan-tach"; >> >> fan@0 { >> tach-ch = <0x0>, <0x8>; >> }; > > Truncating this for readability, but it looks wrong to me. How does the > feedback loop work here when there's no way to determine which fan is > connected to a tach channel? The unit address of the child nodes has no > dt enforced guarantee to line up with node names of the fans or pwm > indices. Normally (for other fan controllers) the fan would have a target speed. The controller measures the speed and adjusts pwm output values until the fan speed matches the expected value. The controller needs to know the association between tachometer input and pwm output for this to work. Typically (for classic fan controllers) that association is static. In the Aspeed G6 fan controller it is dynamic/configurable. I thought this is the case here as well, but I have no idea if that is correct (or if there is a chip-internal feedback loop to start with). Guenter