From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E1F5C54798 for ; Fri, 23 Feb 2024 19:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VZLVsnXfphkwBG6XPUPBBw0V0dJyrh7N7QVxbBiI0ug=; b=OAnrUC8ckGpRC9 Oig8ors9admJEF3Xn30QHHRay9cCBVZJz67Vv3HRIF00AX8L7kk+ovqUNjeFfVnXLQ8Ijhc3a2AVB Gcp/OJMKfsMK5SaMCJoNPEUKHs/kmGgrs9nweD9mMc2DAlraKCiSG0ouSJeZxSueYVlhihVWmIwSU t/3eIFHX2HsYp90ELGZQp8WJUQcHLgZo2rhUWz9Bx0OnRdAbxNwsCL7YbBPITOt20ENfQQLX8hBag YRfniWfsmIGF/WBSPrlZRennEdx2dIRsREMhviW9sQtenTYY2DFdphBgXrX3EgTpQf30wVbo5Be+z pmPoYntNo2Wom1oeozYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdbZn-0000000B4ql-41cM; Fri, 23 Feb 2024 19:51:19 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdbZl-0000000B4oM-1PCd for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 19:51:19 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a3e7f7b3d95so145188666b.3 for ; Fri, 23 Feb 2024 11:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708717875; x=1709322675; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0Xr6A5ZVcZDLJ7oaBlotk2t+V105HpiLWnU7g8aHJ7w=; b=ZaJ3DLCV5yT68pYEZKgpPrUq1lW09K91ltqrPpu5GVFc2lS4IYP3PHxkCSeFn/wK+A ++Ftr03+ObWfrmSED9MA7Y6/uIS9DdeNwww56pziumyp19HW1b60DH9N6PhNh3JGtUIW N7yfvBOiCOryVdev0/oiyMFllbj7Q66x7mLMlTamjsaLnyakbmxZvP5y6vt8Z+BCjWZx ugCzWjP+0UXs+ranLqeUJ5QnzC7LAf82GTKuAIwrjg7rd9WcPbqAX2PJfvcywy9d4Zkc 3zYjPBJn7znNzrv+w4qiMh9epqiiWQAPNWpJCTeJNWu8XAD/qjvM51Gteb/0gN98/VDA PLKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708717875; x=1709322675; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Xr6A5ZVcZDLJ7oaBlotk2t+V105HpiLWnU7g8aHJ7w=; b=M3R1eNVXerY/WyoBKQK4N7v9xQYZ1l/zAUE3hquIPZe2BAHOAhnG92Otlh3Cu2b0nQ ALZq2lB5mx95u89+sgUaioyFX8H9dTeCZh+XWiblekxKdlXYjxeXue6D9wk4kDAa1O+0 nxTevtBQ+n2KXhFwePAek+w4OZ7VJEtPpumxY33lQQOw/Zt5EmWYo+lJTCpwyAFaS5Fz a/45/KWg7Gzl6f+88Lmw+pE2jz2xTDf4Jp3m0VM6jfTR+pzoNxScATk4WVZH1K1fwQS9 ULN7aDPfCU0LxzrBxxsZyv4eY1Zh1EYPuKakkvC14a8B1i9XfVQJ/fM6U6NPYFQrABJc R17A== X-Forwarded-Encrypted: i=1; AJvYcCVm/gZ/3rnTvNlR2nTOhVeDBlVJVV9aTApirF19fXv6kM1gwADmDpZxRo/BIS/J50G9lUPcTsZYUVnuZg7yLdp3DFD0fIdkIWpo3oqV4W1MV6QoMXQ= X-Gm-Message-State: AOJu0YxKORR6aZI8T6EKvqCWy674KB0Xh9EMTCyuI3QQdBZ3OASMP7v0 43d2mc1+UEb6A9y2tFQ1Pmp8Du5frhH/veWOup2gMS/hXRmMFYsU X-Google-Smtp-Source: AGHT+IE19ctpcHeC8OGPK03xM0qf45C77WZ9HAydSzM8Dyn0bvmzXPAySicx9S20pEbJNSX2ZydiUw== X-Received: by 2002:a17:906:cd0f:b0:a41:3950:d11c with SMTP id oz15-20020a170906cd0f00b00a413950d11cmr547643ejb.28.1708717874903; Fri, 23 Feb 2024 11:51:14 -0800 (PST) Received: from jernej-laptop.localnet (86-58-6-171.dynamic.telemach.net. [86.58.6.171]) by smtp.gmail.com with ESMTPSA id tj9-20020a170907c24900b00a3ca56e9bcfsm7183967ejc.187.2024.02.23.11.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 11:51:13 -0800 (PST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Chen-Yu Tsai , Samuel Holland , Mark Brown Cc: Hugh Dickins , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Mark Brown Subject: Re: [PATCH v3] thermal/drivers/sun8i: Don't fail probe due to zone registration failure Date: Fri, 23 Feb 2024 20:51:12 +0100 Message-ID: <12383045.O9o76ZdvQC@jernej-laptop> In-Reply-To: <20240123-thermal-sun8i-registration-v3-1-3e5771b1bbdd@kernel.org> References: <20240123-thermal-sun8i-registration-v3-1-3e5771b1bbdd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240223_115117_462268_DDFD0ECD X-CRM114-Status: GOOD ( 33.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Daniel, Rafael, is there any issue with this patch? Can you apply it? Best regards, Jernej Dne sreda, 24. januar 2024 ob 00:33:07 CET je Mark Brown napisal(a): > Currently the sun8i thermal driver will fail to probe if any of the > thermal zones it is registering fails to register with the thermal core. > Since we currently do not define any trip points for the GPU thermal > zones on at least A64 or H5 this means that we have no thermal support > on these platforms: > > [ 1.698703] thermal_sys: Failed to find 'trips' node > [ 1.698707] thermal_sys: Failed to find trip points for thermal-sensor id=1 > > even though the main CPU thermal zone on both SoCs is fully configured. > This does not seem ideal, while we may not be able to use all the zones > it seems better to have those zones which are usable be operational. > Instead just carry on registering zones if we get any non-deferral > error, allowing use of those zones which are usable. > > This means that we also need to update the interrupt handler to not > attempt to notify the core for events on zones which we have not > registered, I didn't see an ability to mask individual interrupts and > I would expect that interrupts would still be indicated in the ISR even > if they were masked. > > Reviewed-by: Vasily Khoruzhick > Acked-by: Jernej Skrabec > Signed-off-by: Mark Brown > --- > Changes in v3: > - Rebase onto v6.8-rc1. > - Link to v2: https://lore.kernel.org/r/20230912-thermal-sun8i-registration-v2-1-077230107768@kernel.org > > Changes in v2: > - Rebase onto v6.6-rc1. > - Link to v1: https://lore.kernel.org/r/20230718-thermal-sun8i-registration-v1-1-c95b1b070340@kernel.org > --- > drivers/thermal/sun8i_thermal.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c > index 6a8e386dbc8d..c2a8ae7f8f2f 100644 > --- a/drivers/thermal/sun8i_thermal.c > +++ b/drivers/thermal/sun8i_thermal.c > @@ -188,6 +188,9 @@ static irqreturn_t sun8i_irq_thread(int irq, void *data) > int i; > > for_each_set_bit(i, &irq_bitmap, tmdev->chip->sensor_num) { > + /* We allow some zones to not register. */ > + if (IS_ERR(tmdev->sensor[i].tzd)) > + continue; > thermal_zone_device_update(tmdev->sensor[i].tzd, > THERMAL_EVENT_UNSPECIFIED); > } > @@ -465,8 +468,17 @@ static int sun8i_ths_register(struct ths_device *tmdev) > i, > &tmdev->sensor[i], > &ths_ops); > - if (IS_ERR(tmdev->sensor[i].tzd)) > - return PTR_ERR(tmdev->sensor[i].tzd); > + > + /* > + * If an individual zone fails to register for reasons > + * other than probe deferral (eg, a bad DT) then carry > + * on, other zones might register successfully. > + */ > + if (IS_ERR(tmdev->sensor[i].tzd)) { > + if (PTR_ERR(tmdev->sensor[i].tzd) == -EPROBE_DEFER) > + return PTR_ERR(tmdev->sensor[i].tzd); > + continue; > + } > > devm_thermal_add_hwmon_sysfs(tmdev->dev, tmdev->sensor[i].tzd); > } > > --- > base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d > change-id: 20230718-thermal-sun8i-registration-df3a136ccafa > > Best regards, > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel