Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp795863rwb; Thu, 19 Jan 2023 02:50:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRCgEHFlNMxuDC+pP1iGY489gjvsQ7muL1t9JJDQ8fFIK9rzB/sKgcKkxkkDoWXOXaFS5j X-Received: by 2002:a17:906:368f:b0:877:593a:58d0 with SMTP id a15-20020a170906368f00b00877593a58d0mr5802606ejc.29.1674125450590; Thu, 19 Jan 2023 02:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674125450; cv=none; d=google.com; s=arc-20160816; b=TWpA6z4ETQo0ICL9OOOLqE5jDWPyIub1ajOYgKf1LIYoDASLLzsnfF8O5/r0j+Q+wI jhwUuWLe4vx6tbBjq7Zez/mONZ/EMfMKxK8JUJRvnsNSmh5+/iqLw73xu2E0+uiddpck GY9bju2cWO7gJj4YszqJQcRgvVu8Z3O7Tpo+QwdGwEClX7ZADCwIDp0PIBgqZ0v46YKM JGPc/Pjw0iRTiZiGjNWaRAfUYoIewmWWIyg1GbWqBam8y9GRT/bDm15y3Y+UhUAnh+Az mPceQ2IZK6xikrFx1V2ztFz1S+I1Cpy4od4POVxgdUfEBcjiBOXDqlYpcsgBnw8dqCjf I/0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jhnJi4E9sVUGqGUkCWG7nWSX0QsmXM9XnP6ncuKyEHg=; b=x7IaXiYQY6nFAtHRQ8QYEL7QAvj9f4jU7yolACMCdlWsEwIK/2OB9AvQmSKo2FfnlH 8lpdBo2VfnCTJRpPzrMnDzFVZVTw+kPDHF2IJKOw1mhAyRHnt99gLZ0PTSpzdY2SN0m+ cFSPAUlXy8k9Vdm0X8/bRgr0HMRQb4XW28FoREYKAMYXnkrCbh1s/Lp6BRIh+/HRWHnV 1gAmi1sIiHOYN2BLkUCdWehbZYFB0Q7k246HPk0/WgeZ/wMDcHKCMWWSZK6tCKJf1apq DF5eWQIcZPJ2XQNeb1HEQoOodwG/53l/Z1MJVoQV2GJCRQuCS8xKIJUqMXYt5Pz+oWAZ dZdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O1+2E6RO; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd16-20020a1709076e1000b008776a7302edsi3059159ejc.898.2023.01.19.02.50.39; Thu, 19 Jan 2023 02:50:50 -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; dkim=pass header.i=@linaro.org header.s=google header.b=O1+2E6RO; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbjASJbN (ORCPT + 44 others); Thu, 19 Jan 2023 04:31:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbjASJao (ORCPT ); Thu, 19 Jan 2023 04:30:44 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AB766840F for ; Thu, 19 Jan 2023 01:30:41 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id l8so996891wms.3 for ; Thu, 19 Jan 2023 01:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jhnJi4E9sVUGqGUkCWG7nWSX0QsmXM9XnP6ncuKyEHg=; b=O1+2E6ROy3ivIGtDdoRnwXKd36Hq/Niu9lmsGsdB0LYqcgv/kU3gNm+AtviRK7tIcJ jytvFeN1D2wThPYDyiKmnI0ulomRVPjPU+8+YvD0YBKGb+icXkkVrCboVXZDzjedkVm/ U9XgrekTIG+c8YSlqFN/bucsactpMQxVM8hwxbFaRCUC+QZPXB9YeZU96W5Qp6YulHZS 77t/ZZpg5ZZyhNETEpeiAjS6f9dKS8GWPMaJI4YUi7JdM86MoWbUo1YY2oeGOjPHb4MK 5n0f5YVqRJWEJeqGOEOtV3i6wdFCB4wgdievYyvg7pWoKZdOl0DblPpUOnnpfLQ5ZMTI 8OhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jhnJi4E9sVUGqGUkCWG7nWSX0QsmXM9XnP6ncuKyEHg=; b=R+2VD0kZqBjBBD1sx9+cuta3NGO/0Uw4GwZBbqxGH2R5dQL+2O6g6Iuv4U7fAQpWAE Zfjyn1jvElOUjymsPtJ0kES1LrByPbNvWuAx9L6rwWcsjGRHSrBB4g6a8HaRha7uV4g8 TCBWNOq7t3uZdlCkjs3LwJhIWVnyOrWOsfmD2f5rM+70EPN2kbf9k8lyzJgb9i+mUR8a E/T2juw/UYF7h7w/Zz/tdmudyjH19ocBvfculqJoPJPD6q063RwOLs62o9Kz+OCtYFx+ 0DH0UNpxkiuuy2i2yF3vphOQstgWTRQZBWvsahJQVtTi9VResLQCyHdSfHGZOH2wzJdA HTAw== X-Gm-Message-State: AFqh2kqlazJaOK3/K7jBtNDYRwMT2I7wq7e4YrBg8vChShWSBrRRtr3G JTIH0aInIl8oC20Fa4jqGbbd2S/8Z6sNMu3W X-Received: by 2002:a05:600c:35c1:b0:3db:1424:e781 with SMTP id r1-20020a05600c35c100b003db1424e781mr4859886wmq.23.1674120639282; Thu, 19 Jan 2023 01:30:39 -0800 (PST) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id g9-20020a05600c310900b003c21ba7d7d6sm849700wmo.44.2023.01.19.01.30.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 01:30:38 -0800 (PST) Message-ID: Date: Thu, 19 Jan 2023 10:30:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 3/5] thermal/core: Remove unneeded mutex_destroy() Content-Language: en-US To: "Zhang, Rui" , "rafael@kernel.org" Cc: "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "amitk@kernel.org" References: <20230118211123.111493-1-daniel.lezcano@linaro.org> <20230118211123.111493-3-daniel.lezcano@linaro.org> <92a6e8494b92f0bb8cb36c98d2237ee3d347c358.camel@intel.com> From: Daniel Lezcano In-Reply-To: <92a6e8494b92f0bb8cb36c98d2237ee3d347c358.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 19/01/2023 08:41, Zhang, Rui wrote: > On Wed, 2023-01-18 at 22:11 +0100, Daniel Lezcano wrote: >> If the thermal framework fails to initialize, the mutex can be used >> by >> the different functions registering a thermal zone anyway. > > Hmm, even with no governors and unregistered thermal sysfs class? > > IMO, thermal APIs for registering a thermal_zone/cooling_device should > yield early if thermal_init fails. > For other APIs that relies on a valid > thermal_zone_device/thermal_cooling_device pointer, nothing needs to > be changed. > > what do you think? I think you are right. It would be nice if we can check if the thermal class is registered and bail out if not. But there is no function to check that AFAICS. Alternatively we can convert the thermal class static structure to a pointer and set it to NULL in case of error in thermal_init() ? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog