Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934682AbbHLJTn (ORCPT ); Wed, 12 Aug 2015 05:19:43 -0400 Received: from mail-bn1bon0133.outbound.protection.outlook.com ([157.56.111.133]:32832 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933001AbbHLJTh (ORCPT ); Wed, 12 Aug 2015 05:19:37 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Dongsheng Wang To: CC: , , , Wang Dongsheng Subject: [PATCH v2] rtc/ds3232: fix ds3232 get a WARNING trace in resume function Date: Wed, 12 Aug 2015 17:14:13 +0800 Message-ID: <1439370853-32282-1-git-send-email-dongsheng.wang@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD005;1:mBpAPqkqXdiUX7fVe02ALXl+/JZmHzIFww9Wavphc3F69n9uYU3j/FdnMRpNCz+cuXz1MAy3i0po/wVEpy8udKC99Vp6VZRE2tNH6ld6LExk5h1eOp7emwPuegMwIlM5xEzrYmymox/xyXmg1bAMiBkfSKpHnGa5ZMKuOBkoGYPt/8c3oHoxDlD+0SN32iQo/tAhekrFBOk7pXbR12qb46mb/g4l/KRzRTSh9FfZ3CRQ+NzFYVFZLHlYKrSmuSsqBQ0MaV/v88Pbfe2N2O7RnySoq0YkyoKM3hmHRLP9VETzxaCrFVbem2nr+4qDkPm6eihP/LSoyzj/pZGcKZRyw9Ei5mwCM52ov9tX0eAlXhOn5+CCgh9iZ1xvaDZ2dGmhdO29lr4DPsaNeou1VZC3Aw== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(3050300001)(339900001)(189002)(199003)(5001830100001)(85426001)(36756003)(68736005)(69596002)(105606002)(50226001)(5001960100002)(229853001)(47776003)(6806004)(50986999)(92566002)(46102003)(19580405001)(86362001)(575784001)(5003940100001)(106466001)(77156002)(97736004)(77096005)(62966003)(81156007)(64706001)(19580395003)(87936001)(2351001)(110136002)(5001860100001)(33646002)(48376002)(50466002)(189998001)(104016003)(4001540100001)(107886002)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1612;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1612;2:8aZFnE6hjYEkXPKNutf3v5t4YrIqN4XWROFeZhUBC6XHvwsXarj6NfI+qLt1MrE7lxoiSwh7glI3Jw0u4WT8eVD4LPoWHQ3OZmLB5BVP/B8eyxE0bLxslLz/VgF/VEDjysm6sT+arqXpHkQ5rvh76lIQoDHfM/BO7YJBn1pmmN4=;3:P59/7XEcPSDt6L7CohR6Sj/hKP1k7N5U2NIVlJBZ4oD7bRRKufnZFMf+wPSx/3+EI/7WDJxhB6X/Bn5bkMfq0KSNPG40MMLjtNNbK1XOo2+nzCqm7Df8VCz7WUux6o/DxpYRQ6szNKKIrcx0VkUqlJfwMlOHcDW6kLHtmWXnHGbg06XxuCuglPa1+zoDUpJd24t6koN4TtYfweEKuDJOsX1Dgsmdy3QA9kOsEKA+PhA=;25:h5pt2A+Gk6tNobvPPo/FSqFgx1dZ3w8OzOmUi/7ild6Pb1EbQsT8hbUe6uGXRKuoYnI9X/glMLTDW7yKRQXRL1xkaCnuMKnKGmqvRdDbAzW0WxPVzSAC0BBwX38VWR7iwm7f2enUwYByPcP3M1w+BLM0zb7ZRVaTz5FgP1pntRbNg5QgTymk+4F96mN8M4Gm0ex8BoA5gcKt00dr0nDG0wWrdfGtt1/Vkq/GG08/KKrFgVyatwKkn6k4wYoH5kTy X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1612; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1612;20:Cbf8sAgDrdKLnY8oiyiIj1rnSCfrXRuDh3Uf4XH69X8K8FMzNvWv9oOI36Anp2udTQyFf6Iae7pkzF2B/ThEumuhbpfDh7AE8X5aJcBqvIdvafEKRuj5Pv7uOZ0GrpHkY4AvaSBozHjvaD40wdsxZCQ5Nm8+JGGOYOjYqd695aiPPQB8htvgJRiCYB+AaeBOpEJgmTB5kYA18Vvw+mI4aPnoq0T3W/CgXfpPd5xrqUAVX3T9isxYTawySrbxCyMdV/xpkVgkTajbuly8D1t8La87zp4DQ90wcxOUU13yRiRQ8yVA271VFW9r/LtGuldr4BUL8GTR/6Y9mjbkVegpZHUDQJpAA/hMywBUGwLjwcg=;4:EbzBEmVyjmzMfl+gquvOQYeNSijy5qBD2cvzGGAC9oKHBXrPNSyrdWfmJBkHAma2IqHx+MynwwompU5SFEB60OU2yj3jfP/m9AIw41AJvode3W6IgXpoTdYsr+dpZ53TzbtbRsrSHKZgIv94Q0S8UIqbpOKhkgLRF0B1MZ1bqolsYz7yqsbg+B5xfFDQUbrbU6XR4crX2EcMhZsP6J89yMviOqVIAKNZaA5uXxanmHCbmY+KXVDT/LxA4t7WPll0cWx/WuCDFJ1+1EtWfjHrudcDRVy0H8li8tSCmXWnOWg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR0301MB1612;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1612; X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1612;23:GfsrVZxwyaSogIIw7z34DxBLEM6CVy2fCvffql1?= =?us-ascii?Q?5gz27/7T5XWwTBbN6cjQnd21nCWDvJod4abfE/DOuUVoLJlzpVApopNhCJN7?= =?us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xlmvyoPKGpOBH3ZXA5dmFIy2EJ9KXD?= =?us-ascii?Q?6Aapba1OZBuAQ1tf9z9Dj5DW79sW88FMTpD6g3js2EqxHF4wMluZGIALzjGo?= =?us-ascii?Q?CGtv/NItnBc2gNuUZ034A+o2Qxwsslm4TqkyO8mB2ES0/Hhh8mmQu6qTahGw?= =?us-ascii?Q?g8Z+qcmT2rm4D1sT+L6qMy95NbreRF4fdqj5/OQ9oshVMjydLr5/bdw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1612;5:BELnux8FKKWZiNV/a1uXwrHxL7q4/sj6FNHGInao6dKE21rRpeEM0Snmhh7DgEmouBz428Cp4Dy4K8afXRV00oekvl1I/1k6SrDVZ0ceQJPHqc8+qPIvGAKEPtkN/X7nKtpcsBlhV8sEQcGl228gcg==;24:krSL2tOnvantyJOvE7eA4psVuep6DPc/MV+CWS4hbWpnwnCrYWgFaBE+FNR7MeTCuNBNew92GWhFSgAXr7XpcItAgbzJEt2tYJa4P5fT6KI=;20:aYzqvGrbpx2/eqMx2hfAoj71kOwIAEashDwwKtYRnxJL91S4TsAHyw7Vgm5eF9O0FpckmFjF86f5AiQiDGe4gw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2015 09:19:34.3746 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1612 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2822 Lines: 78 From: Wang Dongsheng If ds3232 work on some platform that is not implementation irq_set_wake, ds3232 will get a WARNING trace in resume. So fix ds3232->suspended state to false when irq_set_irq_wake return error. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 729 at kernel/irq/manage.c:604 irq_set_irq_wake+0x4b/0x8c() Unbalanced IRQ 201 wake disable Modules linked in: CPU: 0 PID: 729 Comm: sh Not tainted 3.12.19-rt30+ #25 [<800107d9>] (unwind_backtrace+0x1/0x88) from [<8000e4ef>] (show_stack+0xb/0xc) [<8000e4ef>] (show_stack+0xb/0xc) from [<802b5fa9>] (dump_stack+0x4d/0x60) [<802b5fa9>] (dump_stack+0x4d/0x60) from [<800186dd>] (warn_slowpath_common+0x45/0x64) [<800186dd>] (warn_slowpath_common+0x45/0x64) from [<80018717>] (warn_slowpath_fmt+0x1b/0x24) [<80018717>] (warn_slowpath_fmt+0x1b/0x24) from [<8003a8d3>] (irq_set_irq_wake+0x4b/0x8c) [<8003a8d3>] (irq_set_irq_wake+0x4b/0x8c) from [<80204fcb>] (ds3232_resume+0x2d/0x36) [<80204fcb>] (ds3232_resume+0x2d/0x36) from [<801954c7>] (dpm_run_callback.isra.13+0xb/0x28) [<801954c7>] (dpm_run_callback.isra.13+0xb/0x28) from [<80195b1b>] (device_resume+0x7b/0xa2) [<80195b1b>] (device_resume+0x7b/0xa2) from [<80195f0f>] (dpm_resume+0xbb/0x19c) [<80195f0f>] (dpm_resume+0xbb/0x19c) from [<801960d9>] (dpm_resume_end+0x9/0x12) [<801960d9>] (dpm_resume_end+0x9/0x12) from [<80037e1d>] (suspend_devices_and_enter+0x17d/0x1d0) [<80037e1d>] (suspend_devices_and_enter+0x17d/0x1d0) from [<80037ee1>] (pm_suspend+0x71/0x128) [<80037ee1>] (pm_suspend+0x71/0x128) from [<80037449>] (state_store+0x6d/0x80) [<80037449>] (state_store+0x6d/0x80) from [<800af4d5>] (sysfs_write_file+0x9f/0xde) [<800af4d5>] (sysfs_write_file+0x9f/0xde) from [<8007a437>] (vfs_write+0x7b/0x104) [<8007a437>] (vfs_write+0x7b/0x104) from [<8007a7f7>] (SyS_write+0x27/0x48) [<8007a7f7>] (SyS_write+0x27/0x48) from [<8000c121>] (ret_fast_syscall+0x1/0x44) ---[ end trace 640959d2e8de6ccc ]--- Signed-off-by: Wang Dongsheng --- *v2* - Use dev_warn_once to instead of dev_info diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 7e48e53..3554970 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c @@ -463,7 +463,10 @@ static int ds3232_suspend(struct device *dev) if (device_can_wakeup(dev)) { ds3232->suspended = true; - irq_set_irq_wake(client->irq, 1); + if (irq_set_irq_wake(client->irq, 1)) { + dev_warn_once(dev, "Can not set wakeup sources\n"); + ds3232->suspended = false; + } } return 0; -- 2.1.0.27.g96db324 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/