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: 12819976 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 80897C433FE for ; Wed, 20 Apr 2022 09:14:42 +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: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:In-Reply-To:References: List-Owner; bh=N/ZbZP0r6PNgsGJggPdJMmcImDwlufwkAIw3JoaMRUU=; b=n9rOCWVrgyovXq L0IUWVfyYEDyGT+Qha+vxcKY5mHTgml1hWc81hQUMiMZgPybYFOUEfBVL4uGsNLGuQHciCKq8eVPt vY3Xd5D3D5cMv/3/6zdmu/THA1+q/586GP3pXorjiOg5BMVi135VfWS8ZsQjbvwqgdv4gjdmu2tle i6RFMYlQ6mipTBp4REEtzvUYlBwxrLQsxt0a0ZlVQNFlPQa9p+Cuh8PhtXfGWTj6a0HjhIxmlmvBh KtyxA+0U98t2FuIWWtOOcOv1Kw7rY/GxrCin6EnyetGQr8qByyiJyv7OQqjsH/26E9zFLYJexHyco A1i/PbW9+EvuoqmF32Dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh6Ow-008G0o-6s; Wed, 20 Apr 2022 09:13:30 +0000 Received: from mail-gv0che01on2072a.outbound.protection.outlook.com ([2a01:111:f403:4012::72a] helo=CHE01-GV0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh6Oo-008Fvj-A7 for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2022 09:13:24 +0000 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?+5h3n4MWP9mtey8Sd9qdwBIST/7f3GUEBHtLN5VlmIk0S4MSeaX6NunHDZNM4Mm53?= =?utf-8?q?6rE2qPf49aM8IhQf0mfD5nB0HkzX+lt/6FlGmVrpuxQDoaaOox/Jdo5B//3xACTUP?= =?utf-8?q?pLIKCQu7vVKgxwu0sDkjk4KNnXT8O14cqXPgyRhfVDUFVbwyF4RK/Jr0VJ5tq7h95?= =?utf-8?q?m3kc+A3pVsvBY39UPe1w2i/5mfdWFig5YskHWEQIi6FwO4oAeNacjiogsJX4KnhP8?= =?utf-8?q?xS9P5p54SZaqPOjd8YT1KaTDE67MugRugCfpYO9v9JelSEbd9iiKJdopRu1PH6YOp?= =?utf-8?q?VZpP5B4qROm8xVFZXLZ4d1u8M/5jUn6ngf/JTqS4yCwWNfjg3rs6Mb3l60LTgfkSS?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ybW+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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_021322_607876_9574EAC9 X-CRM114-Status: GOOD ( 17.56 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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); }