From patchwork Mon Jul 9 10:28:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 10514239 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 27DD660318 for ; Mon, 9 Jul 2018 10:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A93F28A85 for ; Mon, 9 Jul 2018 10:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EAC228A8B; Mon, 9 Jul 2018 10:29: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 A6C7128A85 for ; Mon, 9 Jul 2018 10:29: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-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Yjc4UgGpy6pldphrfPhhNFAIbaITZj2ZtEhnHEJKRQc=; b=cC3Vr9HpAA8sHV3+Fkz0s8dRY DowlXCrPG3uZ178MvwVVR8LTBxq+McY/6apw23lSaaXqRTU+/LkZDWHktRdARKwl3aMiNiltveuyB eXNPg4J9vv12suuFr4YRvvNyDUjm94HhO+cZyd7ou2bmJ7RGKu4qz0hTlT65WHeyOtiB0gOwyi9B9 PulA9jFqYQRuLyqBgDp/XF7UT6ACObjKlW+0N5xG1ACnhqB21bgVAzDYPHGCZZdEFxsCKP6KO9oUj 2gByZOlxw96WUhHfyBevzCnX8QrOaDBST2zsT6xdFxYDTdLWx0hJGx8D+XIhVUGv4snG2WCCga1Gj nOrRzBD4w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcTPq-00014y-18; Mon, 09 Jul 2018 10:29:10 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcTPm-0000gU-CP for linux-arm-kernel@lists.infradead.org; Mon, 09 Jul 2018 10:29:08 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 039A880354; Mon, 9 Jul 2018 12:28:52 +0200 (CEST) Date: Mon, 9 Jul 2018 12:28:52 +0200 From: Pavel Machek To: kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, tony@atomide.com, sre@kernel.org, nekit1000@gmail.com, mpartap@gmx.net, merlijn@wizzup.org Subject: Re: droid 4 in v4.18-rc: grep -r adasfasd /sys/ oopses Message-ID: <20180709102852.GA20580@amd> References: <20180708174939.GA10002@amd> <20180708193720.GA13262@amd> MIME-Version: 1.0 In-Reply-To: <20180708193720.GA13262@amd> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180709_032906_737276_2A984C00 X-CRM114-Status: GOOD ( 17.02 ) 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: andriy.shevchenko@linux.intel.com, "Rafael J. Wysocki" , Linux-pm mailing list 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 Hi! > > grep in /sys produces a nasty oops: > > > > I guess next step is trying to find out which file that is.. > > Let me see... > > openat(6, "suspend", > O_RDONLY|O_NOCTTY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW) = 4 > fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 > read(4, 0x4d2000, 32768) = -1 EINVAL (Invalid argument) > write(2, "grep: ", 6grep: ) = 6 > write(2, "/sys/kernel/debug/pm_debug/cefus"..., > 47/sys/kernel/debug/pm_debug/cefuse_pwrdm/suspend) = 47 > write(2, ": Invalid argument", 18: Invalid argument) = 18 > write(2, "\n", 1 > ) = 1 > close(4) = 0 > close(6) = 0 > openat(5, "time", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW) > = 4 > fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 > read(4, "cefuse_pwrdm (OFF),OFF:641441757"..., 32768) = 849 > read(4, "", 28672) = 0 > close(4) = 0 > openat(5, "count", > O_RDONLY|O_NOCTTY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW) = 4 > Connection to usb closed by remote host. > Connection to usb closed. > pavel@half:~$ > > Ok, so it seems to be: > > user@devuan:~$ cat /sys/kernel/debug/pm_debug/count > (oops). > > The file seems to be world-readable. > > user@devuan:~$ ls -al /sys/kernel/debug/pm_debug/count > -r--r--r-- 1 root root 0 Jan 1 1970 /sys/kernel/debug/pm_debug/count > > But on PC, that file does not exist. Ok, it is easier to reproduce like this: sudo mount /dev/zero -t debugfs /sys/kernel/debug/ sudo cat /sys/kernel/debug/pm_debug/count I tried adding debugging like this: But it seems to crash outside show_counter function: [ 100.345062] cpcap-usb-phy cpcap-usb-phy.0: connected to USB host [ 102.049743] cmp... [ 102.051910] printf... [ 102.054351] done... [ 102.056579] cmp... [ 102.058685] printf... ... [ 102.319427] printf... [ 102.323211] done... [ 102.326843] ------------[ cut here ]------------ [ 102.333190] WARNING: CPU: 0 PID: 2360 at drivers/bus/omap_l3_noc.c:147 l3_int errupt_handler+0x23c/0x380 [ 102.344696] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4PER2 (Read): Da ta Access in User mode during Functional access Pavel diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index cba72de..ed98da8 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -78,14 +78,17 @@ static int clkdm_dbg_show_counter(struct clockdomain *clkdm, void *user) { struct seq_file *s = (struct seq_file *)user; + printk("cmp...\n"); if (strcmp(clkdm->name, "emu_clkdm") == 0 || strcmp(clkdm->name, "wkup_clkdm") == 0 || strncmp(clkdm->name, "dpll", 4) == 0) return 0; + printk("printf...\n"); seq_printf(s, "%s->%s (%d)\n", clkdm->name, clkdm->pwrdm.ptr->name, clkdm->usecount); + printk("done...\n"); return 0; }