From patchwork Wed Apr 20 09:13:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 12819977 X-Patchwork-Delegate: daniel.lezcano@linaro.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 359E0C433EF for ; Wed, 20 Apr 2022 09:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233378AbiDTJQF (ORCPT ); Wed, 20 Apr 2022 05:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237435AbiDTJQE (ORCPT ); Wed, 20 Apr 2022 05:16:04 -0400 Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01on2135.outbound.protection.outlook.com [40.107.23.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C824D31903 for ; Wed, 20 Apr 2022 02:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXRZ+FShXoGqnchv2yssdTq9un1Hfz4oH/5WQcbjCgFsWCWN3zC1bGAS+H+vGhVAJ06dmHGUizqvt698J1T89kHP5x81sh70PmAImPQPDX94B1ESUzRbV1qAhYNN+ebpd+qlPcmCEDfOhGeRtjV8pKiqcOTKGcsMvWk2otPiXLzxip62auo8uvlpYJCsyXlyF5hqcuy5FB9hOJA9K4HD8JlsvXsbWfbH1nEE7FJGtDVZMxFQdygWwc5UPFBOfe4LELbiW0+AjT6hlrguvAgV2KV0JfPyZR8LkE5iO8llNXrIhxiwdnqP+7FgwYBshmwA4hOZEVPpYfzZoNpoTvNfPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G+nW9Qm4WizYILbeEBNES29lJ7MB3FxfULtTkTF2Uyg=; b=Enxej6u9iOoz/i9LpcpemJlqM2t3+kE+w738JFqShVBH724i/mGwvgwfEUAl76wVfsXdc4bNWWUJQF5hshc/5e4B/FcE1abXQTv4E0QO1/+RcNovVSrE5Ye53znlc9RUygRh9l/9zSMPCqJTtGcyMt3Nak2bdr77U8QKPok/W3kps1xT/RDE7/dIgte9Mt4G8bsSEhm4ZkHXdz0BnnaQrtH5bqRudS9G/ivbWzwIACgIUynewXe66WqqqGdTkvZG3HxYTNYDpGFsvk1Nvn1yXdDhJ68n2yX+aITGXvWyPGlQfprec0QV8VTcidKKtTa8fV5Ky3ghRZpWoJTQhQfmow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toradex.com; dmarc=pass action=none header.from=toradex.com; dkim=pass header.d=toradex.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G+nW9Qm4WizYILbeEBNES29lJ7MB3FxfULtTkTF2Uyg=; b=iOzcgo5AFEAZ+jckb0Zgx/MjjFSsgqwHXrBegwpjoeJvi43Sr1lbf/GHq2mRgnQaLYBOlfpZ0BzYqp6hf04VD8LagRRT7OUzHhA0hnL0s8vIwxYJetOYYbihIPirYrkmMSwjGp1qrOv90o2nVYAT7gn2Sx7oEfBzFuOXx6yv8OQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=toradex.com; Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) by ZR0P278MB0204.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:37::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Wed, 20 Apr 2022 09:13:16 +0000 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM ([fe80::f465:3051:c795:3c2]) by ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM ([fe80::f465:3051:c795:3c2%9]) with mapi id 15.20.5164.026; Wed, 20 Apr 2022 09:13:16 +0000 From: Francesco Dolcini To: "Rafael J . Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Francesco Dolcini , Amit Kucheria , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, Tim Harvey , Jon Nettleton Subject: [PATCH v1] thermal: imx: Update critical temp threshold Date: Wed, 20 Apr 2022 11:13:00 +0200 Message-Id: <20220420091300.179753-1-francesco.dolcini@toradex.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MR2P264CA0112.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:33::28) To ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c885add-3d1e-4f47-23eb-08da22ae00f2 X-MS-TrafficTypeDiagnostic: ZR0P278MB0204:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gu98rZUa4j4Gt95LXwCQUN/YshJsi4SmnUG+qy4tFYrTNKfCMhOew/Oz1LGkmovFFAzDQvTjNe/DfanBSsSXXVWd+SZ3pi1SDQkalVaOfgllXTQVKYQY4L+fk8r+3kMRnC8edxAnCjMhNQk8LwYJwcKnw9UEGhBSkhCajtacGT7AgpfCy+EOeNVixVYJr3Eec7T2kdj5T/7yMLST0KF5+eDbiH1Kq6VD9HW5EcvDUoNk4s16VbQlESnhjTqkvTfvNstKuyZ0cjXmWFTiO4y0pfnJRX2mn6z3TWfaDCVH9mFZjDtD5gH13h23KmrJLq62KFdojk6oiVkC6nMXWR1EZM0CFuosspyM8ptRrOF0ixnFT8Ai/qEjBB9eZxlCMJZ01NDRcWWI+MBCSG0V1OfXsODDfE9enID3q6pT9vm4/9AEuqCs1FTTtB9UaUf8N7Q0kbkRpJI5S9HKIgcA5037tcgZFM97A4L/2dLEz7O3qzt1UCQycWhTE2uMPNODQXSrhilgJ/LP+IfoCjyMjO3mhYUeFCnOA6gzwmOcEIZUAihC3huoohLnMgRWlMLSL4MKsAkoFCUCjpcV+ExfxOjbRdTW98Fndpyiw58Ad4QLocwvukvF8kSNpwum0omMzHbvrJCPHhC3hamRZ4PYUxy39JQIWOLShOi6DVPMOMffhjI1On0FjU1HXujbwKPOfGFr6mwpI5lb+9PHzNarCX6SlUAHfukPAZn8q2fDV54WkhLbZyfFy7hGbCDX83MlPTTXSs9mmcc09r9NMwI2BjgXdbeKF+Tc1pn4YZLojlFNcMA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(4636009)(376002)(366004)(396003)(136003)(346002)(39840400004)(66556008)(4326008)(508600001)(66476007)(54906003)(7416002)(8676002)(44832011)(36756003)(2906002)(110136005)(5660300002)(1076003)(2616005)(53546011)(6512007)(8936002)(6506007)(52116002)(66946007)(6486002)(316002)(966005)(6666004)(38350700002)(38100700002)(83380400001)(86362001)(26005)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?mauOdfhRep4x4vJXJcZUl0CaXevw?= =?utf-8?q?+5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?q?Gy2z6wMbn8qQWjnVHE4WebKKMCeKRUJFU6z9s6+YvXFSTyw5rbM5Jov2IqGcZOFQg?= =?utf-8?q?LlaZZWvyjcrVNIV1Gwl4HrI2xed01mbP6bL3nHIDJ4vlIO1XLrhfVSfDyaYijGw41?= =?utf-8?q?cGneUEluHGjp1tTTiWbZ0RmyMFcSWg/ah6Zn1AsHSzYDeMEO3yYyqO1lH1k2+PFWj?= =?utf-8?q?ofKShJ0SkjYhsvKpaz/ORx8IWJqx7ZsFj+q2f4J1fv1hxmb9kMfVjykFnaCMNROJ+?= =?utf-8?q?lQRqJ4z3+omzA+g8tqPPD+m+kwTmGJIIspuvlyZ5rqK7JPIqhOhT/655EbvBaEzYz?= =?utf-8?q?nVj6EEBJMU4zBscil22Trc3vVInFGyQtOcZEzl042f1X7SFtY/qd3GlybW+QqIo0U?= =?utf-8?q?CkNg5h6d8E/yvBMvYNCo1JmeKY3HVpiBMt3TFPsS1O1jowal7SoGhBjHmYmSPqij/?= =?utf-8?q?7nS/JOvgkBc0DGGDKmVY/VAxlMVN9pHdaZfrbgR7360uflvyg+2A4RuzzCgVkFQ06?= =?utf-8?q?e2Ym64tEv0sc57Z+/3zJBkMP/2m9x3LVB02BX5T+qOHJQIQ8/ksFi8ub6yd+/f4C6?= =?utf-8?q?SU4Hdm6FN08y3c8Uya64RDp6JedmJnr4rL+38EQ143JI0VFB6P2OeWJs/6muBu+pb?= =?utf-8?q?9E5qQeudeAMCFcEwUAssqjivJxrFqhRst2jg50XvezfWw/LXOeTPChtHP78sj5hAe?= =?utf-8?q?QU9+/9xTQItgne4qjz1PX7mfne54zBAmwdy/+bgGitiTnd1nev+4Vcuybaf6P6mZk?= =?utf-8?q?uaxsRbYdktZe0ubLRbqTKbSdls02w1L8LaKUh3naH39l38JgbjYLY=3D?= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c885add-3d1e-4f47-23eb-08da22ae00f2 X-MS-Exchange-CrossTenant-AuthSource: ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 09:13:16.2650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HrIItyLMeumiUpBN1ZoXPxxNndR4wNGNogi1EcInwdlhv7RUwA4MCPna/IQvjiilU7gyev287PaH1uE/+W01iVICG78fdMRxovopj/qocJ0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR0P278MB0204 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Increase the critical temperature threshold to the datasheet defined value according to the temperature grade of the SoC, increasing the actual critical temperature value of 5 degrees. Without this change the emergency shutdown will trigger earlier then required affecting applications that are expected to be working on this close to the limit, but yet valid, temperature range. Signed-off-by: Francesco Dolcini --- Not sure if there is an alternative to this patch, the critical threshold seems to be read-only and it is not possible to just change it from user space that would be my preferred solution. According to the original discussion [1] the reasoning was the following: On Tue, Jul 28, 2015 at 4:50 PM, Tim Harvey wrote: > Yes - the purpose of lowering the critical threshold from the hardware > default is to allow Linux to shutdown more cleanly. But I do not understand it. [1] https://lore.kernel.org/all/CAJ+vNU1PQZa9KoCU9o_ws6jAAjhGVJby-1P583SVejT5TrAFTQ@mail.gmail.com/ --- drivers/thermal/imx_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 16663373b682..75a631a23e61 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -504,10 +504,10 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0) } /* - * Set the critical trip point at 5 °C under max + * Set the critical trip point at max * Set the passive trip point at 10 °C under max (changeable via sysfs) */ - data->temp_critical = data->temp_max - (1000 * 5); + data->temp_critical = data->temp_max; data->temp_passive = data->temp_max - (1000 * 10); }