Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbcDSCvs (ORCPT ); Mon, 18 Apr 2016 22:51:48 -0400 Received: from mail-am1on0072.outbound.protection.outlook.com ([157.56.112.72]:13376 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751756AbcDSCvr (ORCPT ); Mon, 18 Apr 2016 22:51:47 -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: AdGZMiaPR50pSmJwQj23G58uRE4gmQAQF4AAABwCjwA= Date: Tue, 19 Apr 2016 02:36:05 +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: dedec1a9-9f69-470f-5625-08d367fb5b66 x-microsoft-exchange-diagnostics: 1;AM2PR04MB0964;5:/UvpQDV82681bEOPHAW0z3IQNg4EBSRqFX2B+rftUVVpRinqER0gMwmAhLjtJymR2UsHsqKaY4fZlFqvxYQYY0l3KTcIDWSdp2JJJ/fEG2sG441jD3EwmnayzsHc1KxzgmDw33F0bJs8YVvrblDsCIIcEDr350ABoeuvQtR0GsDdpsFIV72trllTfk6lHBDI;24:+g1T9qL1pftJznd/Djds0WOgzO/anP4yrqDVf5f3YERa7Lohh7r0/K/8FsOTeFha/ET1BsuUFvdlFENkn2OA3REV9Ej0Dgjftd3kze5OKfA=;7:ZY2UAmiZ+fDBu7KMHsEGjWQ80AwnQGlPEiUtdUZ77Q29EKjMxMIZ2me97g9bwsplkqvVfeQ512G0YiJHPudagNPXyKaZ396IowjoUJQRjqNdDXePHBeODtXqxRr+wtPqUBzlTZLc5G7PmiM8bHoBpI514S9GM/Zu2wC1/7YindmpF3gnHiLbpE9R839U0sgvwEY1BG/yHWZWO4XTuf1jrW27+Zbp6z3Alo4Du9D32Lc= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR04MB0964; 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)(3002001)(10201501046)(6055026);SRVR:AM2PR04MB0964;BCL:0;PCL:0;RULEID:;SRVR:AM2PR04MB0964; x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(13464003)(51874003)(377454003)(377424004)(3846002)(5002640100001)(3660700001)(76576001)(102836003)(6116002)(5004730100002)(5008740100001)(122556002)(5003600100002)(189998001)(2906002)(110136002)(586003)(3280700002)(50986999)(1096002)(87936001)(1220700001)(92566002)(77096005)(2950100001)(2900100001)(54356999)(76176999)(9686002)(575784001)(4326007)(66066001)(33656002)(74316001)(86362001)(19580405001)(10400500002)(81166005)(19580395003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM2PR04MB0964;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 02:36:05.5851 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0964 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 u3J2psJD024129 Content-Length: 1968 Lines: 75 > -----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). Regards, Qianyu