Message ID | 20221025171453.1.I13c2a23f276fb63bfc225aeab0bf0db9560a90e0@changeid |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1125828wru; Tue, 25 Oct 2022 10:23:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/ouQvr6qh9F93Kgg76JARDHgq2JICEo5x8JgJBIQqriSvQ0JBrViyrXR/W9yLYdAq5fgk X-Received: by 2002:a17:907:5cb:b0:791:96ec:f436 with SMTP id wg11-20020a17090705cb00b0079196ecf436mr34833207ejb.100.1666718622133; Tue, 25 Oct 2022 10:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666718622; cv=none; d=google.com; s=arc-20160816; b=e/2a48MmwOt/wBiyR6DiQeyERB8w5CiAD5ZLoA4zNLjO6zvW0pDfQGpEyJK/N7e802 1mCLgDBromSK5CdnSXDsYZQlKT0uNO2GLVnYNLIfPFaqvhBUeNYFbDRziMqNoAPGI6qX UXYWCxO3FmqZMABb+Wr+9mZmr4K7icGdu3hLd2gxrlj+Cb4jq+eWqHLGPus0efjG4dF6 i4xA8p6idKDDwG4SMMthTHJ//AMegNoMDojspe+e1FCFUFTB8w0yF6B89D6o2wx1aj5W 7D590tXrcd+M70yO6Ze8BeIKzdezGLN5yL/cIaotSjDUIOxcsO0v4eSITFWLn4GzwP33 qZlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IPchkGJSMNf/bGVi4QMD2CaRXadW0du4YX2JGa57jqU=; b=Ltf4bFyfIGg7xTVEczUFBEJve+xIerYwph0l82+aGTIeEh73hSE5vfeJpXOpWkqiiV XMauL2T6hQWNsO4laZPItF+bRuhsdTreZsNkBQejenp1yUWdOZx+ByxaioroW39skWv6 5ngIP5CTqGcGa6NUuyaShkwW9m79ll3mzPCf+ZvRQjRJ6nptHKuo86mMuDNsXfBBTTu7 NAlSdjAWhIJ5CH6E04ErfKXIz1xZNyyruHimPznTbCBrMLs0EOhkE/pNya1TaQK5mi2q LxCpdSQXxrkIeX45g8Nvu5UiSVQJ6js44Lbc162+gxfw4FOpI+0o422aDCtCLOm1NUZ3 wI7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PbFdxsu1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht22-20020a170907609600b00783ac0b4d32si3803779ejc.941.2022.10.25.10.23.18; Tue, 25 Oct 2022 10:23:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PbFdxsu1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbiJYRPr (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Tue, 25 Oct 2022 13:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbiJYRPo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 13:15:44 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE2B1578AD for <linux-kernel@vger.kernel.org>; Tue, 25 Oct 2022 10:15:42 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id b79so10932368iof.5 for <linux-kernel@vger.kernel.org>; Tue, 25 Oct 2022 10:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IPchkGJSMNf/bGVi4QMD2CaRXadW0du4YX2JGa57jqU=; b=PbFdxsu1YMfbG4GaVPb9yW+FF+vy2Cv9dorwW+mP+0I7YbjQTw4HHT1kWzMXjtZ9mr ENvs/hG8wRpepj69cFz8W8dE5jRdQuumgmFXLQwdApKzBSeErqJLniEfe5t+0SFHSTBA bfnDTKc4VjGwv4a3SyhubAUzkKxB8+99bOrtY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IPchkGJSMNf/bGVi4QMD2CaRXadW0du4YX2JGa57jqU=; b=l0KEsrMJjgmWbnkycvExqp6CQsSTBDQoNRUk366QTbADej7hoebyScF4HwSDE43XCq UfFp/cfpcR0/FXq2Lt0n+/RD3ETzDL8EWd1wqWf5QP5kyDOra5VvEHtFlCKpifYimYPr wWnXn+IkNTFo3zZAFuqxhx0tM6BBRd8JlfEvD9Y6clFsjDh7dxrAvadXR9PXL2sZwiUI EFJK19tG/s2h3aYSd+CwNn4YgpT+ctoOYyyTQfaWMC7Z8zdj62N8Mx0rw/IOk+S8Op7N hbCRhcsr6Y+vKDU43TF728SIs282APZfwxO+YhhgoDVAVZbsnpnrqjrfxAwN2wBxjxDB BFxQ== X-Gm-Message-State: ACrzQf0i31YLTYVsGzHbPNSe/01CnSmOP+TiZt6pESvZ68ZyIPlIBK7r ctxTLzQnVaZvbpILieOvV+KIOw== X-Received: by 2002:a6b:c411:0:b0:6bc:1382:37d5 with SMTP id y17-20020a6bc411000000b006bc138237d5mr23770154ioa.133.1666718141538; Tue, 25 Oct 2022 10:15:41 -0700 (PDT) Received: from localhost (30.23.70.34.bc.googleusercontent.com. [34.70.23.30]) by smtp.gmail.com with UTF8SMTPSA id l11-20020a92d94b000000b002fc681a6ad8sm1165373ilq.78.2022.10.25.10.15.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Oct 2022 10:15:41 -0700 (PDT) From: Matthias Kaehlcke <mka@chromium.org> To: Amit Kucheria <amitk@kernel.org>, Thara Gopinath <thara.gopinath@gmail.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, "Rafael J . Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Zhang Rui <rui.zhang@intel.com> Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Kaehlcke <mka@chromium.org>, Luca Weiss <luca.weiss@fairphone.com> Subject: [PATCH] thermal: qcom-spmi-temp-alarm: Log the actual max stage 2 threshold Date: Tue, 25 Oct 2022 17:15:08 +0000 Message-Id: <20221025171453.1.I13c2a23f276fb63bfc225aeab0bf0db9560a90e0@changeid> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747681145770304402?= X-GMAIL-MSGID: =?utf-8?q?1747681145770304402?= |
Series |
thermal: qcom-spmi-temp-alarm: Log the actual max stage 2 threshold
|
|
Commit Message
Matthias Kaehlcke
Oct. 25, 2022, 5:15 p.m. UTC
If the critical trip point of the thermal zone is higher than
the max threshold of the PMIC log the actual max threshold of the
chip, not the gen1 max threshold of 140°C.
Reported-by: Luca Weiss <luca.weiss@fairphone.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
Hi Matthias, I love your patch! Perhaps something to improve: [auto build test WARNING on rafael-pm/thermal] [also build test WARNING on linus/master v6.1-rc2 next-20221025] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Matthias-Kaehlcke/thermal-qcom-spmi-temp-alarm-Log-the-actual-max-stage-2-threshold/20221026-011708 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal patch link: https://lore.kernel.org/r/20221025171453.1.I13c2a23f276fb63bfc225aeab0bf0db9560a90e0%40changeid patch subject: [PATCH] thermal: qcom-spmi-temp-alarm: Log the actual max stage 2 threshold config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/86a0353247304d74e41de39b136e1772550048bf git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthias-Kaehlcke/thermal-qcom-spmi-temp-alarm-Log-the-actual-max-stage-2-threshold/20221026-011708 git checkout 86a0353247304d74e41de39b136e1772550048bf # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/thermal/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from include/linux/device.h:15, from include/linux/node.h:18, from include/linux/cpu.h:17, from include/linux/of_device.h:5, from drivers/thermal/qcom/qcom-spmi-temp-alarm.c:13: drivers/thermal/qcom/qcom-spmi-temp-alarm.c: In function 'qpnp_tm_update_critical_trip_temp': >> drivers/thermal/qcom/qcom-spmi-temp-alarm.c:255:34: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=] 255 | "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~ include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt' 146 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~ drivers/thermal/qcom/qcom-spmi-temp-alarm.c:254:25: note: in expansion of macro 'dev_warn' 254 | dev_warn(chip->dev, | ^~~~~~~~ drivers/thermal/qcom/qcom-spmi-temp-alarm.c:255:117: note: format string is defined here 255 | "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", | ~^ | | | int | old drivers/thermal/qcom/qcom-spmi-temp-alarm.c:255:34: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=] 255 | "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ^~~ include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt' 146 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~ drivers/thermal/qcom/qcom-spmi-temp-alarm.c:254:25: note: in expansion of macro 'dev_warn' 254 | dev_warn(chip->dev, | ^~~~~~~~ drivers/thermal/qcom/qcom-spmi-temp-alarm.c:255:155: note: format string is defined here 255 | "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", | ~^ | | | int | old vim +255 drivers/thermal/qcom/qcom-spmi-temp-alarm.c 220 221 static int qpnp_tm_update_critical_trip_temp(struct qpnp_tm_chip *chip, 222 int temp) 223 { 224 long stage2_threshold_min = (*chip->temp_map)[THRESH_MIN][1]; 225 long stage2_threshold_max = (*chip->temp_map)[THRESH_MAX][1]; 226 bool disable_s2_shutdown = false; 227 u8 reg; 228 229 WARN_ON(!mutex_is_locked(&chip->lock)); 230 231 /* 232 * Default: S2 and S3 shutdown enabled, thresholds at 233 * lowest threshold set, monitoring at 25Hz 234 */ 235 reg = SHUTDOWN_CTRL1_RATE_25HZ; 236 237 if (temp == THERMAL_TEMP_INVALID || 238 temp < stage2_threshold_min) { 239 chip->thresh = THRESH_MIN; 240 goto skip; 241 } 242 243 if (temp <= stage2_threshold_max) { 244 chip->thresh = THRESH_MAX - 245 ((stage2_threshold_max - temp) / 246 TEMP_THRESH_STEP); 247 disable_s2_shutdown = true; 248 } else { 249 chip->thresh = THRESH_MAX; 250 251 if (chip->adc) 252 disable_s2_shutdown = true; 253 else 254 dev_warn(chip->dev, > 255 "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", 256 stage2_threshold_max / 1000, stage2_threshold_max / 1000); 257 } 258 259 skip: 260 reg |= chip->thresh; 261 if (disable_s2_shutdown) 262 reg |= SHUTDOWN_CTRL1_OVERRIDE_S2; 263 264 return qpnp_tm_write(chip, QPNP_TM_REG_SHUTDOWN_CTRL1, reg); 265 } 266
I just saw that Luca already posted a similar patch: https://lore.kernel.org/lkml/CAHLCerN+-5qKsRmpuF55RdeUMZJZuiZJ-7O4LnM8+QuHJfs0mQ@mail.gmail.com/T/ Please disregard this one. On Tue, Oct 25, 2022 at 05:15:08PM +0000, Matthias Kaehlcke wrote: > If the critical trip point of the thermal zone is higher than > the max threshold of the PMIC log the actual max threshold of the > chip, not the gen1 max threshold of 140°C. > > Reported-by: Luca Weiss <luca.weiss@fairphone.com> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org> > --- > > drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c > index be785ab37e53..bdfe2129c357 100644 > --- a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c > +++ b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c > @@ -252,7 +252,8 @@ static int qpnp_tm_update_critical_trip_temp(struct qpnp_tm_chip *chip, > disable_s2_shutdown = true; > else > dev_warn(chip->dev, > - "No ADC is configured and critical temperature is above the maximum stage 2 threshold of 140 C! Configuring stage 2 shutdown at 140 C.\n"); > + "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", > + stage2_threshold_max / 1000, stage2_threshold_max / 1000); > } > > skip: > -- > 2.38.0.135.g90850a2211-goog >
Hi Matthias, I love your patch! Perhaps something to improve: [auto build test WARNING on rafael-pm/thermal] [also build test WARNING on linus/master v6.1-rc2 next-20221027] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Matthias-Kaehlcke/thermal-qcom-spmi-temp-alarm-Log-the-actual-max-stage-2-threshold/20221026-011708 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal patch link: https://lore.kernel.org/r/20221025171453.1.I13c2a23f276fb63bfc225aeab0bf0db9560a90e0%40changeid patch subject: [PATCH] thermal: qcom-spmi-temp-alarm: Log the actual max stage 2 threshold config: arm64-randconfig-r015-20221027 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/86a0353247304d74e41de39b136e1772550048bf git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthias-Kaehlcke/thermal-qcom-spmi-temp-alarm-Log-the-actual-max-stage-2-threshold/20221026-011708 git checkout 86a0353247304d74e41de39b136e1772550048bf # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/hid/ drivers/thermal/qcom/ fs/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): >> drivers/thermal/qcom/qcom-spmi-temp-alarm.c:256:6: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] stage2_threshold_max / 1000, stage2_threshold_max / 1000); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:146:70: note: expanded from macro 'dev_warn' dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ drivers/thermal/qcom/qcom-spmi-temp-alarm.c:256:35: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] stage2_threshold_max / 1000, stage2_threshold_max / 1000); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/dev_printk.h:146:70: note: expanded from macro 'dev_warn' dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ 2 warnings generated. vim +256 drivers/thermal/qcom/qcom-spmi-temp-alarm.c 220 221 static int qpnp_tm_update_critical_trip_temp(struct qpnp_tm_chip *chip, 222 int temp) 223 { 224 long stage2_threshold_min = (*chip->temp_map)[THRESH_MIN][1]; 225 long stage2_threshold_max = (*chip->temp_map)[THRESH_MAX][1]; 226 bool disable_s2_shutdown = false; 227 u8 reg; 228 229 WARN_ON(!mutex_is_locked(&chip->lock)); 230 231 /* 232 * Default: S2 and S3 shutdown enabled, thresholds at 233 * lowest threshold set, monitoring at 25Hz 234 */ 235 reg = SHUTDOWN_CTRL1_RATE_25HZ; 236 237 if (temp == THERMAL_TEMP_INVALID || 238 temp < stage2_threshold_min) { 239 chip->thresh = THRESH_MIN; 240 goto skip; 241 } 242 243 if (temp <= stage2_threshold_max) { 244 chip->thresh = THRESH_MAX - 245 ((stage2_threshold_max - temp) / 246 TEMP_THRESH_STEP); 247 disable_s2_shutdown = true; 248 } else { 249 chip->thresh = THRESH_MAX; 250 251 if (chip->adc) 252 disable_s2_shutdown = true; 253 else 254 dev_warn(chip->dev, 255 "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", > 256 stage2_threshold_max / 1000, stage2_threshold_max / 1000); 257 } 258 259 skip: 260 reg |= chip->thresh; 261 if (disable_s2_shutdown) 262 reg |= SHUTDOWN_CTRL1_OVERRIDE_S2; 263 264 return qpnp_tm_write(chip, QPNP_TM_REG_SHUTDOWN_CTRL1, reg); 265 } 266
diff --git a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c index be785ab37e53..bdfe2129c357 100644 --- a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c +++ b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c @@ -252,7 +252,8 @@ static int qpnp_tm_update_critical_trip_temp(struct qpnp_tm_chip *chip, disable_s2_shutdown = true; else dev_warn(chip->dev, - "No ADC is configured and critical temperature is above the maximum stage 2 threshold of 140 C! Configuring stage 2 shutdown at 140 C.\n"); + "No ADC is configured and critical temperature is above the maximum stage 2 threshold of %d C! Configuring stage 2 shutdown at %d C.\n", + stage2_threshold_max / 1000, stage2_threshold_max / 1000); } skip: