From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12BF2606A31A for ; Tue, 1 Dec 2026 08:14:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=n7ptT9bz Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB64D10E379; Tue, 1 Dec 2026 08:14:00 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4288410E379 for ; Tue, 1 Dec 2026 08:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796112835; x=1827648835; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=zcuHZ+H0Ip9czTD7LfUcZ5gLYkQwVh8oqbiMsNPDvsQ=; b=n7ptT9bzrR5qgzC9Le+J4ExJOblsVKaoY57iR6+yCGI13CucYT1ux1n9 V6kh1cCbkd1FHDG+elxFvF/8fF38z85C8kXIXKfkbx+5NlRw3oQzLPEIw SAQ87ih3GN2FfslKgzZQ+X83BADrlPniYhPNppoyb0JN9LwfLQ9cKAVfN P9T7spOH+BkNOie5GyKJYvvgdEzj80pvtzJF+bTbbbBxpmgOGOBNF05oM a1ZgDw4yTSM8S3a3nAIjKS7/0STofgH0zx0owKxVHE4MprlnUN9RwoVj/ uQp8axDGo/gNC87ZXRw4yVCIWGQfIzKC/TZBe8rMbigqOl8AvKFJ9C1OK Q==; X-CSE-ConnectionGUID: QvfeHxvhTwWm15FgKm4+ww== X-CSE-MsgGUID: EBFRXwwIQLuZzvOvCnUKRA== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4994548" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4994548" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 00:13:54 -0800 X-CSE-ConnectionGUID: n1SmWO9dSpecJjplronHWg== X-CSE-MsgGUID: on+E/SSsRvi2BwLmSdBAQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13548766" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by orviesa009.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 00:13:54 -0800 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 00:13:53 -0800 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Tue, 1 Dec 2026 00:13:53 -0800 Received: from BL2PR02CU003.outbound.protection.outlook.com (52.101.52.31) by edgegateway.intel.com (134.134.137.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 00:13:52 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tTpCMb82D0xwhl7RTrMpLFEKUBwHUiWcwTffWr9v6mWsC7MdhZeBi6LmyybzfM9ej53AMYg1Mj/cAtoNLAN8WmPlLiD+loA9FdNLS/Avtcn/i3XJFygfD/7WNQrsM7fDrHc7oZNhzAbHZvjo6YAFgPPkWwAFWqLlTdxqxCXJrUs04+5kKZ3UhATO1u4rdglfLi3PCFqRlNuGiHdr7SxXeeRmKdQA9k0rkr/F5AhkK3grTiOPj8T1JeG6voz187AnPKVpMynxT1XnIub+a6XN0IVb3aGUBJW7BT6Xxk6stHQkFGA2ZDCuJCXZDzlicBtsQd65peE11ncU7kI2aHli+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zcuHZ+H0Ip9czTD7LfUcZ5gLYkQwVh8oqbiMsNPDvsQ=; b=ifY11CjoAprIttm7Tvgi3QSxHaZanlHqiOLYSk8dPP8JjxTqWKc4Cfc4XuxYbbtA3UT4vyQ1GWoTKYnmOEn67/cmrI2747ybTeMKiTajcPl4ei9JUIoix4tWPut+AMi91BZ1alOsOuQ33nHS0VNEpQCCjKmmetUMX2ZRn6RFh7+O5957UcU+l4A+BPog6LnDiBMKMIxUkXNRSW1fokCRCp5E3kkopBesdagFaFuCeM5Fti5v1ZVLZH2v6xbvIfmabyjvfFaEOl/xzDRn9MsTdY7+nzhR7qbjh5ibxKCFeJmpbfJn0mYPM7YdIxDQ20QsrXvTThxNUewvnY9jKTYI1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS6PR11MB087165.namprd11.prod.outlook.com (2603:10b6:8:4c4::7) by EAYPR11MB9970.namprd11.prod.outlook.com (2603:10b6:303:2d6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 08:13:45 +0000 Received: from DS6PR11MB087165.namprd11.prod.outlook.com ([fe80::4223:7b03:1329:265f]) by DS6PR11MB087165.namprd11.prod.outlook.com ([fe80::4223:7b03:1329:265f%6]) with mapi id 15.21.0662.007; Tue, 1 Dec 2026 08:13:45 +0000 Message-ID: <40e2fa98-64ec-48e2-aa32-a5c5c7eed77a@intel.com> Date: Tue, 1 Dec 2026 13:43:36 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 10/10] drm/xe/hwmon: Add kernel-doc for fan control To: Karthik Poosa , CC: , , , , , , , References: <20261130185050.36979-1-karthik.poosa@intel.com> <20261130185050.36979-11-karthik.poosa@intel.com> Content-Language: en-US From: "Purkait, Soham" In-Reply-To: <20261130185050.36979-11-karthik.poosa@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MA5P287CA0024.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:179::14) To DS6PR11MB087165.namprd11.prod.outlook.com (2603:10b6:8:4c4::7) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS6PR11MB087165:EE_|EAYPR11MB9970:EE_ X-MS-Office365-Filtering-Correlation-Id: eab69f24-04e2-4a16-aa9a-08df4f8304ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|23010399003|22082099003|10067099003|56012099006|261028144727099003|261102123227099003|261026121527099003|261021123027099003|261021121427099003|261026140227099003|261022105027099003|261022075727099003|261009223027099003|5023799004|11063799006|4143699003|18002099003|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: uHywIBGJi243gZGg8WPpnT7eUYp5IA4BLLN9e0Nun/t3nJPs5Nnkjj3fXJj7imAKt2Bsk/0kyo/384BCM/92GFwcWcOjRV366gjhJE/p4UAWKbF066SkgzMowHgF3dK4ppaxSTe2p4hFJ1J+6pG8ryV5HOQiKcdEzxya8nFueXHsLSGwO9E4oSc7xVQeSnyoUKjSGC92fMlqDvR9WAB9nXgC269CAPXhPCH6LlRCkvWnaRW4SWHf4uxB3EJzi4ReMzuu67hdto57/l2EISFUBAKp7FLyW64iuPHuybrrWwL7olXrwKcmyzgW+jc4A0BEo54mUcukLPpcO78zvqfP8gCqX9w6VqvJbLKhZ4K9JyUW4TD+PmNKLyItL6nNMtt+5HOKJNU66mdwRaYNnTEG5vUzZpDA/v2lIH7BjXScq55NvtfZcZkq6N3N9qVonB9IRBRSJOaaGz/D4m4Y7cpVpesMHV0stIoBMifEpnMWmL+kWaHT1HC0qIJtv3Ug/IDB8/BXxOIFHanilFka6atom5BvF7pLq5OJLHo7bbq/3QTSFXNQHrhToLRJ6yFKjjoS9j0TCk7mmfvo4jWJBOCqW9cDtM1LfC8SGRdJre/XzwVDDktFy5dXygpOzPEFzh+1KYa/TGiEmnKE8b4kJLZclVLEjDWyR/NyqSjMxsiMp54= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS6PR11MB087165.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(23010399003)(22082099003)(10067099003)(56012099006)(261028144727099003)(261102123227099003)(261026121527099003)(261021123027099003)(261021121427099003)(261026140227099003)(261022105027099003)(261022075727099003)(261009223027099003)(5023799004)(11063799006)(4143699003)(18002099003)(6133799003)(3023799007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VlVtT0VBT3hSakNyNEtLYVhVbE5PWDkwYmtoU3o0OGhTNHhrVGh3MytYMngw?= =?utf-8?B?aGxKYis5S25JSDhXdVVRcUNrSFNhTU5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8?B?bkpaZU5DMXh1bk9ldjdwQTlkUFVMZ2Q0eEZHQ0ZNWVRKM1EwVlkwemRqTkJm?= =?utf-8?B?dEE2TncvR0NrRW9Pay83YjMvL21VaUdwS1czcldqYnVnYUhFbnJ0cDhtMFNG?= =?utf-8?B?SGNhWWNlcnRKeWRlYy9BQ2lQQXlyYWR0OUtkQ0hHdUlldjRqbG4yWkErTVd6?= =?utf-8?B?Qm02WFFvUEZ0K3RQVml6LzNiZjVjZ1dmMmZOMlZzTHpreTRPNXVKZEl4QU51?= =?utf-8?B?Y3d1aUM3M1hjTy9QZy9kYWR2RFlMUFdRbWtGQ0FRSTk4M1FaMTRJSWNKUUh1?= =?utf-8?B?cXVSVUptUlBiRXdicTBrNU53MFN2Tk9UR3lsL0gxODVwT3pQS0lTNC9rTkY4?= =?utf-8?B?d1NpdXlTOUdjd2NMY2ZPb0RHYWVaR2U0ZTNVNmpGY0REaWVYampDZ3piQWsx?= =?utf-8?B?a1QvOXcrYkt0ZWN3NUZVUnVSTmNYTWxyakRFWTVpUkpOVjVhRFg0TFlhSVQr?= =?utf-8?Q?MEEOu37hH/+4vnKY=3D?= X-Exchange-RoutingPolicyChecked: KIHhssAuCUip265BtFvIRWligGXeMawyzUJdtNLeQAxa35VKezKAnYzMnVMMkPw8NkB8N7LM30Pp+dmAYdpABrK74htXJMFcRnxKpM5pw0ayZqoymRzcrS5ou9i9JZlSA1OFUBp0SqgrTMpaPILHoaW1pHRG0S6yGw9KHM6fAkFC/uodRBQe4MZlzyqSFhnxTNaMbCUZbDzSeuJa/9ujhENstE2SzSLeI6qtgoG9SvFOzJLw639J5ERQSzHx15GcAuYzx1ZqWZjs4rC4ixiBNuaRfIdPxzn5bdGOpPYNwZSgmN1+3XV5d0fzEJ4h/u+HoQeX86qmUDeTg8PyrYae8A== X-MS-Exchange-CrossTenant-Network-Message-Id: eab69f24-04e2-4a16-aa9a-08df4f8304ab X-MS-Exchange-CrossTenant-AuthSource: DS6PR11MB087165.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 08:13:44.8494 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y575pV725qOs/ATre22I2s7lOgdPVmaadWTvZDqWMhn+ocY/IpvpstMDEyvwWWe09SIcuZCprxzA4IGQWM+OPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: EAYPR11MB9970 X-OriginatorOrg: intel.com X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 01-12-2026 00:20, Karthik Poosa wrote: > Add kernel-doc for xe hwmon fan control and describe the fan control > model built around firmware stock tables and driver-managed user tables. > > Document the exposed sysfs files for fan speed, maximum speed, pwm > control, pwm mode selection, and per-point fan curve temperature/PWM > programming. > > This makes the hwmon fan control userspace interface easier to discover > and understand. > > Signed-off-by: Karthik Poosa > --- > > v2: > - Clarify the registration-time visibility requirements. > - Document how late binding affects existing fan attributes. > > v3: > - Document that curve files need a stock table and that tables > programmed by pwmN_enable modes 0 and 1 follow the curve rules. > - Document that a failed stock table refresh after late binding keeps > the previous table. > - Document -ENODATA reads when the fan control mode is not > established. > - Document that a failed completing curve write drops all staged > points. (Soham) > > drivers/gpu/drm/xe/xe_hwmon.c | 70 +++++++++++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c > index 4ee51cfc9283..70a4e4941390 100644 > --- a/drivers/gpu/drm/xe/xe_hwmon.c > +++ b/drivers/gpu/drm/xe/xe_hwmon.c > @@ -140,6 +140,76 @@ struct xe_hwmon_energy_info { > long accum_energy; > }; > > +/** > + * DOC: Xe fan control > + * > + * Xe fan control is exposed through the hwmon pwm and fan interfaces when the > + * platform advertises PCODE-backed fan management support. > + * > + * Attribute visibility is determined during hwmon registration. ``fanN_max`` > + * requires maximum fan speed data, while ``pwmN``, ``pwmN_enable`` and the > + * ``pwmN_auto_pointM_*`` curve files require a readable stock fan table. Late > + * binding refreshes cached data for existing fans but does not create > + * attributes that were hidden at registration. The stock table can change with > + * the late bound firmware; if a complete table cannot be read, the previous one > + * is kept. > + * > + * The implementation tracks two fan tables per fan: > + * > + * - A stock table read from firmware through PCODE. > + * - A user table cached in the driver and programmed back through PCODE. > + * > + * The pwmN_enable sysfs value selects how those tables are used: > + * > + * - 0 (``XE_FAN_PWM_FULL_SPEED``) programs the user table at 100 percent duty > + * cycle as a full-speed override. The cached user curve is kept. > + * - 1 (``XE_FAN_PWM_MANUAL_USER_TABLE``) enables the user table for manual > + * control. Without a cached user curve, it starts from the stock table. > + * - 2 (``XE_FAN_PWM_AUTO_STOCK_TABLE``) restores automatic control using the > + * stock firmware table. The cached user curve is kept for a later switch to > + * mode 1. > + * > + * Any table programmed by modes 0 and 1 must meet the curve rules below; > + * otherwise the mode switch fails with -EINVAL. > + * > + * The fan-control sysfs files are: > + * > + * - ``fanN_input`` reports the measured fan speed in RPM. > + * - ``fanN_max`` reports the maximum supported fan speed in RPM. > + * - ``pwmN`` reads or sets the manual PWM duty cycle in the hwmon 0..255 > + * range. > + * - ``pwmN_enable`` selects the mode described above. > + * - ``pwmN_auto_pointM_temp`` reports the temperature of point ``M`` of the > + * stock table in mode 2 or of the user table otherwise, in millidegrees > + * Celsius. Writes stage the user-table point. > + * - ``pwmN_auto_pointM_pwm`` reports the PWM value of point ``M`` of the same > + * table in the hwmon 0..255 range. Writes stage the user-table point. > + * > + * Writes to ``pwmN``, ``pwmN_auto_pointM_temp`` and ``pwmN_auto_pointM_pwm`` > + * are accepted only while ``pwmN_enable`` is 1; otherwise they fail with > + * -EINVAL. Firmware stores duty cycle in percent, so PWM values read back > + * rounded to the nearest percent step. Nonzero curve PWM writes are kept at > + * least 1 percent so rounding cannot turn them into an end marker. > + * > + * Writes to ``pwmN_auto_pointM_temp`` and ``pwmN_auto_pointM_pwm`` are staged > + * in the driver, so intermediate writes never reach firmware as a partial > + * curve. The staged curve is committed once points 1..K all have both a > + * temperature and a PWM value and either point K+1 is set to (0, 0) or K is > + * the last supported point. The (0, 0) end marker is not part of the curve. > + * A curve must have at least two points, temperature must increase and PWM > + * must not decrease from one point to the next; otherwise the completing write > + * fails with -EINVAL. A completing write that fails drops all staged points. > + * > + * Writes to ``pwmN`` replace the user table with a two-point table at a > + * constant duty cycle. > + * > + * If a user-table write is not accepted by firmware, the fan falls back to > + * mode 2 and the previously cached user curve is kept. If that fallback also > + * fails, the fan control mode is not established and reads of ``pwmN``, > + * ``pwmN_enable`` and ``pwmN_auto_pointM_*`` fail with -ENODATA until a mode > + * is written again. > + */ > + > /** > * enum xe_fan_pwm_enable_mode - fan PWM enable modes > */ LGTM Reviewed-by: Soham Purkait