From owner-freebsd-arm@freebsd.org Tue Apr 26 07:43:57 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10FEB1CB31 for ; Tue, 26 Apr 2016 07:43:57 +0000 (UTC) (envelope-from jau789@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5925C17E6; Tue, 26 Apr 2016 07:43:57 +0000 (UTC) (envelope-from jau789@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id u206so20420641wme.1; Tue, 26 Apr 2016 00:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=cjU+F/tf5+lWNG9RburInubY/BVVWysj+ZFLb+lYHKQ=; b=zTfCvNwspl0YPDag+6j34o1u5ZklcWPaBjIafrX5VpjIDg5yk2cjWgOKRGoXnvCOjo kYh9151vyE0Z2lk7rPxfYLTK2rxa1lDDuKP5PBykV5bQkbtHQagUElCBPW1ISDYjr8lp LLP6EvsW7spfZNoMkgT70qvOYLJxXzV40SfHxVNxIOV2ffEi7xTdkyBb23goaX1/4QzP f7EFYySVPWyOhTMGf5iboKU4q8dnZDKNiLEQ+UVuOxnC4fVzlxj0VyG+bP8uSAtM2MnN QZGJwYFY2gsCbS8RP2et+FVj/4CL0BbM928kCk0ZuD/KiARuwAS2KJPTclBLHRuZ1mzZ h8bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cjU+F/tf5+lWNG9RburInubY/BVVWysj+ZFLb+lYHKQ=; b=VAeCh2xTK0meM1o4ElJ+0uwRQt9uBQGn2uS4IOQJMhTlv/FnLb3IiNFfqJ2wqSc8gM ohRpYtNWfbA6FcbQDsZc4pIMRv7sw3lh/AukgcuzIbhLnOKOreLXj5A1i7oENOFRxnu4 qsFO5rYt6dKQjEJ570P/JkG04NInXkPFSXQdJuxzJdEXagJcbUw02RjD6rttNPUZTil2 zNcBfkYn8qbHvcqziVwKiil9DGCqGaS12N76zrQQ0q5/Dzp5ZFHIk3Blqt7FUDS0ALDg SxnmxeSihAu9O+2twSINJvgFwDRogtS0j5eH6S5IylndN8HFFslGzjYfR+pHTFjXesH+ Tb2w== X-Gm-Message-State: AOPr4FX+WUIRN8h2EyQtjGl67xuaEt78M3/hfjbnOwpaZuSaD3Yahuj3jl1xslULf4C0og== X-Received: by 10.28.48.203 with SMTP id w194mr1927724wmw.67.1461656634389; Tue, 26 Apr 2016 00:43:54 -0700 (PDT) Received: from [192.168.1.131] (xdsl-205-1.nblnetworks.fi. [83.145.205.1]) by smtp.googlemail.com with ESMTPSA id 8sm22587391wms.14.2016.04.26.00.43.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Apr 2016 00:43:53 -0700 (PDT) Subject: Re: Mystical panic when RPI2 is left idle for a while To: Ian Lepore , freebsd-arm References: <571CA5AD.1090800@gmail.com> <1461516061.1191.49.camel@freebsd.org> From: "Jukka A. Ukkonen" Message-ID: <571F1C38.4080106@gmail.com> Date: Tue, 26 Apr 2016 10:43:52 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1461516061.1191.49.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 07:43:57 -0000 On 04/24/16 19:41, Ian Lepore wrote: > On Sun, 2016-04-24 at 13:53 +0300, Jukka A. Ukkonen wrote: > >> I have a faint recollection that some others have also said >> their RPI2 panics when it is left idle for too long. >> Mine has been giving me those little surprises quite regularly, >> but until I got a 3,3V serial console cable I have had no >> chance to debug the problem any further. >> I hope the attached backtrace is more informative to someone >> else. All I was able to understand was that some process >> apparently tries to sleep while it is not allowed to do that. >> Maybe it is holding some locks or semaphores or something, >> and does not release them before trying to sleep. > > Based on resettodr() appearing in the backtrace, I'm going to guess > that you have an i2c-based realtime clock chip on the system? If so, > that's the root of the problem, it gets automatically updated and the > kernel can't tolerate sleeping during the process, and i2c drivers > usually have to sleep as part of talking to their devices. > > You can work around it by adding > > machdep.disable_rtc_set=0 > > to /etc/sysctl.conf. But that disables keeping the RTC up to date (I > think it still gets updated when you manually set the time, but I'm not > sure of that). > > It's on my slow-motion to-do list to fix the resettodr() function, but > doing so is complicated and affects every arch, so I never quite seem > to find time for it. That was a splendid guess. There is a ds3231 RTC attached to this RPI2. Checking the current sysctl value I see this... # sysctl machdep.disable_rtc_set machdep.disable_rtc_set: 0 Should it be the other way around, perhaps? machdep.disable_rtc_set=1 At least the naming of the variable kind of seems to be hinting that. And after a bit of testing the box now seems to be up and running, though, it was totally idle for some 15 minutes or so. Previously roughly 15 min of idle time has been quite enough to drive the system to panic. --jau