From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E4364CE66A; Tue, 15 Sep 2026 19:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789500325; cv=none; b=aPpY5iM0g3YcKadmsrIxQU4/Lmh7MsxihA6dYR+DNT59Y2ZVxpgHQ3Rq3I8g+bfr6eqXbePOT0QBL5Vqk+m1CJdIDCGG/Sz3EMWhijtwzsoDcETGzjR98X1MVRb2H1thAv3uipx+J9xamPXDUigeEgW3CTLRbWe6JPsQAK8uhTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789500325; c=relaxed/simple; bh=wSWL7biVBvzK7BJ/753cBEKcMB0azvZH12D3W7WWFCk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Q6mx2tvqpC6C1JKL+OjzxBDEsWyH2tff4/VPdqWHQ02IJq5OiCw3ebQqLbC2E1khWPIB2nNmcBRiMzWbj9kEt2bGrDKzIIFrG8tIIKTSjidgfoesIyHryITVft3saLr5s/TRRZxc+vhuIXdkP303/A61zqkOg4n5Jhrn/VDuGDs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=SK+iVnqL; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="SK+iVnqL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1789500311; x=1790105111; i=w_armin@gmx.de; bh=BBkYGmi94I4D7FYZrnZnY+yxsH4qY8YyvYy557xoJr0=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=SK+iVnqLyhnVYWWmTALCfIXOGvjeKPamEqIFd7Sh2DbsUzIknPprsZE4oWd+y0be wbfy8R8yJrNi1gpTmnT+/UNwnv75Yr6UiSZ7a0PuOfo6BCsLjhM9Qre7uSEuZ+t5q gOjR6pS1rc7puVvcqQDHB4yi8mdf8vzVRqhHjpSAk184tX45YLJkhhbLM2wL67+dE jp64gxP9cx1ZbckWJ/YOFNQpD+PKnF6dpwFMP5TNkxy4C0/3vu7aswdIH6vYckwEi CjInmWoGgxRsgc59eJCLKZEKt30wxyPXlsUjspIIUdpApB9QN2l4AENRUAwNTTt60 G0BzBlHnfrQWDoa63w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from client.hidden.invalid by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M7K3i-1x9q1q3HGG-005ZX9; Tue, 15 Sep 2026 21:25:10 +0200 Message-ID: Date: Tue, 15 Sep 2026 21:25:09 +0200 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 03/10] thermal: core: Introduce thermal_cooling_device_create() To: "Rafael J. Wysocki (Intel)" Cc: Linux ACPI , Andy Shevchenko , Daniel Lezcano , Hans de Goede , LKML , Linux PM , Lukasz Luba References: <1965933.tdWV9SEqCh@rafael.j.wysocki> <8729484.T7Z3S40VBb@rafael.j.wysocki> <7ef819c3-5155-48fb-828a-48d9bd72e54b@gmx.de> Content-Language: en-US From: Armin Wolf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:dMrPfxTcse46cCbIvTJUwOIait7UkA4stBVGO9ThVblDyA6DJvO 78vBz6406xmLI0t8ANq7M/yACZQGK4F9mxmkwjktYL4H/vfmmZw74iNQupofugVuqqGqA2l 193XiI45wsDl7B3x0kLUAOlpWvuQCi7fQPBgo6WKjGMvSsKWIUJLw64emd9iSB5vbrBxDiW Sk9cO6WycL6bhBv3cf9AQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:laYf/41f5YE=;3Fwlziv54Sj+fFA1lfyYKzG20Ox z/3DEq+CUZ6zwQfjJAtA4Ug/MjV4sJUQc1OjAFdMFafqd1XU6esiydfvahgudNKYrWocGHFOp sswKeK1klWwwfnjjKRntXB6GAcDIPVBsoroP+3y68WnY1zLewJUwqZlq2Ony2Awj9h1ppUe0J cBX7M3moePj/+DShxBrRKhpV1DiOG8KkQaYeFprqeAt9Z3A7+TXqW0anseQUaepU0Sa6iZao5 fC+UKCTLpPteQlCFC0LYzQUcH16IOZNqk+8gr50oVUXvDAbwBfaV5AWR0v/EDcPeXN/wRxB1I b470iWc64P4s1KapIOKqcJY5m6DZIZl7PV1h2Em5EWOmX1myLCMJXw/x2YqXelCCdlBYdCdtF 0FMHQQnDmA+ZkuW2DD+FDBCeQk70AeZlpJOkzmWW+expvWmrN2lNJoLlZWW3Z2ksO0pbZZYtT VOVMd/raLP2m8A9gVqkMxU/MRY6QILyiCdofMOeVg5Yagl7ChaDH4ymNEOY/LisVih0FMN97P 1YmkUlfC8j84Ib6H6/a65l7nLsrvFDfOinbsP/F8fyw34pNZy4Il8R7MCjPSGLIV+s4ia9Go9 BXsyRu3k2vtQFfBWgJYpKcI4H4+fY2s5VJ0KfecKIB7C7utNssi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iC2bXiSKxYrN4q3HwmfnQfttQ5FNSof7zdwP5DgsEMx2v8xK3eHPo kKyMdYMrDpaABvzSD+tOJTUBllHXCCfuhzwA78SY1grYzSWt7WHrkmDKwmXoSlwaHOJmqENot E13jkdi6RVhnrapD3rvgDhNjQHXF++oQj2UAHFVLlJG80bE0DPIyE1PKIhyVSRFAOMELHLkwD BDXkh7m/tBki2NP3FBFTp4itNV9bPMA9OLkrUGDQTQTpKPCWXJSu+P3jaVPWxpBNnFa2nRpil Aw67Zhav6aOyKHZ+rI/qFU7X7qsZ98kOOfXxH+c48gSZAifPfAlgo4U0ClpzjIejcivaOlVTJ 7T8FNmkhnnmto9rePG8gZwVydLhv3TGvztU5VH2DpJV2twxqfFnvVv6PoZy9k5BAE3moGpCYD UNZYBJJhDkZDx Am 14.09.26 um 12:18 schrieb Rafael J. Wysocki (Intel): > On Fri, Sep 11, 2026 at 11:04=E2=80=AFPM Armin Wolf wro= te: >> Am 11.09.26 um 15:02 schrieb Rafael J. Wysocki: >> >>> From: "Rafael J. Wysocki" >>> >>> Currently, thermal cooling devices have no parents, but it would be >>> generally useful to be able to create them under specific parents in >>> the device hierarchy (for instance, it may help to identify the device >>> representing the actual cooling hardware). >>> >>> To make that possible, add thermal_cooling_device_create() that will >>> work like thermal_cooling_device_register() except that it will take >>> an additional parent argument (which may be NULL). >>> >>> Redefine thermal_cooling_device_register() as a static inline wrapper >>> around thermal_cooling_device_create(). >> Hi, >> >> i like your idea with the new registration function, this gives us more= time >> for migrating the other drivers. Should we mark the original function a= s >> deprecated? > Well, it's not a big deal if somebody uses it in new code IMV. Ok. >> For the patch itself: >> >> Reviewed-by: Armin Wolf > Thank you (and thanks for all the reviews)! > >>> Signed-off-by: Rafael J. Wysocki >>> --- >>> drivers/thermal/thermal_core.c | 28 ++++++++++++++++------------ >>> drivers/thermal/thermal_core.h | 3 ++- >>> drivers/thermal/thermal_of.c | 2 +- >>> include/linux/thermal.h | 19 ++++++++++++++----- >>> 4 files changed, 33 insertions(+), 19 deletions(-) >>> >>> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_= core.c >>> index 82e2f0d8a26d..ac928c199829 100644 >>> --- a/drivers/thermal/thermal_core.c >>> +++ b/drivers/thermal/thermal_core.c >>> @@ -1005,7 +1005,8 @@ thermal_cooling_device_alloc(const char *type, c= onst struct thermal_cooling_devi >>> return ERR_PTR(ret); >>> } >>> >>> -int thermal_cooling_device_add(struct thermal_cooling_device *cdev, v= oid *devdata) >>> +int thermal_cooling_device_add(struct thermal_cooling_device *cdev, >>> + struct device *parent, void *devdata) >>> { >>> unsigned long current_state; >>> int ret; >>> @@ -1013,6 +1014,7 @@ int thermal_cooling_device_add(struct thermal_co= oling_device *cdev, void *devdat >>> mutex_init(&cdev->lock); >>> INIT_LIST_HEAD(&cdev->thermal_instances); >>> cdev->updated =3D false; >>> + cdev->device.parent =3D parent; >>> cdev->device.class =3D &thermal_class; >>> cdev->device.release =3D thermal_cdev_release; >>> device_initialize(&cdev->device); >>> @@ -1062,21 +1064,23 @@ int thermal_cooling_device_add(struct thermal_= cooling_device *cdev, void *devdat >>> } >>> >>> /** >>> - * thermal_cooling_device_register() - register a new thermal cooling= device >>> + * thermal_cooling_device_create() - register a new thermal cooling d= evice >>> + * @parent: parent device (optional). >>> * @type: the thermal cooling device type. >>> * @devdata: device private data. >>> * @ops: standard thermal cooling devices callbacks. >>> * >>> - * This interface function adds a new thermal cooling device (fan/pro= cessor/...) >>> - * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to = bind itself >>> - * to all the thermal zone devices registered at the same time. >>> + * Allocate and register a new thermal cooling device under the given= parent (if >>> + * not NULL) and with the given type, device data, and operations. D= uring the >>> + * registration, it will be matched against all of the registered the= rmal zones >>> + * and it will be bound to the matching ones. >>> * >>> - * Return: a pointer to the created struct thermal_cooling_device or = an >>> - * ERR_PTR. Caller must check return value with IS_ERR*() helpers. >>> + * Return: A pointer to the created struct thermal_cooling_device or = an ERR_PTR. >>> + * Callers must use IS_ERR*() helpers to check the return value. >>> */ >>> -struct thermal_cooling_device * >>> -thermal_cooling_device_register(const char *type, void *devdata, >>> - const struct thermal_cooling_device_ops = *ops) >>> +struct thermal_cooling_device *thermal_cooling_device_create( >>> + struct device *parent, const char *type, void *d= evdata, >>> + const struct thermal_cooling_device_ops *ops) >>> { >>> struct thermal_cooling_device *cdev; >>> int ret; >>> @@ -1085,13 +1089,13 @@ thermal_cooling_device_register(const char *ty= pe, void *devdata, >>> if (IS_ERR(cdev)) >>> return cdev; >>> >>> - ret =3D thermal_cooling_device_add(cdev, devdata); >>> + ret =3D thermal_cooling_device_add(cdev, parent, devdata); >>> if (ret) >>> return ERR_PTR(ret); >>> >>> return cdev; >>> } >>> -EXPORT_SYMBOL_GPL(thermal_cooling_device_register); >>> +EXPORT_SYMBOL_GPL(thermal_cooling_device_create); >>> >>> static void thermal_cooling_device_release(void *data) >>> { >>> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_= core.h >>> index e98b0aa5aacc..7ef7c6cab437 100644 >>> --- a/drivers/thermal/thermal_core.h >>> +++ b/drivers/thermal/thermal_core.h >>> @@ -270,7 +270,8 @@ void thermal_governor_update_tz(struct thermal_zon= e_device *tz, >>> struct thermal_cooling_device * >>> thermal_cooling_device_alloc(const char *type, const struct thermal= _cooling_device_ops *ops); >>> >>> -int thermal_cooling_device_add(struct thermal_cooling_device *cdev, v= oid *devdata); >>> +int thermal_cooling_device_add(struct thermal_cooling_device *cdev, >>> + struct device *parent, void *devdata); >>> >>> /* Helpers */ >>> #define for_each_trip_desc(__tz, __td) \ >>> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of= .c >>> index 0217a49b08ae..14dfac9359b8 100644 >>> --- a/drivers/thermal/thermal_of.c >>> +++ b/drivers/thermal/thermal_of.c >>> @@ -561,7 +561,7 @@ thermal_of_cooling_device_register(struct device_n= ode *np, u32 cdev_id, >>> cdev->np =3D np; >>> cdev->cdev_id =3D cdev_id; >>> >>> - ret =3D thermal_cooling_device_add(cdev, devdata); >>> + ret =3D thermal_cooling_device_add(cdev, NULL, devdata); >>> if (ret) >>> return ERR_PTR(ret); >>> >>> diff --git a/include/linux/thermal.h b/include/linux/thermal.h >>> index 083b4f533933..306ad17aed89 100644 >>> --- a/include/linux/thermal.h >>> +++ b/include/linux/thermal.h >>> @@ -293,8 +293,9 @@ struct device *thermal_zone_device(struct thermal_= zone_device *tzd); >>> void thermal_zone_device_update(struct thermal_zone_device *, >>> enum thermal_notify_event); >>> >>> -struct thermal_cooling_device *thermal_cooling_device_register(const = char *, >>> - void *, const struct thermal_cooling_device_ops *); >>> +struct thermal_cooling_device *thermal_cooling_device_create( >>> + struct device *parent, const char *type, void *d= evdata, >>> + const struct thermal_cooling_device_ops *ops); >>> >>> struct thermal_cooling_device * >>> devm_thermal_cooling_device_register(struct device *dev, const char= *type, void *devdata, >>> @@ -340,9 +341,9 @@ static inline void thermal_zone_device_update(stru= ct thermal_zone_device *tz, >>> enum thermal_notify_event= event) >>> { } >>> >>> -static inline struct thermal_cooling_device * >>> -thermal_cooling_device_register(const char *type, void *devdata, >>> - const struct thermal_cooling_device_ops *ops) >>> +static inline struct thermal_cooling_device *thermal_cooling_device_c= reate( >>> + struct device *parent, const char *type, void *d= evdata, >>> + const struct thermal_cooling_device_ops *ops) >>> { return ERR_PTR(-ENODEV); } >>> >>> static inline struct thermal_cooling_device * >>> @@ -391,4 +392,12 @@ static inline void thermal_pm_prepare(void) {} >>> static inline void thermal_pm_complete(void) {} >>> #endif /* CONFIG_THERMAL */ >>> >>> +static inline struct thermal_cooling_device *thermal_cooling_device_r= egister( >>> + const char *type, void *devdata, >>> + const struct thermal_cooling_device_ops = *ops) >>> +{ >>> + return thermal_cooling_device_create(NULL, type, devdata, ops); >>> +} >>> + >>> + >>> #endif /* __THERMAL_H__ */