From nobody Sun Nov 24 16:09:57 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CD6E33EA; Mon, 4 Nov 2024 03:05:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730689514; cv=fail; b=bmeAGhRjxxgs02IcGBBz38T3J3XWfYYOjRQ0Y1Vm3bdvo/f2Byxgvb4hZeruFaUq+37Ubr7Bl2sGgbuOubSQy965LH9iTVfExjkhn+B5bBpf9HQJ92NavfJgMsU7TFlcTuyzpvGlnPHN3Ip6zUMWx1PFxol/ubjFOis7ZLOz15Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730689514; c=relaxed/simple; bh=Q0cSdsU5fQ4FXbAANYnewAJ/D0o/SlYcvBT/bdf+0zE=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=cnPjNDzIQfnVKTaIQ3PIcaWISdPMbN6Lj2xoMxDNW2LAum0567jj+C3uDzPl+4eaZq0GTpI3KJKVa6V8Zbo9a6DKjSX9NXU5wRCvBHsLPgZNV5qxH3pQN07785Bkj2O1ANDSs1pwMKkp45Cml796jAKLLaNOcRuoWucTWbgf7co= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=OwWOU0B4; arc=fail smtp.client-ip=40.107.20.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="OwWOU0B4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AnEv8ktfpjBSpUsb+sWB3gk1jfonhSifOqsnGTO4LyFmlU1QGITebEweWXatDN6SH2w0UYbx8oHt9QF0zYKRsOkoGtGV9azcBxzN9gVB7wB4hlpMFIft3R7lSpiGrGAxLfj69lckOTe1BxOQavEyhNks+yO09BEKM0SsT6h1RGhNvTwiru989GeSZLjJ3H6XO1+KL+vLWn9KSv8Nzls/DGgMttaHLa60+yqwAKUUsVY8qdrWkXKEjpeKsq+Q2ptMfJ3YqpSH75zP+AGUUsZgRhqNdBsOE4qQfCnDPyvzX7gMCsrMnkLT0841H4LRsTLYnLe7LWOvFX63BrjmCXeBDA== 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=kJIroeFsW05/wvozpUgHOD/HPVEMqSAsDuUt0crPWXc=; b=USUe08rnTOHxMXcqwDWv0Am2NQ27UHHUM3uHnoXkb5GxuDTEa78CaUEOR6I3Fdyc9BgDOLqqcyi+P93DfPn2ZG1hc5PDKSLOFiKaeflz6xVtzeeMNNGBWo01HJmSOrJ8ctoL4ARFh8H5TGizi1LWElzeovUkZQuh63WRI3WjDwC1YOZoM45k3yXvkz6uF7n41tyShGkd5XAmFCcfAVVOl2j89PltAdfVU+6YLYTnm0ZaCQNd1rLiCfrxWCv2FS+5/Ya4m+dSlK2LruNmUShKZAqAW1DfyJf9FsKcL/jWukixPzpcH8cOO2dg6IFd++Ek3PasxbT+nqNdULJ4pps4sA== 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=kJIroeFsW05/wvozpUgHOD/HPVEMqSAsDuUt0crPWXc=; b=OwWOU0B42lZ1+QWEni5kEIgEni+ihE2wele01lm5ohXDWYCTpoq3s/pAUmhsa+ETdl5DbCfICzYaBhsRBv4G/muwbBKRlgCNdiUI1TNJwuxZ4qXJJhrlWiG2MRc2qBMsDn4jaweFu5cK2B6wCm9LzrfuiDd/7Yeb3J5+Dfca5dKujjw0S+rEcxwd2oh05aa/3WAywm939MRso4Dzv+d5I9hJCVM6VWHYyAXQnfl+i6ihO24e1aobtI7EJ+QqmN8rj/3/+KaY5xNabiz1DOMvwoMGQX1vdV9hxOk7qiXOeFf4+PFn4DMqogNcCaaPQOG9vpTdX+Y66rc+PMyTH56aCw== 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 DU0PR04MB9276.eurprd04.prod.outlook.com (2603:10a6:10:357::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29; Mon, 4 Nov 2024 03:05:08 +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.8114.028; Mon, 4 Nov 2024 03:05:08 +0000 From: "Peng Fan (OSS)" To: Alexandre Belloni , Jacky Bai , Peng Fan , linux-rtc@vger.kernel.org (open list:REAL TIME CLOCK (RTC) SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Cc: Christophe JAILLET Subject: [PATCH V2] rtc: bbnsm: add remove hook Date: Mon, 4 Nov 2024 11:15:12 +0800 Message-Id: <20241104031512.3474790-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SG2PR03CA0115.apcprd03.prod.outlook.com (2603:1096:4:91::19) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|DU0PR04MB9276:EE_ X-MS-Office365-Filtering-Correlation-Id: 75f9b69f-823a-45f0-4da0-08dcfc7d7d22 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|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KMh6H+PDGXLqabe9m49pM3aHVmNUEkAGHdVaFV2urEf9NNCpQmcljqgYUD+V?= =?us-ascii?Q?eruP5p7iF/adiC3wkz5QJQpNx9OudWwkYOoPiuK1YekhkqtfPLntQhTxLDk9?= =?us-ascii?Q?9zSqGkiVhrwu657yM5shjTTI4nnNWOMDVB/qjqmGsH8YeA6jKHM3Lxl45F39?= =?us-ascii?Q?eF2SIPZ3y9SR2QtNQU+JnkXf/nRRKh7ROjPRCKa1cSlUh2ZZHgWmmOtqwNPM?= =?us-ascii?Q?67p1aasW0sTbZpX9qmoPsuQ8FgSXQpUKpgFD+FfHL7wQIl8SFAN/Rn9oALqu?= =?us-ascii?Q?aJ/jH7PI114sdnkh8Bef9ifIWQ2c2affBQdQbkACsZblpN3l2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z9/qu5O8Ow4Ft+kxIVquUzv+QgjG5l?= =?us-ascii?Q?7rQnxgushAJW18lto42CxB3R0uz2iEJ1RCbC/+8szU2h7/Adb6/qifhX/dkB?= =?us-ascii?Q?OOGODDENMQ29Bd2/QQzsyNctvJ6iPaHgdd2cXoWBSnr0R74tiSs2ecNH7b3A?= =?us-ascii?Q?R3/kHfg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?RcsMZhmYzmFbulMl5Nja/CDk14aOp4LXMOuB3wp8bFRIrCEAlJVIEW1KGGD9?= =?us-ascii?Q?YB7j1a91Bs6cs4fK5WvvrFIg8CAvfwnwq6r1kfvWH5Cqc9otOUC9ZSz3RyDC?= =?us-ascii?Q?UyprJa8zKfTGCixlJ9da8B+L+l+4lkPDuqbma4T1/7iS8j82XN2XclJG8KZ9?= =?us-ascii?Q?wp0xShgrp+RB/ASxBltWKANJixGSj3MCmSJ884lWQvMkqgtDYGS0vcMh0rlI?= =?us-ascii?Q?ahsSNiZmIWnnOjxy8Ir334lhwYjPJvPcHfMqvOpThAq4Pesi+I1kAWCpL4ZX?= =?us-ascii?Q?NcOFiio2G9yIN1CmKnh8aMiQputPqaszb3TS7gfZN10ky5npGGccZktwYb0y?= =?us-ascii?Q?cumfWkL299VIkOY7L/alpvqeINoNH5xOV18c8p1qqwoPXlqUmyE5kLbMgKnz?= =?us-ascii?Q?+gFZtcLZjmMuk6Z0jWFiAXF6NUZwR05C9o1CaLJfQFiyKmRnZ3Jmcn8xTprx?= =?us-ascii?Q?fb0E/sfxrOZBGMeofkL2CpcbKSX4EO02Q9gLfRqHMndFzzgL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YOvFB19jZsmbj4tgl2Xuu/QLr+p2822PL9+vrPqWkEoRTxaDF2ztM?= =?us-ascii?Q?ccn0UJtHh/pqH6uaQK9GfqOMUHL309M9hijtTbQl/XWZiGR9tRvy91ax1NrE?= =?us-ascii?Q?CzMuVH9Sm5iuc3jib3vaA0TW8xcN/lfaB583d/RTWHYMOL78w57oryhkTlM7?= =?us-ascii?Q?7FcQ40bwPwBPfUNz2/5J3LZ4Lt0ctd53TviUenmJ?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75f9b69f-823a-45f0-4da0-08dcfc7d7d22 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2024 03:05:08.3028 (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: eUvtL/rwkZxMb+c4umP3LmTm2MRSeqP+uSpUlGXwsh8f/6tzPtWLRTq84GFdU6zF6CL4GUJDRX4NWE+m2hE3jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9276 Content-Type: text/plain; charset="utf-8" From: Peng Fan Without remove hook to clear wake irq, there will be kernel dump when doing module test. "bbnsm_rtc 44440000.bbnsm:rtc: wake irq already initialized" Add remove hook to clear wake irq and set wakeup to false. Fixes: eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support") Cc: Christophe JAILLET Signed-off-by: Peng Fan --- V2: Per Christophe JAILLET Use remove, not remove_new Fix error handling in probe drivers/rtc/rtc-nxp-bbnsm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-nxp-bbnsm.c b/drivers/rtc/rtc-nxp-bbnsm.c index acbfbeb8b070..31225baddadf 100644 --- a/drivers/rtc/rtc-nxp-bbnsm.c +++ b/drivers/rtc/rtc-nxp-bbnsm.c @@ -197,13 +197,30 @@ static int bbnsm_rtc_probe(struct platform_device *pd= ev) if (ret) { dev_err(&pdev->dev, "failed to request irq %d: %d\n", bbnsm->irq, ret); - return ret; + goto err; } =20 bbnsm->rtc->ops =3D &bbnsm_rtc_ops; bbnsm->rtc->range_max =3D U32_MAX; =20 - return devm_rtc_register_device(bbnsm->rtc); + ret =3D devm_rtc_register_device(bbnsm->rtc); + if (ret) { + dev_err(&pdev->dev, "failed to register rtc :%d\n", ret); + goto err; + } + + return 0; + +err: + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); + return ret; +} + +static void bbnsm_rtc_remove(struct platform_device *pdev) +{ + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); } =20 static const struct of_device_id bbnsm_dt_ids[] =3D { @@ -218,6 +235,7 @@ static struct platform_driver bbnsm_rtc_driver =3D { .of_match_table =3D bbnsm_dt_ids, }, .probe =3D bbnsm_rtc_probe, + .remove =3D bbnsm_rtc_remove, }; module_platform_driver(bbnsm_rtc_driver); =20 --=20 2.37.1