Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp511880rwd; Wed, 14 Jun 2023 20:36:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HrEI8UNM52hDxn66xtdOjVypsKHT8Y/l8g7SlmeG2xs8UUocYg+1dU+cij9MCen8qrPdf X-Received: by 2002:a2e:740c:0:b0:2b2:bae:abe9 with SMTP id p12-20020a2e740c000000b002b20baeabe9mr8893160ljc.12.1686800191754; Wed, 14 Jun 2023 20:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686800191; cv=none; d=google.com; s=arc-20160816; b=K2IVXffUqp7LhliR1L/hLnSnO5TdYMQZs4ZwIV54czITgcZTx+1kDCX8sTTLhlPvQl +3G6RhoTbf4Dd7CtaEoQAl21Q3+EJmoSTPnr9XRPP1k+dmux8v0dTPSDXHv31ZilKI/r R9GzJM0VkMUdp9aAF8wSpibOeyWWabf9K5Y2vt/aOkiLtCOV+ovLHqwYCrOII/NhvMuL t+vaTtNPmSQ5mx1NWNJZa0kRWLxzThGsjZBy1ORjyycwHrzQQYHQjwGIQa/6KF41+9mW cvX8bAeCKyYD6vBOLDKfjQqopCcnjkMHgrOcAjImvA2fX5g7E2sEyDlkHiwfMOaVF/kr Cxgw== 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 :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=K1L2UIJezURb9dMud1smAlqvvulrvHUQRCDpUaH0+N4=; b=BYZkbT7oOIv4sWmqvf35g5Zm6qLR1PUwadQDxkis5v8/m9MHLerm/qLAEpHi/NGRjJ z3VKGd1Fz++N4IfvTveUyoGNZswjgQb8SfU3OwoII7wVR6JZaPjx7AADXknxHllGTfud Xa9fTwCQR/bqAnCTUkn44eDdycNWdb0FVhLbvGVTxbjoTQaZK62tEumiSBU4/D/VYLf8 ik5wmHScbtHkeSQpGPqiTceSUaxHRL/WyzuTNNspLPUyksjAFyexy3WS3bZAb+8sdRxk rq4yR1sSVABMHjDSmMvykyealHuIrQ46gX02RluBy6POLCqqs4ob5iI3J+NbQ/eC9SeZ kAqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@puri.sm header.s=comms header.b=JEsa9H0h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a05640207ca00b0050bc806ca61si5233119edy.573.2023.06.14.20.36.07; Wed, 14 Jun 2023 20:36:31 -0700 (PDT) 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; dkim=pass header.i=@puri.sm header.s=comms header.b=JEsa9H0h; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238767AbjFOCxc (ORCPT + 99 others); Wed, 14 Jun 2023 22:53:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242470AbjFOCxa (ORCPT ); Wed, 14 Jun 2023 22:53:30 -0400 Received: from comms.puri.sm (comms.puri.sm [159.203.221.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5617226B1; Wed, 14 Jun 2023 19:53:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id DA1D6ECD8E; Wed, 14 Jun 2023 19:53:27 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1TuKSNZEzzml; Wed, 14 Jun 2023 19:53:27 -0700 (PDT) From: Sebastian Krzyszkowiak DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=puri.sm; s=comms; t=1686797607; bh=W6yGQPaKblXM6pB5IEmuGlSyN4iL12QpXtqEw0PdKVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEsa9H0hkL1veqdXruONDggfIJB7rY2gXThff1FpaS71jzXtY3dcIvZ8NNCvewIkd 5gTe2UN11dC257p7AINUDKZqP02lW7PZwd2wkxYLHNQOEOWi4WQ4taKJFMjGKNXCmw Da0IsCerX894BVP3rYuYEJcA7rpgFpG9diWKDaDqQ7E1ql6ryzHOeQICElTlLpIAek 31o0bMxAgn2S9q55GBYE9JbeAWmzvqoiqT1jGXYQkrSN7P4CFG5K/7ER/+TbVyjqor dE+BIOuwYyb74kojIvdKnkNDRt3xancNmi8yTMXtf7obEQo/PTcV1yGhutBYoY+DDw ZXFJt4xw7UdXQ== To: Daniel Lezcano , Peng Fan , "rafael@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , Peng Fan Cc: "amitk@kernel.org" , "rui.zhang@intel.com" , "andrew.smirnov@gmail.com" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , Alice Guo Subject: Re: [PATCH 2/3] thermal: qoriq_thermal: only enable supported sensors Date: Thu, 15 Jun 2023 04:53:17 +0200 Message-ID: <4844567.31r3eYUQgx@pliszka> In-Reply-To: <2e57d14a-214e-c3e0-e011-e804ce8c9b39@oss.nxp.com> References: <20230516083746.63436-1-peng.fan@oss.nxp.com> <507b5daa-73e7-8d21-4f73-c56f88c6bf77@linaro.org> <2e57d14a-214e-c3e0-e011-e804ce8c9b39@oss.nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On czwartek, 15 czerwca 2023 04:29:01 CEST Peng Fan wrote: > On 6/8/2023 3:10 AM, Daniel Lezcano wrote: > > > > [...] > > > > Ok, I misunderstood. I thought that was for failing registered thermal > > zone. > > > > Would enabling the site in ops->change_mode do the trick ? > > No. ops->change_mode not able to do the trick. > > devm_thermal_of_zone_register->thermal_zone_device_enable > ->thermal_zone_device_set_mode->__thermal_zone_device_update.part.0 > ->__thermal_zone_get_temp > > The thermal_zone_device_set_mode will call change_mode, if return > fail here, the thermal zone will fail to be registered. > > Thanks, > Peng. I think the idea is not to return a failure in ops->change_mode, but to move enabling the site in REGS_TMR/REGS_V2_TMSR register from qoriq_tmu_register_tmu_zone to ops->change_mode. This way the site will be enabled only for actually existing thermal zones, since those not described in the device tree won't reach thermal_zone_device_enable. S.