[v1,0/2] driver core/thermal: Fail registration of thermal object when thermal_class is not registered
Message ID | 5905717.lOV4Wx5bFT@kreacher |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp394089wrn; Fri, 20 Jan 2023 11:51:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXv6yQGOfR0T30ipOLLMsfja/o7VFpeNM0DtxU6Brhf0uh3TtNqVMEC7EEU0YUABVK3GLDgh X-Received: by 2002:a05:6402:10c9:b0:49d:a87f:ba78 with SMTP id p9-20020a05640210c900b0049da87fba78mr16167464edu.35.1674244295245; Fri, 20 Jan 2023 11:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674244295; cv=none; d=google.com; s=arc-20160816; b=pyV0ehgBR48+9pPgzRwpygfpCcCYAj2Ux4P15K/z52Os2O0ovulgvhHEit0NJhzoKn iChFnKUrVZfqkT573LS1bDDIXIH/XyPcnEtzgC7EV3EqW7IriB/Zhjs02yZVHUHBKbjL WXomhu7xNZ3QbV05AHRbZs9wT8++25uyq9Kjsn4PJ4e+qA9w3DD+T5ZhHAj7TXvrP38M QinTbn2zs69ZKROdy37umORfDxtnUTHBWyaPUEdcASygj+3w8vyzm+S+YqoYkqB/ObAn lP8nhwlNGD1P7n4tkG3RFHNNyfZpKoG6Eb1986wVmUN3DHjoJFl7Nk6GQzDXhE6yIMA2 ig2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GX04MSGsgNhsVZr6Ze3VC7DYU7ePdFRAOShaNbmlehg=; b=n1xh1Plxvrqd1/J0+sPHXUUukARUWj+4VogJ/8YQKUocbmkDdaH/D1jMrZXx+tlk53 s3wPi1dNY4ytFW97xW/laUyOcMiXUNxr+AzFFMtJXUZP6PWnducK0D7drgi2Cw/lghZO inUqEuW9MrDmXAW1iFoiNgvesfpigbjz6mhXiTn62Mod+hABr4tU/jRA4DyNn5m3BdS1 rHcDV+8OkH6/+zpkNfR/AGrndTNzE4QQ6FwE0BmHGG/ExCcRfNyz5rtgGYwlEhltxeOF pZRWaMtZObcUsN6t14ujI/fowAQqzLtpgSJaw22FWVC64h6Y4H24RmyTZmxZw439sT0G wkoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a05640251d300b00485220caa05si53751870edd.597.2023.01.20.11.51.11; Fri, 20 Jan 2023 11:51:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbjATTtB (ORCPT <rfc822;forouhar.linux@gmail.com> + 99 others); Fri, 20 Jan 2023 14:49:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbjATTsn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Jan 2023 14:48:43 -0500 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8B7ABB96; Fri, 20 Jan 2023 11:48:35 -0800 (PST) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id 09fbaefc78dc5128; Fri, 20 Jan 2023 20:48:33 +0100 Received: from kreacher.localnet (unknown [213.134.183.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 26BDD23101AB; Fri, 20 Jan 2023 20:48:33 +0100 (CET) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Linux PM <linux-pm@vger.kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: LKML <linux-kernel@vger.kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>, Zhang Rui <rui.zhang@intel.com> Subject: [PATCH v1 0/2] driver core/thermal: Fail registration of thermal object when thermal_class is not registered Date: Fri, 20 Jan 2023 20:45:09 +0100 Message-ID: <5905717.lOV4Wx5bFT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.183.98 X-CLIENT-HOSTNAME: 213.134.183.98 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrudduvddgudefvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepvddufedrudefgedrudekfedrleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekfedrleekpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgt phhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755572386189316057?= X-GMAIL-MSGID: =?utf-8?q?1755572386189316057?= |
Series |
driver core/thermal: Fail registration of thermal object when thermal_class is not registered
|
|
Message
Rafael J. Wysocki
Jan. 20, 2023, 7:45 p.m. UTC
Hi All, If thermal_class is not registered, the whole thermal framework is basically unusable, because the governors are not there and its sysfs interface is not present. In that case it doesn't make sense to register thermal zones and cooling devices, because they cannot be used as expected anyway, so make it possible to fail the registration of these things if the registration of thermal_class has failed. To that end, make sure that the private pointer of a class is NULL when that class is not registered with the driver core (patch [1/2]). Next, make the thermal framework check the value of the thermal_class' private pointer against NULL and fail the registration of thermal zones and cooling devices when it is NULL (patch [2/2]). Thanks!