From patchwork Sat Dec 28 01:14:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 13922208 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 C5302E7718B for ; Sat, 28 Dec 2024 01:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: Content-Transfer-Encoding:Content-Type:Message-Id:Date:Subject: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=vSrHaMAKu4cD6BEf4GE/0e+NMcSLtzqoORvfYtRP5q8=; b=n3/9tilZn+CtwT8RP2d273Wu7x BArfXF+dvuTw/GVlBMJ2Fyd7+FF71Xo0KsgUlvfHyoJ89U/claDV466xuoNHYxRoiTeua2HsZtypN WQ4p3r3YgvEIQvG5XLqXRdaFzWC654zSaVN35NQMfsiInIYMeNpyZ7e6IoCmFiAFlPwA6anGTfU1s DgK+9OdyX4yC1A8c2Yw0lTJ5Qw01edcT0I5FPhG5UWKbLdTmLIt5gslQkHbqtgI3OoG1PPhW83Tw+ 23ObzWgA0NagpQRo/Tz+xxbChRReBhk3cikvYiJ7TRig0Xfm5Paafbn6dVLtV7KumaWYuSC6XeHDG x/S1OtdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLRY-00000001BNk-1WQd; Sat, 28 Dec 2024 01:16:40 +0000 Received: from mail-vi1eur02on20609.outbound.protection.outlook.com ([2a01:111:f403:2607::609] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQK-00000001B6K-208B; Sat, 28 Dec 2024 01:15:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jHL/oecvV+6GyJIW4WP1MleHLGhSkswB8K4fSV4F3yQH+6t3xRQMFmPfXv0e9A7w2nViRVgIdBQmSM5tYB4MKxqtBheZ2pZilnU9No0MmetMDzYn99Ee1jGMgkfzFV8XP5USuaCobzcRT3UTQ5l3q96Nu9/f92Nqe1BMbe1z62iDxc9nRy7Fz9gA2Ly3Mb87kR3B6aKyF7iCdfIW7fmNrTxOJb0xWKhv1o3Fr+di2nZSgLVyousZJ+7eL0XAgC9LSFqu6KeV+/1rVWZC5+XtjFHZvHycNaEiHdiCL1d5mFt1KuwM980jYYjCkRJC7nzrAxOv0nHVq5M6L+/EuRn1VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vSrHaMAKu4cD6BEf4GE/0e+NMcSLtzqoORvfYtRP5q8=; b=bn5l9Eu48gofdn5KiVO63ldNKxHAu3ZexGpevPehbHDNfz7x3JiKjXF1mMENZ/svyOYGszAeesYNwr3hosMTloe5ipmogN0Tth6g2XLZQqaSGgBYj09eNkg/478odSk79lfj8RQBFr0IA555bBUOc+bkaMqC9k+rhlvOd0QI13MAYo3wtzOl6sDhrgfK/hq81GrOE61v5DQFTFvBn14Zww7AhZoazl8M4CX+qIzvXh/ub0Up/egFVY1ZtipSpkamFPhkOtjDHFsAW+EdTBn6afMBJJtmzx6IQ1QNmybPB/qYNpGNbt9yokyOukqn3R+7WfhfNgy8A9wEMt3EP8BvXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vSrHaMAKu4cD6BEf4GE/0e+NMcSLtzqoORvfYtRP5q8=; b=PfgY/mhaL2j7wIkOQRife2wUidD6N+CtYq39SnPQqRGqcsUef5h03IGTA4I7NuWT+h+1g3cbZrzpmvJy4Up5a+JDbeuW1rw1efErhDeEE9fO9OEfImPnRbWTqqZTircAr+9K2R2p4klUQzZwphbMD3Glo9B745ZgmtdDa6BEIMbqRpwIBI750wec3k9iWUXOkF+NFpxm0DgEAMPPdFluZTNCFXuDlUWwb59/NmOnAlxhVbwCNkoKjBfk0yTGFZ4/SjdXG1kUdZeCSHrWWCbhFaZWykxB6mg4hUsNDLfpC5LTPK1C2A93SChZ4fG8LPbqJVkOCqJsHpxHx8+K4GI6tw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:13 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8293.000; Sat, 28 Dec 2024 01:15:12 +0000 From: "Peng Fan (OSS)" Subject: [PATCH 00/12] pm: Introduce devm_pm_set_wake_irq Date: Sat, 28 Dec 2024 09:14:36 +0800 Message-Id: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> X-B4-Tracking: v=1; b=H4sIAPxQb2cC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxNDIyNz3fLE7NT4zKJC3SQzixQzA5OUFEsDIyWg8oKi1LTMCrBR0bG1tQB /hX0mWgAAAA== X-Change-ID: 20241227-wake_irq-b68d604dd902 To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735348488; l=2428; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=KayTLg0Rpss1Xcxxs3o+LQMJcaWZRMXytsYCOw+QzIs=; b=MXcdJkhhjnB1OROKylILiFNT4gm1U7nz3Z+jLd1SkSuZ+537eZVCNCNQgIIujmKSGkGNrC75w iaDZij7p0gEC6AElT+fIQ9++x3sBWotIeTImqXFA8P410WyI+toMNBV X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 49689c47-6b4b-420b-7c40-08dd26dd142b X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?cHBBhC8LqNE3YcVVrT3rEG8YIm2lWSz?= =?utf-8?q?n6o0bdUkH9KP1Ynp+BCSQbTeX+D8htNeEivBLYRO7/RqF4n15phEYZMi1tGFRIy5G?= =?utf-8?q?2ZZ1zENkSLw526D9ynXXjGORKgURCLM6mYb+zV68QDMK+V0WPENDKFcJKt71v8CKX?= =?utf-8?q?KlnEs4dUPdDPaazVsYgTZzGqR8aPkyPi2o3T816WYuxSG/zH1NzNt8gpKWFxhKmYu?= =?utf-8?q?u6gFI6fHg2b64SZDgDzw27HvyuwVWhvFa8ZcBZAioO5YIcoA6aFGHFG6Ii+O8wIyx?= =?utf-8?q?aIQcQTp5gNdG7AZGZZHXBUegO16LGD8n+gJR0MCrYF3Xf93d6yGq2qjoUTTTiqbdu?= =?utf-8?q?76MqpQTuVUk20Ul1ArTGpHXxRPLQ3CM2h5UEEMD6Ak0kRi7dtcR6a86AOo5rfwV5R?= =?utf-8?q?uyNQxITb8UQxZemyDRLM1vFXBavwacQMNdMehb9uWD72LggDTji8O5awpQ8+5TF6W?= =?utf-8?q?YwoNzqARnKYy7WnEEsfWx5ucmmy/vbhVuRCipCVtDaySboywJPVBWfmAjoRJhAlqt?= =?utf-8?q?lhwJ5u5ZDVtCbXCtD8k/gY5hdxbgB5VvcbmFNPWSBpxTCoFc+fTisZ8cgQEy7dOR4?= =?utf-8?q?Md+7+C3oCe2NsU8rpJ4Ye/lIgBUKSo2uP9L37B/lsqXvU6wcSJsm8Py8u6gMjj+JS?= =?utf-8?q?q749D2x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:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Q3k1/jNJE3BSzBGlKbyd6SJOhXBu?= =?utf-8?q?OS3UD99YLm1VU1n2ln1/5PlYbi0XrDhQMYKM69LJe5hcNsh97kovCMniwbqaZFj1e?= =?utf-8?q?xq2s9tLbBgl7I2RF7esqqaaOBpYaf7RwWg3muXz76CP/ApAPJn8v2bD2dgk2e9qVx?= =?utf-8?q?ep4ranDrgV4lNTOCM1RIODMYtIUsXMFxERv3C3x21IDPJzoxV4B9qpWtB7DiMlSbl?= =?utf-8?q?An6mwjkkl/jgnttNuTgNat6ms0XgMYdsPs+C/n6yKPomqi2o5UGGIQvgFHbLOPZ86?= =?utf-8?q?M7gx/B1In4EQZzQdD82zuf54QbPkHpv0mRo+rvHizqf7z46clsEt7r2OLc8DT+a93?= =?utf-8?q?jCoFLZedEEdvMrXngWcHuWBa60lcCMxOe+l1Ye5p8rmNMqWCfqc88havKP/wK0IeW?= =?utf-8?q?iKnLCXr5QfgkK0SaYDFASXS2A5maIbbP92B5jEyonANu5c7WwUeyWUMgi5cs7jSZ/?= =?utf-8?q?Jb3FOERI0F0HE16lBlAOIB5D9/wh9kJrk7PCgEbe3hTKZ72gnKGhcujEVXIN9BBSt?= =?utf-8?q?uy3mPJAQl8ZfV6kIJ7mzdNrhNwqlOedwD6kuvzQS516mvrwPEDTpfZ0AotIuUSXF8?= =?utf-8?q?V38MCiDZKnh/kNAnLEwYDQp4iBt3dm3aNuT7l0NyEle6bqRQc/H8tl5wJa3zSgQN6?= =?utf-8?q?/FSdQAPaBSqPuMywY1IRnpfWvqbDGJTBrMBFFg3RgZBOoG7SA2cfx0P2RvfSlmrwS?= =?utf-8?q?t5v78PYGwhNsMZTAIJZnRij1YLH1SZTCNTcKfdqFdL3likK8rBtm7pVt9U7geuZMy?= =?utf-8?q?j7U7SRRyJ83swviGlWAH4W4AIEny06UjZrPGPN5vMd/wYTg9Yq1YM+bkmYmO26crS?= =?utf-8?q?9xHTic4CD+Sq869ivkgW3j+8/TO+gERHJN5GRyOwwq2s3Tz44aNMugjdz3Fg6oEsS?= =?utf-8?q?tVHNtuvXzxjfN8FO2c8eJNPFayjJ1ZDhI1Ya2BjVqMsToSPi4FZpG5nIJfQa49bvx?= =?utf-8?q?ifkw/VOryvIeA0of1d/VFfeEvrNRm3N1Mc7tkbS72r6Y8rUKoi4ZZHb8s+WlnEu42?= =?utf-8?q?gbRGLTT0IRA5Qozg/y3kCFC4SxfF/f3f/uOjnozURPfZf/wtAmr9CM0JGpWQGSml4?= =?utf-8?q?UYhKozLUWWuRoasNJwjUxNhzcHmbVM3FRTuwOja7ri3nhSp1Pft8LyTJiIMqo7MhY?= =?utf-8?q?HRDZwGtLOEPMey6oSGw/3lDEWBbuozxSmT2TdePmJh+h0JxyyLZnO1RnPQyGilHV5?= =?utf-8?q?Tccv+UAdpckFnBRFbv5O5RiK0SlJ4aIlvR1fkHfUauQ2VY5sR17JH6OwDc4a23WGQ?= =?utf-8?q?6PvGaxFydGRHyMzMLOdmLrAMotn6OYyqxJ5KIig8lHI5sPLEaHE7/2Yujl1tDDRDG?= =?utf-8?q?gHaNlwDDCmTBDE6MPbek+CjhKXs+Gbk86gRvsweAuR2lSeKJkzjHB6Il5+/NeNniz?= =?utf-8?q?uDZLssBO3BuvJcoKur3+G3mfMDjeDwbZCKoArqvnDhzU+itqngpkDHWsNfwGcLITx?= =?utf-8?q?9PeqMdytsNXYCsrATFRgtIZiqw70WnVoowSNr/sJ4Vhp8nEHBSSC/254HgjXQAZIU?= =?utf-8?q?M6e5IqYc8fzs?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49689c47-6b4b-420b-7c40-08dd26dd142b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:12.6751 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BqF/j5NVvH8yDgg/B7nZKR+p3VvW391XVJqGmOr4eJxRdLbSfW6kZbtBvYIAR1jMQpSUX9LCW7WL7cliIFYpdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171524_542354_C7994BEE X-CRM114-Status: UNSURE ( 6.55 ) X-CRM114-Notice: Please train this message. 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 This was a retry to address [1][2], to let common code handle dev_pm_clear_wake_irq. Then no need to call dev_pm_clear_wake_irq in each driver.remove() hook and error handling path. In this patchset, I include input and rtc patches to show the usage to avoid that introducing an API without users. There are still other places using dev_pm_clear_wake_irq. If this patchset is good for you, I could start to clean up other drivers such as mmc and etc. [1] https://lore.kernel.org/all/20241111092131.1693319-1-peng.fan@oss.nxp.com/ [2] https://lore.kernel.org/all/ZymxvLMkkktRoCXZ@google.com/ Signed-off-by: Peng Fan --- Peng Fan (12): PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq input: keyboard: ep93xx_keypad: Use devm_pm_set_wake_irq input: keyboard: omap4_keypad: Use devm_pm_set_wake_irq input: misc: nxp-bbnsm-pwrkey: Use resource managed API to simplify code input: touchscreen: ti_am335x_tsc: Use resource managed API to simplify code rtc: stm32: Use resource managed API to simplify code rtc: nxp-bbnsm: Use resource managed API to simplify code rtc: ds1343: Use devm_pm_set_wake_irq rtc: pm8xxx: Use devm_pm_set_wake_irq rtc: ab8500: Use resource managed API to simplify code rtc: mpfs: Use devm_pm_set_wake_irq rtc: pl031: Use resource managed API to simplify code drivers/base/power/wakeirq.c | 25 ++++++++++++++++++ drivers/input/keyboard/ep93xx_keypad.c | 8 +----- drivers/input/keyboard/omap4-keypad.c | 8 +----- drivers/input/misc/nxp-bbnsm-pwrkey.c | 15 ++++------- drivers/input/touchscreen/ti_am335x_tsc.c | 43 ++++++++++--------------------- drivers/rtc/rtc-ab8500.c | 11 ++------ drivers/rtc/rtc-ds1343.c | 8 +----- drivers/rtc/rtc-mpfs.c | 8 +----- drivers/rtc/rtc-nxp-bbnsm.c | 29 +++++++-------------- drivers/rtc/rtc-pl031.c | 6 ++--- drivers/rtc/rtc-pm8xxx.c | 12 +-------- drivers/rtc/rtc-stm32.c | 10 ++----- include/linux/pm_wakeirq.h | 6 +++++ 13 files changed, 70 insertions(+), 119 deletions(-) --- base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2 change-id: 20241227-wake_irq-b68d604dd902 Best regards,