From patchwork Thu Oct 5 14:18:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Vellemans, Noel" X-Patchwork-Id: 9987309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6065602B8 for ; Thu, 5 Oct 2017 14:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97B2228C41 for ; Thu, 5 Oct 2017 14:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C89A28C92; Thu, 5 Oct 2017 14:19:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9AE2C28C41 for ; Thu, 5 Oct 2017 14:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :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=HaoGeJpc8lCABtccPwUcNHV4o5vHPHXtk2dbDVWJLO8=; b=mx1zJL32Ru05x6 2NbaHshbqR66JykU7StwChiQkvmdESZf/XYwwWWAaUR1btgl5nBPu6JAWeKRXe38E9LyZRk5Z290K mE1I1DUyQbWOwCVmVZ/eTsXu1lOcntpHL2qR754dY/LdnsPdiMrrwqOKDya++cXw3MoYWy+kptbPm WQcEimowKQ8ynCzPUMeQudNRZFeZM6KRKMWX7t82KphhFweFa1wzOQEX/7RbcGwFFBwyEPl50KCrl m2DYlr2xD9BlQTkJ+b0wA2AGBfWOGw2aBvxDGKLlc363P4GzYAcS3zsWUjUH7KD4Yq00cP4hpcUE7 AsQDbUYlWOJrDKCZuHeA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e06zU-0002Rz-KT; Thu, 05 Oct 2017 14:19:08 +0000 Received: from mail1.bemta6.messagelabs.com ([193.109.254.114]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e06zQ-0002O6-5e for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2017 14:19:06 +0000 Received: from [85.158.140.211] by server-10.bemta-6.messagelabs.com id 97/16-03642-93F36D95; Thu, 05 Oct 2017 14:18:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIIsWRWlGSWpSXmKPExsVyuG3OGV1L+2u RBue/s1psenyN1eLY6itsDkwem5fUe3zeJBfAFMWamZeUX5HAmrG1oY2x4L5ZxZp7OxkbGFvM uhi5OIQEljJKbD+wkbWLkRPImcUoceByGIjNJmAmsWz2GSYQW0QgSOLxrT1gNrOAtcSuTYvB6 oUFtCU+XPnPBlFjIDHx+Rt2CFtPYtr/O0D1HBwsAioSt1/pgYR5BXwk5jU/ZwaxGQVkJfpOHG GDGCkucevJfLDxEgICEkv2nGeGsEUlXj7+xwphK0j8Or6YHWQks4CmxPpd+hCtihJTuh+yQ4w XlDg58wnLBEahWUimzkLomIWkYxaSjgWMLKsYNYpTi8pSi3SNjPWSijLTM0pyEzNzdA0NzPRy U4uLE9NTcxKTivWS83M3MQIDngEIdjD+mR94iFGSg0lJlDfV9lqkEF9SfkplRmJxRnxRaU5q8 SFGGQ4OJQneZSA5waLU9NSKtMwcYOzBpCU4eJREeJntgNK8xQWJucWZ6RCpU4zGHDNu3v3DxP Hk2ry/TEIsefl5qVLivPtBJgmAlGaU5sENgqWES4yyUsK8jECnCfEUpBblZpagyr9iFOdgVBL mFQRZyJOZVwK37xXQKUxAp8xpugJySkkiQkqqgdFEufR/pW6Blw234cZwOU6m18d8PTz+he08 ZfjbYUP+uWWqBfWBnnt2r1oRYJPZ12R0+GnQ3pu2IfI+C6V4pu6MKb77XLpoCtPTFw9mLituX S1SvWrj38WFmz8m/HqxdmNMcLx/vvwu2bSIPzcMla575TlMDvDgOt3qen1tbctW244Nwp/Szy ixFGckGmoxFxUnAgA5zBCzBAMAAA== X-Env-Sender: noel.vellemans@visionbms.com X-Msg-Ref: server-9.tower-194.messagelabs.com!1507213112!115509685!1 X-Originating-IP: [195.134.156.204] X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16151 invoked from network); 5 Oct 2017 14:18:33 -0000 Received: from gateway.loepfe.com (HELO wetsrvsepp01.loepfe.com) (195.134.156.204) by server-9.tower-194.messagelabs.com with SMTP; 5 Oct 2017 14:18:33 -0000 Received: from wetsrvex01.loepfe.com (wetsrvex01.loepfe.com [10.55.2.117]) by wetsrvsepp01.loepfe.com (Postfix) with ESMTPS; Thu, 5 Oct 2017 16:18:32 +0200 (CEST) Received: from WETSRVEX01.loepfe.com ([10.55.2.117]) by wetsrvex01.loepfe.com ([10.55.2.117]) with mapi id 14.03.0361.001; Thu, 5 Oct 2017 16:18:32 +0200 From: "Vellemans, Noel" To: "linux-arm-kernel@lists.infradead.org" Subject: DryIce , RTC not working on imx53. Thread-Topic: DryIce , RTC not working on imx53. Thread-Index: AdM95Ju6zaN64kiYSMyw0qIdNzTo/w== Date: Thu, 5 Oct 2017 14:18:31 +0000 Message-ID: Accept-Language: en-US, de-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.60.20.139] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171005_071904_391689_2CFA9F04 X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-rtc@vger.kernel.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, DryIce , SRTC not working on imx53. ( kernel 4.x)  ( same hardware running older kernel versions.. means , rtc is working) During boot all seems to be fine but once you try to read or write the hardware clock later on … it bails out with this error on the console. hwclock [ 97.186577] imxdi_rtc 53fa4000.rtc: Write-wait timeout val = 0x5a2ff8d3 reg = 0x00000008 Hwclock : select() to /dev/rtc0 to wait for clock tick timed out: No such file or directory I've Added some driver – printk’s…. # hwclock [ 73.362559] dryice_rtc_read_time ------------------------------------------------ [ 73.395077] dryice_rtc_read_time ------------------------------------------------ [ 73.414156] dryice_rtc_read_time ------------------------------------------------ [ 73.421700] di_write_wait ------------------------------------------------ [ 73.472624] di_int_enable ------------------------------------------------ [ 73.514609] imxdi_rtc 53fa4000.srtc: Write-wait timeout val = 0x5a3000c8 reg = 0x00000008 [ 73.523019] di_int_enable ------------------------------------------------ << STALLS for 5 seconds here >> << STALLS for 5 seconds here >> << STALLS for 5 seconds here >> << STALLS for 5 seconds here >> << STALLS for 5 seconds here >> hwclock[ 78.584909] dryice_rtc_alarm_irq_enable ------------------------------------------------ : select() to /dev/rtc0 to wait f[ 78.593456] di_int_disable ------------------------------------------------ or clock tick timed out: No such file or directory Strace .. logging ================================ stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0777, st_size=25300, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0xb6f04000 set_tls(0xb6f04490, 0xb6f04b38, 0xb6f07088, 0xb6f04490, 0xb6f06f74) = 0 mprotect(0xb6ed2000, 4096, PROT_READ) = 0 mprotect(0xb6f06000, 4096, PROT_READ) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 gettimeofday({1513095430, 708097}, NULL) = 0 getuid32() = 0 open("/dev/rtc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/dev/rtc0", O_RDONLY|O_LARGEFILE) = 3 brk(0) = 0x18000 brk(0x19000) = 0x19000 stat64("/etc/adjtime", 0xbeec26a8) = -1 ENOENT (No such file or directory) ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0 select(4, [3], NULL, NULL, {5, 0} << STALLS for 5 seconds here -- select is not returning !!! timeout is 5 seconds…. >> ) = 0 (Timeout)[ 141.766162] dryice_rtc_alarm_irq_enable ------------------------------------------------ write(2, "hwclock", 7hwclock) = 7 write(2, ": ", 2: ) =[ 141.782195] di_int_disable ------------------------------------------------ 2 write(2, "select() to ", 12select() to ) = 12 write(2, "/dev/rtc0", 9/dev/rtc0) = 9 write(2, " to wait for clock tick timed ou"..., 33 to wait for clock tick timed out) = 33 write(2, ": ", 2: ) = 2 write(2, "No such file or directory", 25No such file or directory) = 25 write(2, "\n", 1 ) = 1 ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0) = 0 close(3) = 0 exit_group(74) = ? QUICK analyses ( could be wrong) ? It seems that hwclock is reading the current-timestamp 3 times and if not changed in those 3 read cycles… it sets up an read-interrupt-abort able time reader that should return as soon as the irq fires… but this seems to be missing ! FYI: I’ve been using following commint to enable srtc. commit 5b725054147deaf966b3919e10a86c6bfe946a18 Author: Patrick Bruenn Date:   Wed Jul 26 14:05:32 2017 +0200     ARM: dts: imx53: add srtc node          The i.MX53 has an integrated secure real time clock. Add it to the dtsi.          Signed-off-by: Patrick Bruenn     Signed-off-by: Shawn Guo diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index 2e516f4..8bf0d89 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi @@ -433,6 +433,15 @@                                 clock-names = "ipg", "per";                         };   +                       srtc: srtc@53fa4000 { +                               compatible = "fsl,imx53-rtc", "fsl,imx25-rtc"; +                               reg = <0x53fa4000 0x4000>; +                               interrupts = <24>; +                               interrupt-parent = <&tzic>; +                               clocks = <&clks IMX5_CLK_SRTC_GATE>; +                               clock-names = "ipg"; +                       }; + Best Regards Noel