Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751616AbcDSELe (ORCPT ); Tue, 19 Apr 2016 00:11:34 -0400 Received: from mail-am1on0072.outbound.protection.outlook.com ([157.56.112.72]:24128 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750960AbcDSELd (ORCPT ); Tue, 19 Apr 2016 00:11:33 -0400 From: Qianyu Gong To: Akinobu Mita CC: "alexandre.belloni@free-electrons.com" , Mingkai Hu , "rtc-linux@googlegroups.com" , "linux-kernel@vger.kernel.org" Subject: RE: rtc ds3232 call trace in kernel Thread-Topic: rtc ds3232 call trace in kernel Thread-Index: AdGZMiaPR50pSmJwQj23G58uRE4gmQAQF4AAABwCjwAAA0dEgAAAPimQ Date: Tue, 19 Apr 2016 04:11:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [123.151.195.53] x-ms-office365-filtering-correlation-id: c8a2fcb0-6461-4eed-e1fc-08d36808af70 x-microsoft-exchange-diagnostics: 1;DB5PR04MB1448;5:/Vi7hsNp70apob0/ET1nDAU60uN2Grb7UmgHfOl5xrVIKJxFjod4ZmzItOlkKIQQYhDzQuko9JWjACwac3IZgvTVky/pN5Muhxdm3HU5TxIoRAVvYOsglwwmI8XpXGgCja3TEGE2o8IAI11D5WzuxUVzjjxevEssrZcHAWZ00XLR6HkgT/BLxtYmaIRqScW1;24:FHAGidp6MVkawls8KjgtsM7b8DG5SJqfwYplDw+jG40nzdG8v6UHQhhRwdLlFZWYInO7/qzLSWnKP2UKiAmE1YNE2ofuBYZSvTRH8VJFHo4=;7:Wjejg7Ge/IeJMnr9Go6hLh99IdlyWyw2xL8sbfJmqXnks5gK5/RL77oJlAwrws0tvtdBjrTEt8Hw6vn7rHS6kuen1y7fQsVaVZx+GVX8T72svIAMyrrcpLpGYsG+SWhHOD8Pl1ueog2dNt/iPH4lQuSqUoIwTVe7O6ynxc3B1hB83qUwWlj+dRTomFt49dr/81PWF+8lm3vPKK7DMYZ6y5pitqRl/3AYuS1i0wmpJFE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1448; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:DB5PR04MB1448;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1448; x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377424004)(13464003)(377454003)(51874003)(5002640100001)(87936001)(2906002)(92566002)(110136002)(122556002)(189998001)(77096005)(5008740100001)(586003)(5004730100002)(1096002)(6116002)(2900100001)(3280700002)(2950100001)(102836003)(3846002)(5003600100002)(33656002)(11100500001)(1220700001)(66066001)(4326007)(76576001)(81166005)(93886004)(10400500002)(50986999)(76176999)(54356999)(86362001)(74316001)(575784001)(3660700001)(19580395003)(19580405001)(9686002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR04MB1448;H:AM2PR04MB0964.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2016 04:11:30.0559 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1448 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u3J4Beti024264 Content-Length: 2723 Lines: 93 > -----Original Message----- > From: Akinobu Mita [mailto:akinobu.mita@gmail.com] > Sent: Tuesday, April 19, 2016 11:58 AM > To: Qianyu Gong > Cc: alexandre.belloni@free-electrons.com; Mingkai Hu ; > rtc-linux@googlegroups.com; linux-kernel@vger.kernel.org > Subject: Re: rtc ds3232 call trace in kernel > > 2016-04-19 11:36 GMT+09:00 Qianyu Gong : > > > >> -----Original Message----- > >> From: Akinobu Mita [mailto:akinobu.mita@gmail.com] > >> Sent: Monday, April 18, 2016 9:02 PM > >> To: Qianyu Gong > >> Cc: alexandre.belloni@free-electrons.com; Mingkai Hu > >> ; rtc-linux@googlegroups.com; > >> linux-kernel@vger.kernel.org > >> Subject: Re: rtc ds3232 call trace in kernel > >> > >> 2016-04-18 15:15 GMT+09:00 Qianyu Gong : > >> > Hi Akinobu, > >> > > >> > > >> > > >> > I got an rtc call trace when booting 4.6 kernel on our board and I > >> > found it > >> > > >> > was caused by this patch: > >> > > >> > > >> > > >> > commit fc1dcb0b39dbb10d3290f2fcd6e154670f699166 > >> > > >> > Author: Akinobu Mita > >> > > >> > Date: Mon Mar 7 00:27:53 2016 +0900 > >> > > >> > > >> > > >> > rtc: ds3232: use rtc->ops_lock to protect alarm operations > >> > > >> > > >> > > >> > ds3232->mutex is used to protect for alarm operations which > >> > > >> > need to access status and control registers. > >> > > >> > > >> > > >> > But we can use rtc->ops_lock instead. rtc->ops_lock is held > >> > when most > >> > > >> > of rtc_class_ops methods are called, so we only need to > >> > explicitly > >> > > >> > acquire it from irq handler in order to protect form concurrent > >> > > >> > accesses. > >> > > >> > > >> > > >> > Signed-off-by: Akinobu Mita > >> > > >> > Signed-off-by: Alexandre Belloni > >> > >> > > >> > > >> > > >> > The problem is that rtc->ops_lock would be accessed in ds3232_irq() > >> > > >> > without being initialized as rtc_device_register() is called too late. > >> > >> You have already identified the root cause of this issue. > >> > >> > As I’m not familiar with rtc things, could I just revert the patch > >> > or you already > >> > > >> > have a solution to this problem? Thanks in advance. > >> > >> Could you check if the problem is resolved by moving the call of > >> devm_rtc_device_register() from the end of ds3232_probe() to just > >> before registering irq handler? > > > > Yes. It works(no call trace now). > > Thanks for testing. Do you mind submitting your patch to rtc- > linux@googlegroups.com ? No problem.:) Regards, Qianyu