From patchwork Thu Jan 25 12:11:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13530723 X-Patchwork-Delegate: daniel.lezcano@linaro.org Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 58C94376E1 for ; Thu, 25 Jan 2024 12:11:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706184692; cv=none; b=p2AUZvlzWdJqPpURQ0WejL9Jg23nmW4IUkd4OF3EYz9ECK+G52PChCPOK5km6tlDgw6sEFW/FGEaL4IQaNIsBcbEjKxU4cEtbZ5G405n28+tnEnVHMOmFcFMkBubvAlMTBF58ABsUXY4jBkCAGxgTSbJrH2wLl2zGP3gdvTg7nw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706184692; c=relaxed/simple; bh=ZPr6E4c1CKD0WVJLVQoqbaMXnDZAUQSUX250E823OTc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DQ84SYCYTNKgArzFxiYYO3hxv46/wi1n2R3dPDEbzCw0w2D+fs69uyFRqxbmGDMtzrLcREjm3+ay8JZYR0q4ccGqfBZxz1FJixLW+fNXrEtb4w66D2IsV/d6oBt7zT2XuakY0lFlKIpxDA3cfx8oMF4VFT5bQOIaFGalaE1oGIg= 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=UvkP7mgH; arc=none smtp.client-ip=209.85.167.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UvkP7mgH" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-50eabd1c701so7643035e87.3 for ; Thu, 25 Jan 2024 04:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706184688; x=1706789488; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yB2oUZTJxFBXmfGYTP34odt/VQAw3YcB9sjxxvoA4rY=; b=UvkP7mgHpzs612whY5LImcD0LMgRQ756HnNzbWZKQ5QR8elIritTmOGJXmkMJHgSkn 5gaOkINnZyuZFuk2LyhdaQvGgDjUf9qs2jC3ZvI63txBVPbJWPkaQ/AqVBo7i/CMrthW RU5OdxpASB/pLMqZ5THWg8u0t2ajjO+n5HBfMsv1FaF/GFMt13bPMySUoEJOySqWqKXi IiM9hazFRIajMdRJcv5Fwalr0dq7tlFGsvfi1vaen9EdZIHLZbi2pRBmtq+0DExrg/mq GabOITeVrTHW8tOYOXySvYkjUMuzXEtogEB20v1JV1/1gz+tJqKEvRPNSKfDxup0CRsW ykrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706184688; x=1706789488; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yB2oUZTJxFBXmfGYTP34odt/VQAw3YcB9sjxxvoA4rY=; b=Iw7QuNXVNWwrDYP/rifwlFlQqaoa5nUy7FJY80aWWPeCpBkSEpWLHZARuI8eCSJ/Ux japLRHh2HaiifsBli+zu+pI15fxoosYcmA/4PN9EjWPvDr0DF7lLrknyjWWEBaiq/WVM ScziUOEogUTTKqJQd5xUeRvZucGyaDrpPmJY7yv1N2QrweIHubj66egVmHgGxW2zYALP hGYkdasHlPHz15ibnRXEXVKQuModl/ehVZRfRWomHTbnbawZQjwZxf0bZqv11kNOgfUJ ChW6ZMkf1Ick4UOiuyknBXzL+31SKlnx6hpb/ynDYbDLCan9M6BHb4zVuGIq9I9UvsSM TB7A== X-Gm-Message-State: AOJu0YxJ/hG8HE1lIIkC9oAn1KrJGbQNqDnb+70fkE4xNISDLStjnk7J KpNy92KSPSCwLqphM243Q1+lFvYMvET9OywZNQ6Lp5JY12DcNz0lrS+itEivSHA= X-Google-Smtp-Source: AGHT+IGJ9Ulfs3cW+fmPeCGH3QcncDosCorfFRPWC8zOqkEkU5iEvWfN4BRmkCwx0JY3N+ie1eIw6Q== X-Received: by 2002:a05:6512:ea0:b0:50e:a6f8:aacf with SMTP id bi32-20020a0565120ea000b0050ea6f8aacfmr820110lfb.14.1706184688088; Thu, 25 Jan 2024 04:11:28 -0800 (PST) Received: from [127.0.1.1] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id y20-20020a196414000000b005102188d154sm21221lfb.108.2024.01.25.04.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 04:11:27 -0800 (PST) From: Konrad Dybcio Date: Thu, 25 Jan 2024 13:11:15 +0100 Subject: [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240125-topic-thermal-v1-1-3c9d4dced138@linaro.org> References: <20240125-topic-thermal-v1-0-3c9d4dced138@linaro.org> In-Reply-To: <20240125-topic-thermal-v1-0-3c9d4dced138@linaro.org> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.13-dev-0438c Currently, thermal zones associated with providers that have interrupts for signaling hot/critical trips are required to set a polling-delay of 0 to indicate no polling. This feels a bit backwards. Assume 0 (no polling) when these properties are not defined. Signed-off-by: Konrad Dybcio Reviewed-by: Conor Dooley Reviewed-by: Bjorn Andersson --- Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml index dbd52620d293..68398e7e8655 100644 --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml @@ -228,8 +228,6 @@ patternProperties: additionalProperties: false required: - - polling-delay - - polling-delay-passive - thermal-sensors - trips From patchwork Thu Jan 25 12:11:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13530724 X-Patchwork-Delegate: daniel.lezcano@linaro.org Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 30D623FE3F for ; Thu, 25 Jan 2024 12:11:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706184692; cv=none; b=cbkTlxkVgH2zEogrIABCEEm4TKTWFnvhCWlkwFV8GpayKvFh5DU5r6ixA1D9FGG6sV5KYZeVeF77cZ5xu8O2SFAhwxQlM9sjHZpkFuuuDvWb0mBCrPHBigMWev21S35kJHgaNCddPkFcEfKtCz0tWtZNr+G89fjdOlCiyWgWvjU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706184692; c=relaxed/simple; bh=Xt7YAEyjkpAAOCyAkOs7IhbYyAxT097jjtamqFpBtpA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JFP0BBw34vYvbnAhaJlfFgGeZPJjZDV4L31swfpWqpCoVkgzjMOMqMwlj1Li9s0rKQ3bOiLnuzs0x22g/vapTrr2N/suEZQAExioIhGVEtOSXYCyji56oqCjq44/HfSefohMXiX6vJ+RkxpTDxkLF6pS6pTMhlFlPX+Tz9GcveM= 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=yOmUmARZ; arc=none smtp.client-ip=209.85.208.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yOmUmARZ" Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2cf3a04ea1cso5683231fa.2 for ; Thu, 25 Jan 2024 04:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706184689; x=1706789489; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=11ARpJ3LB2A44PAyJ/Y1XtoWgM3SgViyHp/Y/XmAtrI=; b=yOmUmARZHKSW5nylWfkw5suq5c1Wk/NCULog7IF5BQye7bv+vf/cB+pj0ELBN2v6eo RjR9ZTE1Eu4lGG+CvacZJq0OuTIEOXHU4JmylKDgTgUKTz30gx/DsqSkxE+Yg5r7cdz8 pHhpXYPYuNxPUjoVM73EzprucYoYoiVzid6n4qhP+uwvd2hHrBp1l9/hdTpgTKnM20+a QvpWOzvsLIkvhjkPrkhjTdmVIoIu+4YVp2jFoMFzcGHlEUA/Ckm3SXCweduWqv0ILpvi p6w3Usr1Ke3VCCYpnbbD/shBohGhisgIB3wDhcdYov2m3/gaXhnZjz1+CsD6WOa+3cDr pV2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706184689; x=1706789489; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=11ARpJ3LB2A44PAyJ/Y1XtoWgM3SgViyHp/Y/XmAtrI=; b=QzIpkQ3km2WlME6vk7DppQfzoFZyyZuLWs5+lQbdPkbCStYrk/lGPu8tN43EG0PYkN 8pFTgGdxU8pYdgCMWutpDsnFZClAJBQtuGWs2t3U/F5zXYs/vQsG4Xi34U6HlAuK3qXn xcedmenG9gH0Phxnp52eU0pjHyJDZv9jhWEpz9t4FkFZ+JYb6+4AdGgrwa45i6AJzh/3 Blc7Y8mrAREDq/XLroSE8an6FZBKttz9fRbO4VjuGs3ydItjaqNyGf1hJM+5KpFgYFjO ih01gUR9WYjgYDVTcTFFbSFnUwlkgtugSUfnU2OVEqyMiTlLTWZjzf3mgatpdIicUhli OCrA== X-Gm-Message-State: AOJu0YxKR1IhKPfOe/xl+p7nXdHTFU1X8G4BIJZ2o5i/0WtPensNnCmU JkMV32UiPRMqV5VT7bM6I4plRNnaLbXBUMQ8Yq2/xITeDGDk5Kxr+jer/i+ofmM= X-Google-Smtp-Source: AGHT+IHyBYcRLfSu7I+hi1BBRsoo2k4V4hrzHWdQQFe+plTYwSAodOBw82LZZh/KF4FP3oB3onjW+Q== X-Received: by 2002:a05:6512:3d09:b0:50e:e888:2c48 with SMTP id d9-20020a0565123d0900b0050ee8882c48mr690981lfv.22.1706184689285; Thu, 25 Jan 2024 04:11:29 -0800 (PST) Received: from [127.0.1.1] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id y20-20020a196414000000b005102188d154sm21221lfb.108.2024.01.25.04.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 04:11:29 -0800 (PST) From: Konrad Dybcio Date: Thu, 25 Jan 2024 13:11:16 +0100 Subject: [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240125-topic-thermal-v1-2-3c9d4dced138@linaro.org> References: <20240125-topic-thermal-v1-0-3c9d4dced138@linaro.org> In-Reply-To: <20240125-topic-thermal-v1-0-3c9d4dced138@linaro.org> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.13-dev-0438c Currently, thermal zones associated with providers that have interrupts for signaling hot/critical trips are required to set a polling-delay of 0 to indicate no polling. This feels a bit backwards. Change the code such that "no polling delay" also means "no polling". Suggested-by: Bjorn Andersson Signed-off-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov --- drivers/thermal/thermal_of.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 4d6c22e0ed85..61bbd42aa2cb 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -225,14 +225,18 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel int ret; ret = of_property_read_u32(np, "polling-delay-passive", pdelay); - if (ret < 0) { - pr_err("%pOFn: missing polling-delay-passive property\n", np); + if (ret == -EINVAL) { + *pdelay = 0; + } else if (ret < 0) { + pr_err("%pOFn: Couldn't get polling-delay-passive: %d\n", np, ret); return ret; } ret = of_property_read_u32(np, "polling-delay", delay); - if (ret < 0) { - pr_err("%pOFn: missing polling-delay property\n", np); + if (ret == -EINVAL) { + *delay = 0; + } else if (ret < 0) { + pr_err("%pOFn: Couldn't get polling-delay: %d\n", np, ret); return ret; }