From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 00F4E2459DC for ; Sun, 14 Jun 2026 07:14:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781421258; cv=none; b=GaokJDe3NXBFfOZP1ShyIGjUeMD9Kvg8BsmCkdC9EPQxIk76peM7SPTyoWn4ku3CHM+x1arp4fHCyq5WTV+q4WgVdW/ZLcTXQd4L1rEsHbVnW1UeCw62Rby12xUnkeqb25b3uNrF3x71xPiynFzWAU3mSP5hWowWTDZPJG90Hh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781421258; c=relaxed/simple; bh=pqecBGrwwJDacJr4gnG5bJ16wt0S3FihsDoxp+tVCRg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mptBN5aJaa21EQCECZcc2oSrKg/rrrxaJGSGw/CzCxDjg8Sx49V7x463Przc3Uqu8Z/a+kqaeIwB6xblLfv4gSBVP0XlOUZ+rVfPAF3BYrDV97qwrlzNKeut2jlNH/dQlI3Vxi2M696CiYttfTuscLRjeXlNP7hQsRZRVswQj68= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jmy+zG6z; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jmy+zG6z" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-46019b190b6so1890434f8f.3 for ; Sun, 14 Jun 2026 00:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781421254; x=1782026054; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=t6JKdGL8Xe2lq+/BiQDSaNE1rM0cDe8Om7VyrIfgze4=; b=jmy+zG6zkXQrurOmVxcicTLc2TdOaYTpTND4xZri6xjQZnXEmNMTddwKsSvrUk/JuW dCeeEOzOiqEYXfVw5wy5keeFYC8a/M7WEzRaGOiMgwtNjn+V+G5L+aa+iajOaUnUCgyW sGIYbjdFB1yEp4ZlyI4NXwFQOJI73ahklG/pasb5F/l1DY1x5vIKEa8MOG2YA7qB1MZ5 DN6TMGBEaBF7D2eSrPrPi3KRRvUjQ7TmVXH0yG/77TNnmDfWt+GaxqL41vuuOxTphy+U mbXKc4StnuSita/M/L4Q94J9DoqxG6mWXoJXS5ZFOR9vWuY/3wHEyLtoVJSMabsYGmUb 7y2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781421254; x=1782026054; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:subject:cc:to:from:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t6JKdGL8Xe2lq+/BiQDSaNE1rM0cDe8Om7VyrIfgze4=; b=KEvuP3IWs9Z0K4S9nkbisns/TpSHcBXtyF/lEvhXyn0oLAY2FYsqV6uywFrZWfL0KS DB/epmQTZ3tY8lK8mamyH2cce8tfupF2/PRLnGjj+Dv5iBxOx2Q5OmXciUVyCxA4FHrT tCHFW62scbM5mbIfS+yIfWzj0PFWQkj8Z0R2sTiHybS9aVTtU2RA9doZqw24YpkFjm/U cpodL8uVABFRi5PnxpUAc8BtU5+P8lCvJCMIo+fe2eK1wZq/C2FhD32AS7xVG586OBt6 eo4HfbCKdMzD0e+57RxLCzNHXs+JMBmSffcfLVbIs85Uhjlfya/ebD5bpv90co4kPCfY N+Wg== X-Forwarded-Encrypted: i=1; AFNElJ9oF1od/6XPqhN5W5Sa3b0hYayRAor+hc5t3k/PsPHm78VpmcwodIcVUIu28HswHPywsCTavwYuWYO7uow=@vger.kernel.org X-Gm-Message-State: AOJu0YzS9nTKykjfWxEjdPyjYr1iJTQQB2MXFPNvQ44/OAFezMu/1n9Y w1NE/pT5KILC1KsToOnyDuRchHwA4bEtQ0nVnTbIy0XNSw8ndQNZ0b1e X-Gm-Gg: Acq92OEiEQgi01W3a1D7J5fiE07F9bM+p11Nt7zT+hwWy0nDvYOTlHe8wmcVgnn3zXy pvhD+caYjoSrMbJZdFqsBU8YWgf5xSrLh99WU6CxwdDq1BJzVGbF4tjKp6J5Oebv1giKTZrm6Hk JPu4w7lvKnfBELyoukGACU1QqDCboPe0z3oelsyR8hNutS6msg3pVdDq0UanAInsbdJ2eM5yyJP usReTLbbaNZ24a9cu37+zcKouXgBYrwn9YzpVUq/V3Ha0O/gEpkhkZbGVbH2VPqFK1LCA4j9AH2 +qIl5mqn9kOISPERuNwDhQnyXxckT+zRcHTzZxglnANcHkZjZ1a1rbycnFCBIyZwmtM/8Xv1F3L 34Rb2lsWqylkXBbV0ke8syMZwQfT3QxJAbjt5XXcZ1AuCehVQqyavXy7aI71eEw1vH+6E7dI9pC TXRUVLsTk9sGUksUpE0qhpJEsl7Wh/rShbv7Kj9F0UEuMAA/Ac78fXmM7xXEmrwlaT X-Received: by 2002:a05:6000:420e:b0:43c:f66e:f24 with SMTP id ffacd0b85a97d-4607ebf8195mr6941469f8f.35.1781421254134; Sun, 14 Jun 2026 00:14:14 -0700 (PDT) Received: from Ansuel-XPS. (93-34-88-103.ip49.fastwebnet.it. [93.34.88.103]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f2d933esm20866652f8f.33.2026.06.14.00.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2026 00:14:13 -0700 (PDT) Message-ID: <6a2e54c5.56f33bf0.2d579f.295c@mx.google.com> X-Google-Original-Message-ID: Date: Sun, 14 Jun 2026 09:14:11 +0200 From: Christian Marangi To: "Wayen.Yan" Cc: linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Lorenzo Bianconi , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] thermal/drivers/airoha: Fix low trip clamp using wrong variable References: <6a2df296.6b2684af.263065.8200@mx.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6a2df296.6b2684af.263065.8200@mx.google.com> On Sun, Jun 14, 2026 at 08:14:11AM +0800, Wayen.Yan wrote: > In airoha_thermal_set_trips(), the low trip validation incorrectly > clamps 'high' instead of 'low': > > low = clamp_t(int, high, RAW_TO_TEMP(priv, 0), ...); > > This causes TEMPOFFSETL to receive the clamped high-temperature value > instead of the requested low-temperature value, making the low-temperature > alert threshold identical to the high-temperature threshold. As a result, > low-temperature interrupts can never fire independently. > > Fix by replacing 'high' with 'low' in the clamp expression, matching > the symmetric pattern used for the high trip on line 264. > > Fixes: 42de37f40e1b ("thermal/drivers: Add support for Airoha EN7581 thermal sensor") > Signed-off-by: Wayen > --- > drivers/thermal/airoha_thermal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/airoha_thermal.c b/drivers/thermal/airoha_thermal.c > index b9fd6bfc88..439aa011b7 100644 > --- a/drivers/thermal/airoha_thermal.c > +++ b/drivers/thermal/airoha_thermal.c > @@ -273,7 +273,7 @@ static int airoha_thermal_set_trips(struct thermal_zone_device *tz, int low, > > if (low != -INT_MAX) { > /* Validate low and clamp it to a supported value */ > - low = clamp_t(int, high, RAW_TO_TEMP(priv, 0), > + low = clamp_t(int, low, RAW_TO_TEMP(priv, 0), > RAW_TO_TEMP(priv, FIELD_MAX(EN7581_DOUT_TADC_MASK))); > > /* We offset the low temp of 1°C to trigger correct event */ > -- > 2.51.0 > > Hi I already submitted the same patch in the AN7583 series. Can you review that patch so maybe we can try to push fix for this? -- Ansuel