From patchwork Wed Feb 10 10:48:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 12080479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BFB5C433DB for ; Wed, 10 Feb 2021 10:50:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C142464E37 for ; Wed, 10 Feb 2021 10:50:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C142464E37 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:To:Date:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=a3g5dCgtNYHnh5mrlNm3pDxlDWnYiwQ+TFmms4dSGC0=; b=a1w xo7WmlPd/QdL8685pFPEv1/A9Wr27ynIsiThQRAm32BWiS1TtKYF8mTmn8oN9l8bkaPfqNq/3dCW1 SWEqrqBl94yBEk3gGhPiczKWJW+e9nb2tqNfuAneR47+C2HqJmUAbawZgqy/1j3NqsWm6qKFzdfgY 5DdFdRRWoI9KkqlJ8xJBBBodCXu7P1iDEFFsTonsiw8YCHb9bFWsVyYIO2xNnnjtlOZs7jakDsI1O WHvdY0gT+W2v6H+vHIW7++k/g9Gmp1lvVDPdSr26K1JonvEGLF5iJYkycVcIwSFjz4I7s+6NmVkXh nSlJAV4J2xNvFOORKQxlg6qvI7Y4Yzg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9n3D-0006wG-0q; Wed, 10 Feb 2021 10:48:51 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9n38-0006vp-C4 for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 10:48:49 +0000 Received: from mail-ej1-f69.google.com ([209.85.218.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l9n35-0003Xr-NL for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 10:48:43 +0000 Received: by mail-ej1-f69.google.com with SMTP id jz15so2328084ejc.12 for ; Wed, 10 Feb 2021 02:48:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:organization :mime-version; bh=fbZODEynTk8KIxFQkGB4RefR0hE1fym2+Xyhrsnzu5A=; b=YCMbILCZ64XDkhB6Y7WKYgDIpShzb7dVIChq4x5ygBVQ5RCqiiRWvDn/Lh7tSZVKRK A/POSEgztqHbAzdEl4ytrODlU2sbEMRU2UQ3tEtcNHU2PetGvSVn9AwynP/jpwCe0jRd LcaqHANjVVkky1I8q5pF6q+Y9YbIR4gtc/rJ5uQNPj+aGEDVrqT5NzzNcL/5dqSJSz0R pyxUaJpSt8gPUS/Uz4SmSYZFvlqCxRJKAE96t3XvTKGrbmhnTYSUHDbhARAylBLXvPmM ghmBOwk3MTc24qMUnmCsyrG1f6UADl6eZzCqZy0OBFZ+St8olAkIYWnBdzBZvnTasFsv dLgQ== X-Gm-Message-State: AOAM533P06c856LjV+lp889pql3d9IVIqjSK6mJG7b1LfKoqhoFU3tge IcWgqCb25JSxRFShoaNxLGeLGHiw1gO2kwkvnndNDd1/+esdbKM9a6tlAcKl+Mj/23aTbNmW1dm HjONV3U5ghaJ1vhgvpGhd/G+LswHI2iJvtMBSsLIPbtpxDWQ09zzR X-Received: by 2002:a17:906:d0c3:: with SMTP id bq3mr2290837ejb.424.1612954123421; Wed, 10 Feb 2021 02:48:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9NF6hS2YW4fND0UJVdN+X6/DxWiZF+y7SJqfqwpg6oWblzfPBC5lxW34Eqe1Xqhgbb15VeA== X-Received: by 2002:a17:906:d0c3:: with SMTP id bq3mr2290824ejb.424.1612954123154; Wed, 10 Feb 2021 02:48:43 -0800 (PST) Received: from gollum ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id v1sm878642ejd.3.2021.02.10.02.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 02:48:42 -0800 (PST) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger Date: Wed, 10 Feb 2021 11:48:29 +0100 To: stefan.wahren@i2se.com, nsaenzjulienne@suse.de Subject: bcm2711_thermal: Kernel panic - not syncing: Asynchronous SError Interrupt Message-ID: <20210210114829.2915de78@gollum> Organization: Canonical Ltd X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210210_054846_503103_1B425A92 X-CRM114-Status: GOOD ( 13.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Trying to dump the BCM2711 registers kills the kernel: # cat /sys/kernel/debug/regmap/dummy-avs-monitor\@fd5d2000/range 0-efc # cat /sys/kernel/debug/regmap/dummy-avs-monitor\@fd5d2000/registers [ 62.857661] SError Interrupt on CPU1, code 0xbf000002 -- SError [ 62.857671] CPU: 1 PID: 478 Comm: cat Not tainted 5.11.0-rc7 #4 [ 62.857674] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) [ 62.857676] pstate: 20000085 (nzCv daIf -PAN -UAO -TCO BTYPE=--) [ 62.857679] pc : regmap_mmio_read32le+0x1c/0x34 [ 62.857681] lr : regmap_mmio_read+0x50/0x80 [ 62.857682] sp : ffff8000105c3c00 [ 62.857685] x29: ffff8000105c3c00 x28: 0000000000000014 [ 62.857694] x27: 0000000000000014 x26: ffffd2ea1c2060b0 [ 62.857699] x25: ffff4e34408ecc00 x24: 0000000000000efc [ 62.857704] x23: ffff8000105c3e20 x22: ffff8000105c3d3c [ 62.857710] x21: ffff8000105c3d3c x20: 0000000000000014 [ 62.857715] x19: ffff4e344037a900 x18: 0000000000000020 [ 62.857720] x17: 0000000000000000 x16: 0000000000000000 [ 62.857725] x15: ffff4e3447ac40f0 x14: 0000000000000003 [ 62.857730] x13: ffff4e34422c0000 x12: ffff4e34422a0046 [ 62.857735] x11: ffffd2ea1c8765e0 x10: 0000000000000000 [ 62.857741] x9 : ffffd2ea1b9495a0 x8 : ffff4e34429ef980 [ 62.857746] x7 : 000000000000000f x6 : ffff4e34422a004b [ 62.857751] x5 : 00000000fffffff9 x4 : 0000000000000000 [ 62.857757] x3 : ffffd2ea1b949550 x2 : ffffd2ea1b949330 [ 62.857761] x1 : 0000000000000014 x0 : 0000000000000000 [ 62.857767] Kernel panic - not syncing: Asynchronous SError Interrupt [ 62.857770] CPU: 1 PID: 478 Comm: cat Not tainted 5.11.0-rc7 #4 [ 62.857773] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) [ 62.857775] Call trace: [ 62.857777] dump_backtrace+0x0/0x1e0 [ 62.857778] show_stack+0x24/0x70 [ 62.857780] dump_stack+0xd0/0x12c [ 62.857782] panic+0x168/0x370 [ 62.857783] nmi_panic+0x98/0xa0 [ 62.857786] arm64_serror_panic+0x8c/0x98 [ 62.857787] do_serror+0x3c/0x6c [ 62.857789] el1_error+0x78/0xf0 [ 62.857791] regmap_mmio_read32le+0x1c/0x34 [ 62.857793] _regmap_bus_reg_read+0x24/0x30 [ 62.857795] _regmap_read+0x6c/0x17c [ 62.857797] regmap_read+0x58/0x84 [ 62.857799] regmap_read_debugfs+0x138/0x3f4 [ 62.857801] regmap_map_read_file+0x34/0x40 [ 62.857803] full_proxy_read+0x6c/0xc0 [ 62.857805] vfs_read+0xb8/0x1e4 [ 62.857807] ksys_read+0x78/0x10c [ 62.857809] __arm64_sys_read+0x28/0x34 [ 62.857811] el0_svc_common.constprop.0+0x7c/0x194 [ 62.857813] do_el0_svc+0x30/0x9c [ 62.857814] el0_svc+0x20/0x30 [ 62.857816] el0_sync_handler+0x1a4/0x1b0 [ 62.857818] el0_sync+0x174/0x180 [ 62.857842] SMP: stopping secondary CPUs [ 62.857845] Kernel Offset: 0x52ea0b080000 from 0xffff800010000000 [ 62.857847] PHYS_OFFSET: 0xffffb1cc00000000 [ 62.857849] CPU features: 0x00240022,61806000 [ 62.857851] Memory Limit: none Sprinkling printks around regmap_read [1] shows that reading from 0x14 (20) seems to cause the issue: [ 40.456230] map=ffff020a069c9c00, from=0, to=3836, count=131072 [ 40.462520] map=ffff020a069c9c00, i=0 [ 40.466319] ret=0, val=0 [ 40.468922] map=ffff020a069c9c00, i=4 [ 40.472684] ret=0, val=0 [ 40.475292] map=ffff020a069c9c00, i=8 [ 40.479048] ret=0, val=0 [ 40.481649] map=ffff020a069c9c00, i=12 [ 40.485492] ret=0, val=0 [ 40.488080] map=ffff020a069c9c00, i=16 [ 40.491922] ret=0, val=0 [ 40.494523] map=ffff020a069c9c00, i=20 [ 40.498497] SError Interrupt on CPU0, code 0xbf000002 -- SError [ 40.498499] CPU: 0 PID: 486 Comm: cat Not tainted 5.11.0-rc7+ #8 [ 40.498501] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT) ...Juerg [1] diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index ff2ee87987c7..9465f5a2f3b8 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -229,6 +229,7 @@ static ssize_t regmap_read_debugfs(struct regmap *map, unsigned int from, if (count > (PAGE_SIZE << (MAX_ORDER - 1))) count = PAGE_SIZE << (MAX_ORDER - 1); + printk("map=%px, from=%d, to=%d, count=%ld\n", map, from, to, count); buf = kmalloc(count, GFP_KERNEL); if (!buf) return -ENOMEM; @@ -253,7 +254,9 @@ static ssize_t regmap_read_debugfs(struct regmap *map, unsigned int from, buf_pos += map->debugfs_reg_len + 2; /* Format the value, write all X if we can't read */ + printk("map=%px, i=%d\n", map, i); ret = regmap_read(map, i, &val); + printk("ret=%ld, val=%x\n", ret, val); if (ret == 0) snprintf(buf + buf_pos, count - buf_pos, "%.*x", map->debugfs_val_len, val);