Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp363866lqt; Thu, 6 Jun 2024 06:08:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQdwQ879XxSWOZ6Z9RoCC5nol8q6bD8ImnNWZLTNWvs3ZSfMDjIrMRBN+Sz7EDcdRe5Yig6Ll35aOxG/5FFE83Rn+U7xDV1dHqB3L+iw== X-Google-Smtp-Source: AGHT+IEbkfC8auPULiRl0K2cu8UgyrlkHld0MQJ6AsqFWPatmnuRZISuY9ybJgIF0tjVSVavkg8z X-Received: by 2002:a05:6830:1195:b0:6f0:7417:6833 with SMTP id 46e09a7af769-6f9437db138mr5178463a34.36.1717679321502; Thu, 06 Jun 2024 06:08:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717679321; cv=pass; d=google.com; s=arc-20160816; b=SQzGBURPZ2mMOMbt7dO6ieftVwV9i+E7kb4v/tC4IvMl7dDVrXihIlfz5ZiCoj8b6F W3VYUzIJe1/FtwMcL0muBl60P1wm25VKcXzmGgyYC0juLjgMZfHQEIDbpYNmvYxQWFmp Rlbk3Vf/VzFfu5eRxwB3zp/ibIDE5CNjHyOru01SVhI1+RrsCHVuL8h3jJrU+iOwxTCF alZCQdXCzUxcr+7xMe1oPetfCw0fj+gFEfXyyQdtm01pq5715yPVfoHQ2qpg5VzvC4Zf qtWxF3M1dhFjx3qNQApJQDHxI9g5xHu7NUDe2B9+mQMrpM5RP4EVhci8RX4bLoliqFyT e5NA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9xqbTDU5EddtC0TrVAfeU+ERNe8gfqyFv4sZpg6VCoU=; fh=WW6xKTgQb2vpzkUVsv/VsfD+zWgztV3PGJCfWR8pzdA=; b=HXlgbhm1LS8+RaGvIEGSPi3EtbO7uymu16xRw1VXlYZr82TR5dl6hn+4pgVHjl7P07 bYAgJnEfK9Wqyk0dx9hH9x71jYbqSdg/IfwTRySAoUNkY1JdpKgnyVoMnnCxbMMg/KV+ wxWO9CEEJDKB/fMq3KUwNSY/DQgNb5ZxxCEsM6aZdrwH/Ryk65Sg//hGtZ/ZiEBgcltQ lz6SIqev0wW/f0ft+ZtW8YQhGglLn/bDjzgS+r+ngkWerLi2g0uVTEzN3fFo8ipfw5gw EBIZWmKBEz6wqfH/9SaQ0gBgkNunPwHSV3N3NksBw1hhnA4h6fjPnmc5wc0NPim0F96a IcnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pxwKEkMC; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204319-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 46e09a7af769-6f94dc681e3si438846a34.32.2024.06.06.06.08.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:08:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204319-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pxwKEkMC; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204319-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AB8D8286A43 for ; Thu, 6 Jun 2024 13:07:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 953EE195F2E; Thu, 6 Jun 2024 13:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pxwKEkMC" Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 529CD194C99 for ; Thu, 6 Jun 2024 13:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679251; cv=none; b=ne9BS796UirFjIW1t2iMXF8r//clHjGE9hwm4OBBBaPDa3AYjU0mfSZ1nmc4pkP7WvUWtMyfNG1AOD2ksWHk0pHJc5JgRkR6V7B4DIyyzI39OmxQxl/FBJCx0nSDYNAQ1qAr8fBCMrA+xZ+B0+VSSHVbF65q6edfHc3t4AlXw+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679251; c=relaxed/simple; bh=BdMDCKYOciFtZo4PTTUMFab4UVUl6ecIp67QhNGiFxE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P/SfzIGzU4pK7o0m9fVCMAsoXxkpWBobWxnOvWqqRE+VJixlG4CG+3xyorz9CYMFgMrFYKBpnuy6IRe1D3GRDyij75ynEypik8s08dP7UiMB69oXRMiyjZl8XA8APYWnmXHk7X3bp8Ws5nEJTlcPwlIxhvLvDJ1vyByTcujT9Vc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=pxwKEkMC; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2e96f29884dso10099531fa.0 for ; Thu, 06 Jun 2024 06:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717679247; x=1718284047; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9xqbTDU5EddtC0TrVAfeU+ERNe8gfqyFv4sZpg6VCoU=; b=pxwKEkMCAXQ3w1PmZGCLFJPg73nrIiAPKJ09kyo49i0sr85KLCvLJ1iGVUpouQPxRK VtoYUCN/QXLqsdurv1iapN+4l6ku+A7trXHNZCu3LMfJhXstzUuj+pEbAA3gqaTnQ2L3 yAVINfg0dsSQzCuA+ep21dnQAjJmLgzdVd1f3W/LWMzCXplErGog/26QuCbai80e5mku kC7R7eJQNfDF5/w74oTXWwI9C9kE37U3apw+oFiG2ewAbScm2OVbzX5YuIsxFfxAZi/G Y4L5YASTKUKdITRxEc2NoBHqk87NfI4sa5b0OL68oA6J9wKMpJ7cA7yaZKPa5+eqeZSB CdVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679247; x=1718284047; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9xqbTDU5EddtC0TrVAfeU+ERNe8gfqyFv4sZpg6VCoU=; b=sF2Sn5JNPbq6up31vZcvF26CJkIfqPp6/TnTqmBkKnrylkI9enaCm462NucW3Z8dFg FHfgTn10N95cF+WQcUC3zAc3q7amyab7ebjCi4B8iSGg5kkcX6K+d1ICTXqzENx9O1LE cS7TT9kRZaIW+cNDoPk5++Cf60UjB/Dt9pSuoeSzJyyFkjHRj23VYoTkOR+DGiG7exuX Olm4gQJSxS8j+yuiM7t4cwGh9JlE1wI/LxEXsn+XBzHeg+K4hIBmhrpCmnKmov9IFl0a jAEqnNSLrGedeMKXAJ55C5X1WSC5ep8tOe8OlCnUwNbPu0/uaALMhlg+/k1VqpZ4sabA wo1Q== X-Forwarded-Encrypted: i=1; AJvYcCWZRoKctSBqXY1gD57YQuwOqcaPs78n4Gb6lJx7KY+IujDBmEkLz5tPphr2xRzN3ROoAapKiWwfQGMJlHJPzKOZv2p6hVd/uIipSefH X-Gm-Message-State: AOJu0Ywf1zTkgGVgq/aEFCVMUxYhiKanf61LSgJvd+xSUdfrTf0Tr2iF fu05TAQqs+B+Ss9N0pXKSMIir2VKge9W1ulfvJujxLzyFls9I2VM6PpBCK9NHtk= X-Received: by 2002:a2e:9c07:0:b0:2e9:8ac8:b0c4 with SMTP id 38308e7fff4ca-2eac7a6ed32mr28518321fa.49.1717679247427; Thu, 06 Jun 2024 06:07:27 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:f9a9:3740:b905:9995? ([2a05:6e02:1041:c10:f9a9:3740:b905:9995]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4215c19e67fsm21943435e9.2.2024.06.06.06.07.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jun 2024 06:07:26 -0700 (PDT) Message-ID: <5f93f034-f781-47e0-b8ce-3c8407a709f7@linaro.org> Date: Thu, 6 Jun 2024 15:07:26 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] thermal: core: Do not fail cdev registration because of invalid initial state To: "Rafael J. Wysocki" , Linux PM Cc: Linux ACPI , LKML , Lukasz Luba , Srinivas Pandruvada , Zhang Rui , Laura Nao References: <4569763.LvFx2qVVIh@kreacher> Content-Language: en-US From: Daniel Lezcano In-Reply-To: <4569763.LvFx2qVVIh@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 05/06/2024 21:17, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > It is reported that commit 31a0fa0019b0 ("thermal/debugfs: Pass cooling > device state to thermal_debug_cdev_add()") causes the ACPI fan driver > to fail probing on some systems which turns out to be due to the _FST > control method returning an invalid value until _FSL is first evaluated > for the given fan. If this happens, the .get_cur_state() cooling device > callback returns an error and __thermal_cooling_device_register() fails > as uses that callback after commit 31a0fa0019b0. > > Arguably, _FST should not return an inavlid value even if it is > evaluated before _FSL, so this may be regarded as a platform firmware > issue, but at the same time it is not a good enough reason for failing > the cooling device registration where the initial cooling device state > is only needed to initialize a thermal debug facility. > > Accordingly, modify __thermal_cooling_device_register() to pass a > negative state value to thermal_debug_cdev_add() instead of failing > if the initial .get_cur_state() callback invocation fails and adjust > the thermal debug code to ignore negative cooling device state values. > > Fixes: 31a0fa0019b0 ("thermal/debugfs: Pass cooling device state to thermal_debug_cdev_add()") > Closes: https://lore.kernel.org/linux-acpi/20240530153727.843378-1-laura.nao@collabora.com > Reported-by: Laura Nao > Tested-by: Laura Nao > Signed-off-by: Rafael J. Wysocki As it is a driver issue, it should be fixed in the driver, not in the core code. The resulting code logic in the core is trying to deal with bad driver behavior, it does not really seem appropriate. The core code has been clean up from the high friction it had with the legacy ACPI code. It would be nice to continue it this direction. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog