From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D60615B12A; Wed, 3 Apr 2024 17:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164719; cv=none; b=c84EY4xr2TV8XhKtvv2A8Y268WB21hSK2PwqgN6D7eckI9aGmw2i66jOZad1TyQ5gxD8g1dYn66mhr/VuxOf01rqpe9+gvx8u7XMmr9/vuhcl/szkgPo/N0YxYK7V0aOnIUOryJqi0/Y+mGNaS2kcA0a++9Z5RYTrwRrH7FhU8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712164719; c=relaxed/simple; bh=yzC+JZhmJqa/ti57dXkE6VO8RengwTz78QgN6A8pHNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rvp75lxwA4N9nbq0M+8WT/uhITykU1mcTyG9+/K5emtF3I+iFdMgvirsfRiqxT5Ir+OXgQR4M/dqoB5+FM/qUUwZaGtqA3a4thbps+A0tEMFlclyPFV+z1yu184SoX60vJFanjcEJ/eLOhxpDSIN5t9e/VyBryj7al14BU7Ambc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eRGv7/sR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eRGv7/sR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABF00C433A6; Wed, 3 Apr 2024 17:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712164718; bh=yzC+JZhmJqa/ti57dXkE6VO8RengwTz78QgN6A8pHNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eRGv7/sR74w5tFWoezIIuEtf97AYsDRndfgM4lWbz1VljhjfhVM1ScutpXRXz5mDm uNmC7cyOh3MR65PYwrOOzLTtcJKD2J4FjPUa7nfLl+S8G6h4t02pc/GhCLiErxlvH1 Vu5TNPtW7vSd/EeYZk9+LDeP7n3UOwA8XVX80kkCFnjPYQW0tWMgUIpKxV2ORyhy88 dJihi2wT8gejDjXpFyJQ5tjfU0lHNBORiHjB8z8236Ko8NNZIp1j07FXLbqeWIQYvv XFpGis9GIzWjm6DXVcdbyMVHwAK9swOGWIPhU11O9eA5wjqPRv4t/H1HwFjHPj6b09 vSrO/Xge0nuRg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konrad Dybcio , Bjorn Andersson , Dmitry Baryshkov , Daniel Lezcano , Sasha Levin , rafael@kernel.org, linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 11/20] thermal/of: Assume polling-delay(-passive) 0 when absent Date: Wed, 3 Apr 2024 13:17:52 -0400 Message-ID: <20240403171815.342668-11-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240403171815.342668-1-sashal@kernel.org> References: <20240403171815.342668-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.24 Content-Transfer-Encoding: 8bit From: Konrad Dybcio [ Upstream commit 488164006a281986d95abbc4b26e340c19c4c85b ] 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: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20240125-topic-thermal-v1-2-3c9d4dced138@linaro.org Signed-off-by: Sasha Levin --- 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 1e0655b63259f..d5174f11b91c2 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; } -- 2.43.0