Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp139732lqe; Thu, 4 Apr 2024 02:03:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWB/9YrVOzniDC1ltbCM1+nIo2H8oujDIv931WZFu8202SF0Ha42T0Y2kiPQGMYrvzoGARD8hprFuW8gyrF0WlzhIr3FgIVEepF/QwMaQ== X-Google-Smtp-Source: AGHT+IF9kXn30l9dnt84XK/a78vPamtU2ZoSSFzhbKF6jWSuKz5nWDDSzuok1JXq6g3D80neozyO X-Received: by 2002:a67:ef90:0:b0:478:5e07:939c with SMTP id r16-20020a67ef90000000b004785e07939cmr1746305vsp.5.1712221432480; Thu, 04 Apr 2024 02:03:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712221432; cv=pass; d=google.com; s=arc-20160816; b=j9XNFNttwrkCh+cyRDWB+N3duVWiSwzWenrRYXrjII2iWwwsCq1hwCCCSY4QdNPtos khabD4hdIFbG1umZOUwY7KQOtnPBN3NwPHresibmSZdosERk2h7jHf8nhC4UikvBmWu3 mZQsOmalnlQWmLF1wL0JcCROZJeS5j2uKqLDwvD4c/GREinzkKIn6Lt7D811zkHZj9j5 VLcnUZ+ziXC30pK65BeEFIfKYQ4FU2ToB/YT1tARwcuRE4O32DWiLzghOX+rRkXI3sma LHAeArMH99i9+GJvpndiKAcxGEWyVhR5Duy1loH/4L5SD1CWZ3jpz8edVG0/cVY3SljM sjLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=DMIG6lMcTlL627+pppKuJSf4e82Uvp9QmjvLA/trmeo=; fh=YSt8wRsMHdH2iFIrF7Cfk7F+F40LSChh9DTZiqin8jY=; b=CHtDfPPt2guj4Jy74vVja/MQYzXnLK7P8XSp73NINgY8XiD4dYmSLl+WMaHyY7P2hB WCeaBDGr+6BtJR7dltxMAhxuLWSIo+I36Ddx+ME3vtBn1EnvQLT5z+tDLSMeQ9rs5A+c XGVGvtmAyYoyEx619cDYkaQPAqTfsHwI7Zk1AqKzWKKYvNMs3f9tFavGMI86GxggIl7t fUlZANnNSGNXSTpHc3+uVzirriqH4RWOiFq1u1XfcXChhbaOZixpv6EHCNkrk1DMudgq 83x5GSNUzE/51aNZvBZwT/CXXNxJ1IdaDgTYc5AB29tdyFWDzqHSyb3/ANOTda3T2R7g Bq4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SjAMY7vk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-131146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q3-20020a0c9a43000000b0069696dcf7c0si5876625qvd.134.2024.04.04.02.03.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 02:03:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SjAMY7vk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-131146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 35AE51C22962 for ; Thu, 4 Apr 2024 09:03:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B414773533; Thu, 4 Apr 2024 09:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SjAMY7vk" 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 D671B3399A; Thu, 4 Apr 2024 09:03:43 +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=1712221423; cv=none; b=ivBbXuXgV3bg6PwvNKusKA5a4DcdjCFR2wYJvldSt/x0BUYORU0pCoVHSL3l78/v6Ckt7BdXPHkiXVXXVfoI42WqT7UIFpqSeMaA0eOZh3Pjpz6w1hUGXqPMtFD/eUO3OYRgrSsDB93kGpRbIBJUptJ7YappNMEumWB+lBbQkLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712221423; c=relaxed/simple; bh=GPdoxmH0kXWK71xhmTauGg+kJZju/VsSstqqnKrPh3c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=uCNYhpyG4RMZhiepX8LGHhVWFtqePbtvFnkP9jck5sqRwXxfnvZoHxWzpf7lLPPjpyQWkWbOtNcmqgSRB2Sd9SLog87r+ewP+yUOAcUz3Km2O36X64fbMaYCQrD0Qui2ND2MjPMTbxfMJhMBlw09hOWlW2MQMY8ge3j73Rxb+oA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SjAMY7vk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EECFC43399; Thu, 4 Apr 2024 09:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712221423; bh=GPdoxmH0kXWK71xhmTauGg+kJZju/VsSstqqnKrPh3c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SjAMY7vkFSjcACcmRHPyeHG7m3JBPkKHMaJIxOCUziSR0/nlvbwaG1JPnsWozAQlk 2KBUHqOOuMyyzX0hdCEGCQHx0ysztyCYFuxq0zo8jdTh5Fl3Ia0CEmO7nkLjLq/UQf hKjbrZJFMgV5w2E7ENhMNXj4KDdsCNn4mymGidmO7/R4cHxmYv338i/1VEgpb74zBz FuYzAns9OJzSXA9ndTdcBw85RJWzb5BAwRW27rS9m6/kuFstoUfMji0LpAjYmOdVPR g51m/eQHs/sA6viYQusj3NErS5fdPHnHoLC0JrqZOTxcC43ByPIMVH7ZELrwawKzkp YWiIuv2GUd/IQ== Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5a4930d9c48so128529eaf.1; Thu, 04 Apr 2024 02:03:43 -0700 (PDT) X-Gm-Message-State: AOJu0Yxp1aLRQlQk8PFTqkdsvt25VhUCixXRjnGqIlFQNOpA6Z1ey1Mw xrvOFhx2Usz5kP89EYdhPmdlf6JbgErCYd8k/Y/Dc+nLKoGzXgdzXCUFgvYrh3yk7DHxxzHnkxq xHITbXy2KewKkjF9GEH9z6NbwQrU= X-Received: by 2002:a4a:3511:0:b0:5a4:6ac7:de6d with SMTP id l17-20020a4a3511000000b005a46ac7de6dmr1684332ooa.1.1712221422653; Thu, 04 Apr 2024 02:03:42 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <4558251.LvFx2qVVIh@kreacher> <3556878.iIbC2pHGDl@kreacher> In-Reply-To: <3556878.iIbC2pHGDl@kreacher> From: "Rafael J. Wysocki" Date: Thu, 4 Apr 2024 11:03:30 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 6/6] thermal: core: Relocate critical and hot trip handling To: Linux PM Cc: LKML , Srinivas Pandruvada , Daniel Lezcano , Lukasz Luba , AngeloGioacchino Del Regno , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 2, 2024 at 9:04=E2=80=AFPM Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > Modify handle_thermal_trip() to call handle_critical_trips() only after > finding that the trip temperature has been crossed on the way up and > remove the redundant temperature check from the latter. > > Signed-off-by: Rafael J. Wysocki This change is premature, as it will cause handle_non_critical_trips() to be called for hot/critical trips which is questionable, so I'm withdrawing it for now. The rest of the series is still applicable, though. > --- > drivers/thermal/thermal_core.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > Index: linux-pm/drivers/thermal/thermal_core.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- linux-pm.orig/drivers/thermal/thermal_core.c > +++ linux-pm/drivers/thermal/thermal_core.c > @@ -349,10 +349,6 @@ void thermal_zone_device_critical_reboot > static void handle_critical_trips(struct thermal_zone_device *tz, > const struct thermal_trip *trip) > { > - /* If we have not crossed the trip_temp, we do not care. */ > - if (trip->temperature <=3D 0 || tz->temperature < trip->temperatu= re) > - return; > - > trace_thermal_zone_trip(tz, thermal_zone_trip_id(tz, trip), trip-= >type); > > if (trip->type =3D=3D THERMAL_TRIP_CRITICAL) > @@ -404,12 +400,15 @@ static void handle_thermal_trip(struct t > list_add_tail(&td->notify_list_node, way_up_list); > td->notify_temp =3D trip->temperature; > td->threshold -=3D trip->hysteresis; > + > + if (trip->type =3D=3D THERMAL_TRIP_CRITICAL || > + trip->type =3D=3D THERMAL_TRIP_HOT) { > + handle_critical_trips(tz, trip); > + return; > + } > } > > - if (trip->type =3D=3D THERMAL_TRIP_CRITICAL || trip->type =3D=3D = THERMAL_TRIP_HOT) > - handle_critical_trips(tz, trip); > - else > - handle_non_critical_trips(tz, trip); > + handle_non_critical_trips(tz, trip); > } > > static void update_temperature(struct thermal_zone_device *tz) > > > >