Message ID | TYZPR03MB5199B14364633FD7A09A13719490A@TYZPR03MB5199.apcprd03.prod.outlook.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 26207C35274 for <linux-arm-kernel@archiver.kernel.org>; Mon, 18 Dec 2023 16:28:07 +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:In-Reply-To:References: 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: List-Owner; bh=uB27546ausuf9/k9aMSAxNs+wnCPojV4Keyp0FtvXbA=; b=x5CZ3eqE1BJ6+U lQLDMGgHyjaMWBBtxxL+roCSxKAfIA7CZBuVoXhPAZZnGN48uv+iguzt3gxFGqaxZH5Sf5XURDWk7 DsZx3rEQTh4Urpyz1z/959uyVMBFLJWDGkLvlomWZ1AyjvsnRzKzcWmhlMm1rKeOXd21eN+OUgnAW spLb7HsLMfFhr+BQGuLlRPlbUlzfvvvfJ1HHR8i7bw4MYspNogr1DMFljfXguAJC8NsB+bxN29X6S 23civ9PV4K7e0FRWLsi2pKfAOoiKWyi6DAi+FJ/y2A8dteU6VOvDuRhTlhD4+U780KI1KGWjsso7G m+/oxkpR30GJt8y3vyDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFGSy-00BRlk-0c; Mon, 18 Dec 2023 16:27:40 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFGSt-00BRkE-2p; Mon, 18 Dec 2023 16:27:37 +0000 X-UUID: 558eb2fa9dc211ee958cff29c719f35b-20231218 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=MIME-Version:Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From; bh=lQ0aG9wRhiyr4Oicec/5c7bCXb/LExGjpCuewZxh8d4=; b=NLHVMSQndMi+ZweNPuTraKaEoRYHDKAcOrdh8P1Ka/T6AFMOXj+umDc6baW0cEdhTTDMDoEoXYffwkjsTKxRuOWoGQYJrHywBBeZe4I8/eFPOsaqJasjOijDCdJH8lalNGJgx1QOl2Ex0eyN47vVan3RLqrk0i7AmdRyjjwZe+8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:47de0d36-7bf2-42c8-bd80-8f5d809774e1,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:5d391d7,CLOUDID:e65750bd-2ac7-4da2-9f94-677a477649d9,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 558eb2fa9dc211ee958cff29c719f35b-20231218 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw02.mediatek.com (envelope-from <bo.ye@mediatek.com>) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1644621196; Mon, 18 Dec 2023 09:27:27 -0700 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 19 Dec 2023 00:27:25 +0800 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (172.21.101.237) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 19 Dec 2023 00:27:25 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=etY9UkQ19hmbuRurEhpUkSYV1K4SFvCg18BssekCc5T+W11zk7QXas6JsU4dn+D1rx3H23lIIjL8nWLiDGuqVkjTXqx2qefPnUbzMW8nMXhtS27j0ynH69+HllfeZ+TjV55PprZjGCM1zweiqpG5PKYMsWPy4vunZRMDY5GjIM696K1W4jrIQ+5mBaNfoDFDtOV6lXiVrzgDo5DzVsBQc4LZ5Bc7hBpXRyhz/h+gpcBCNyy6ew5NQB6p+6DoTMfgSxZZHwzNfoXvESQhJIVHV4V+osWqAKcwpRLHyjsjXCzHy3mSEO7s1t2cS+j29P099WzlLa92fvPUimtCahr8cw== 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=lQ0aG9wRhiyr4Oicec/5c7bCXb/LExGjpCuewZxh8d4=; b=Yj3qgFUZbKHSEaJT1eJ9LerO7xiMbcPYRIMsmNG8EGyE/c86U76VRGhuy2OMwxzhJhQ1t2UwKvLfU/CSOpSZBqildduPfmfb5ffAuGPmYIAXMzaNNNX3yCBafV3ThYPbLbrvQhv6pACpwTswfRh74fYJokp2tHXKpFdW0Vq23C+F6TIYckBTGCHKr4G3mh34GsrHAq/APKOyRnnlsapn7a1ICIchJmxHP20ZP2TW/TOm5XtIlL5nDhatP4bL38N21TLPu8GAxI2EPM6Eae32IlGndP4WPXlfMUvoqTO8Gk5xoxre0NruZGsLQGqaMCrHjaoVmShnnNXEwNBJYxO1JA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mediatek.com; dmarc=pass action=none header.from=mediatek.com; dkim=pass header.d=mediatek.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mediateko365.onmicrosoft.com; s=selector2-mediateko365-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lQ0aG9wRhiyr4Oicec/5c7bCXb/LExGjpCuewZxh8d4=; b=e2wIlmkmEYsBQHtE2jWpR7BqkpBvkxZC7jmUZKuG73qP6i51ms632zJ0VhSWzfgk5jgrm9VkajrGTfcLQDaVUf4ky5zcjdoLaRQAh9KA9dTCobyzzdeWodniaTBCRYdDbkcqFsCJ/Iob3GB0CW4B66IfMMOiyOE4KgEy6EAKsOM= Received: from TYZPR03MB5199.apcprd03.prod.outlook.com (2603:1096:400:32::11) by SEZPR03MB7486.apcprd03.prod.outlook.com (2603:1096:101:10d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 16:27:23 +0000 Received: from TYZPR03MB5199.apcprd03.prod.outlook.com ([fe80::66c6:e98b:f23d:2d84]) by TYZPR03MB5199.apcprd03.prod.outlook.com ([fe80::66c6:e98b:f23d:2d84%6]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 16:27:23 +0000 From: =?utf-8?b?Qm8gWWUgKOWPtuazoik=?= <Bo.Ye@mediatek.com> To: =?utf-8?b?Qm8gWWUgKOWPtuazoik=?= <Bo.Ye@mediatek.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Zhang Rui <rui.zhang@intel.com>, Lukasz Luba <lukasz.luba@arm.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> CC: =?utf-8?b?WW9uZ2RvbmcgWmhhbmcgKOW8oOawuOS4nCk=?= <Yongdong.Zhang@mediatek.com>, =?utf-8?b?WXVnYW5nIFdhbmcgKOeOi+eOieWImik=?= <Yugang.Wang@mediatek.com>, "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-mediatek@lists.infradead.org" <linux-mediatek@lists.infradead.org> Subject: [PATCH v4] thermal: fix race condition in suspend/resume Thread-Topic: [PATCH v4] thermal: fix race condition in suspend/resume Thread-Index: AQHaMc8UDpbiGtamyEO2ZwwtOh6UUQ== Date: Mon, 18 Dec 2023 16:27:22 +0000 Message-ID: <TYZPR03MB5199B14364633FD7A09A13719490A@TYZPR03MB5199.apcprd03.prod.outlook.com> References: <20231218162348.69101-1-bo.ye@mediatek.com> In-Reply-To: <20231218162348.69101-1-bo.ye@mediatek.com> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mediatek.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR03MB5199:EE_|SEZPR03MB7486:EE_ x-ms-office365-filtering-correlation-id: 50ef3899-c6f5-45c5-81fd-08dbffe636cd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HAB78KMCV0Qy0KmCylxV88a8gZAZAER6fkWNoI6j1BLgRU7UV9OEc1jxzN+BgnTeH+lUT5KCPyt3QnqMgHbXoKLNsd5PQxI8FyWZE8mvwUwdE9KdJT0NSPyfPXFK8KTtO2vyoJK+i6Gu3HQ5SlY9hueeS8uPf+67x7lh7RWWOTop69j222wVd1PeYV9g10eC0mdY/WlYv1pwUi3aRNnfMJ5QTMRyPBpavDs6J+pe4arrN8+D9gpyNmMpu6bGvFto9FMjCT9+5JXffbRn/AFYcF+gLS57zjrWlses5IgE2RJQCCBxblK8az8S7tb43x+f5h2IC+UMRclxwUsn+n2yqdIr4szP8uw4Vm7c5FgknA1XmtGnrObBW+0g0QEIwfOMp7ndWdZHarLqmbc33k/2emDnm1m+W3fpTFPLH5/NBB+ArUty121PRuR4KqBlsiUeku/FNlzvr9rCkq4TAxzeUsGpek42gwKmiXpAQ2uy0yzpZfM+pz5BabzNmu3OBO4DTH4yBQb0Vq85v3DdBt6bzXCRZjoxHEwSAC4/lYWOywU1MLZKuiAvAAXbAfEQivtW/ErvU3wwBpA8jHNDGihchkLJYNbx5Ic3W6Gk36qPTT3wMs3fTMH6cPjJRkVmyjVXdzZUI8naOF5U51H7nBwkt1oLSU+FMblnNIWGx1uc+50= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR03MB5199.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(376002)(136003)(366004)(346002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(55016003)(38070700009)(76116006)(110136005)(86362001)(85182001)(33656002)(38100700002)(122000001)(26005)(83380400001)(71200400001)(316002)(478600001)(2906002)(4001150100001)(66556008)(66476007)(66446008)(64756008)(54906003)(66946007)(7696005)(6506007)(9686003)(4326008)(5660300002)(15650500001)(8676002)(8936002)(7416002)(41300700001)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-ex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NWSDOg0zVP5R9k7dq+ghT5riNf4pZGJJbXOiDAfAgJ0F6Y1?= =?utf-8?q?GhmjXXCCCnqEGcwsOrrxnde2qJmdzwp4lk2pDzpcWuPCSTnbf5FsO6IU4L/J3mayJ?= =?utf-8?q?R5PEbbupWmsRO5mjCwI9jSe07gbZNj9iIAx9XJulE24W0IcYsRL1Ut3OoBF/EFZvB?= =?utf-8?q?w1cKfyp8mzXcHJ8JZ88mcU+X7nf+LR5TmBP5rZXhIhemzqZD7SPgmd/axWfbOgKKS?= =?utf-8?q?ltRXNhEwBFfs2PtJLsMtJQJbq6gtSxI1WCuoHbdDXzXRv7K7IgnDPRbXl+gdg/Lxn?= =?utf-8?q?E8FMo+QzTIPlW5h1iQyIiVwOBpFeExQo3UbbNTU46pm/6p0kBUXrQJuOYDTAED7pl?= =?utf-8?q?01WiOS+JU3BApyTWcdoUGQs/AjieqGrmC4exLKRB6mvLRmTSoDxOBqlKd1cyvdXVu?= =?utf-8?q?3S4PfG6yR3vYfdwFEtEAdSaZJ3VzfjbAYq9Bww066Bn90UE98wWrMI86HN6yA+RmE?= =?utf-8?q?mL52lZ8BFEyI7Eh/i19JbtjNTsPP5SjFkWEaqWHQOzrVOEGS85A8Z6lfc89c0yvKd?= =?utf-8?q?7x+yVusN3JL/uKo5XhT3IFSbrVOigYXURJF5m31ZZKlbNWA4PTHt9hn3osG7wpuzQ?= =?utf-8?q?VBpSfgs92FYWz/ODr2AzlodygEzz0/JqkAKgo6xq5+x28efMLWunFkZw=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR03MB5199.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50ef3899-c6f5-45c5-81fd-08dbffe636cd X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2023 16:27:22.9531 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a7687ede-7a6b-4ef6-bace-642f677fbe31 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CtcKvdy8+4Qs7jbQ5O7SVTmriUbbpOd5zHrSV7u/JZ3w+6cM5Fj4QHOMbPZ2SNhOaaJNvEmATjMdL195GV3hDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR03MB7486 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231218_082736_187871_AA6A2240 X-CRM114-Status: GOOD ( 11.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
[v4] thermal: fix race condition in suspend/resume
|
expand
|
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9c17d35ccbbd..73d6b820c8b5 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1520,12 +1520,14 @@ static int thermal_pm_notify(struct notifier_block *nb, case PM_POST_HIBERNATION: case PM_POST_RESTORE: case PM_POST_SUSPEND: + mutex_lock(&thermal_list_lock); atomic_set(&in_suspend, 0); list_for_each_entry(tz, &thermal_tz_list, node) { thermal_zone_device_init(tz); thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); } + mutex_unlock(&thermal_list_lock); break; default: break;