From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 537ABC3271E for ; Tue, 9 Jul 2024 02:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Bnz9B6ig7Xz6h+rr6QHRC8DIXT9AMGxIguL2yfBRX9U=; b=Yv9v3yIUAV76Wx4SRhqyFvKt2H hbzZbQCPmDp6tAdFfWzJS4lx51PXio0gO7X9dPE9g2byFb8sC6GKJI79Shys3av+AVafQVznNx3j6 cC2wxDP4VAj20f4PSoSB+1+PTU5B2iJLQXao6Q3YcT9uVxHwOfNFPQ4gJod3UyWUYOYMCxaADKq1w fT9XYkw1cgxhbCWp8Jh2xGotAOG4EkiWVdDGsMARWDZ9e3KBnQFGNOPSYpL8MSP3uO0LkiFEPJ46G vJazPksm4cyqmN3F4WSZ6HSJzeb0mGlCz3kC3Bf6SlaD7S4eNxpNE6mDL6bVJhJvyGgGWbGUP9lHA KqQ5XXHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR0Ot-00000005cqV-2YjC; Tue, 09 Jul 2024 02:16:15 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR0Ob-00000005cla-2U5S for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 02:15:59 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-701b0b0be38so3621838b3a.0 for ; Mon, 08 Jul 2024 19:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1720491356; x=1721096156; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Bnz9B6ig7Xz6h+rr6QHRC8DIXT9AMGxIguL2yfBRX9U=; b=11FrLUKVTeXhWUdFDRE3zb1ooAxoUzEuIYym+20DETC2XjKE/ft45oqpddWzLNA2Ia CG1/rRaA/ERz0YjUs9KBknk5SWcePWgoajeBaqWE/hg+kipVE+w9OSoRYknwK1pDy+Bq SSiQLMY9WqXpvejhMEGCsZdxcoKu76m8KTMskb9iY/5gzA4iNEYe2yQSMG1VDj9yPRaO Onx4yUXCT1kybTDLZSG+V9e67j1ohispCtzJ2JcJx8vwPGDdPmSM3PIENeSSi/x6buZN C7hvBXA6tRRxCQdOeW5tZ0mtd5mfSdPZ9GKwEeU7zMC3GtBPI29UGccnDH1jnD9xQtB9 Htkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720491356; x=1721096156; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Bnz9B6ig7Xz6h+rr6QHRC8DIXT9AMGxIguL2yfBRX9U=; b=rq0wPnc0nJ9olBeft1w7EYOv/CMApFi7SaDKbakbPjObtMVCLIn1LS2g1z/pY92Yi3 pmvAcAXdFvPABzeFoRHj7MyLATPfcdPdHnvdg+tTOItpGFn7NJnZ2LXIo5jS9Jvt3YhL r5CCZmjGXuWfP6VYn4RRYn2zu40Eg8asdQhMCUhK0QoIKF1Ql6x084NODz2T1rm+8o/h 9eIaxatW8tffhv9AhhMysz76CLsuZewtwgsVaNwITA9Eq2Zh32f5UVSiLCREAw5OBqTR vyAjOEvngelRi0n/j4wUOadDxXXNEYGiwH8ekzVBxJ8KIHKfO40ZQ0yWvp1MuKJ+SWJ2 gGwg== X-Forwarded-Encrypted: i=1; AJvYcCWV07f/tD/0NDOpCUAXWvGdOB1VVMRONRbNpMg3kDEMbHDNGZ3cTIgZqcTNblHSlwcyHkEVjuNZsdYZJL7XLYXrAqVmYwI+a+1UY1xMX1NZfJfQUyM= X-Gm-Message-State: AOJu0YyFLr/tIdUWHgyiP1vDWR+38hNZgJ8Tatiq+pAyg5buxdpQdJFk 2HWOtnumNvOX2h68LrR7opBIamD14aSSKaclBeQMZWo3OamM3WBJkXSyZ4PeheQ= X-Google-Smtp-Source: AGHT+IG6qJBw6KO7Qk5DzPxTWPK9eD4FdYm01SAL3rqN3QI07tYW+1qf5NcNtRGxEhzOKf+MdVmKxg== X-Received: by 2002:a05:6a00:3d08:b0:706:8e4:56a1 with SMTP id d2e1a72fcca58-70b4356c646mr1599075b3a.18.1720491356107; Mon, 08 Jul 2024 19:15:56 -0700 (PDT) Received: from ghost ([2601:647:5700:6860:482b:e40f:a784:6039]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b43968688sm567555b3a.114.2024.07.08.19.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jul 2024 19:15:55 -0700 (PDT) Date: Mon, 8 Jul 2024 19:15:51 -0700 From: Charlie Jenkins To: Anup Patel Cc: Emil Renner Berthing , Anup Patel , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley , Samuel Holland , devicetree@vger.kernel.org, Saravana Kannan , Marc Zyngier , linux-kernel@vger.kernel.org, =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Atish Patra , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Andrew Jones Subject: Re: [PATCH v14 01/18] irqchip/sifive-plic: Convert PLIC driver into a platform driver Message-ID: References: <20240222094006.1030709-1-apatel@ventanamicro.com> <20240222094006.1030709-2-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240708_191557_895592_D35FC331 X-CRM114-Status: GOOD ( 42.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 20, 2024 at 08:38:09PM +0530, Anup Patel wrote: > On Thu, Jun 20, 2024 at 6:40 PM Emil Renner Berthing > wrote: > > > > Anup Patel wrote: > > > On Wed, Jun 19, 2024 at 11:16 PM Emil Renner Berthing > > > wrote: > > > > > > > > Anup Patel wrote: > > > > > On Tue, Jun 18, 2024 at 7:00 PM Emil Renner Berthing > > > > > wrote: > > > > > > > > > > > > Anup Patel wrote: > > > > > > > The PLIC driver does not require very early initialization so convert > > > > > > > it into a platform driver. > > > > > > > > > > > > > > After conversion, the PLIC driver is probed after CPUs are brought-up > > > > > > > so setup cpuhp state after context handler of all online CPUs are > > > > > > > initialized otherwise PLIC driver crashes for platforms with multiple > > > > > > > PLIC instances. > > > > > > > > > > > > > > Signed-off-by: Anup Patel > > > > > > > > > > > > Hi Anup, > > > > > > > > > > > > Sorry for the late reply to the mailing list, but ever since 6.9 where this was > > > > > > applied my Allwinner D1 based boards no longer boot. This is the log of my > > > > > > LicheeRV Dock booting plain 6.10-rc4, locking up and then rebooting due to the > > > > > > the watchdog timing out: > > > > > > > > > > > > https://pastebin.com/raw/nsbzgEKW > > > > > > > > > > > > On 6.10-rc4 I can bring the same board to boot by reverting this patch and all > > > > > > patches building on it. Eg.: > > > > > > > > > > > > git revert e306a894bd51 a7fb69ffd7ce abb720579490 \ > > > > > > 956521064780 a15587277a24 6c725f33d67b \ > > > > > > b68d0ff529a9 25d862e183d4 8ec99b033147 > > > > > > > > > > Does your board boot with only SBI timer driver enabled ? > > > > > > > > I'm not 100% sure this is what you mean, but with this change I can disable > > > > CONFIG_SUN4I_TIMER: > > > > > > > > diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs > > > > index f51bb24bc84c..0143545348eb 100644 > > > > --- a/arch/riscv/Kconfig.socs > > > > +++ b/arch/riscv/Kconfig.socs > > > > @@ -39,7 +39,6 @@ config ARCH_SUNXI > > > > bool "Allwinner sun20i SoCs" > > > > depends on MMU && !XIP_KERNEL > > > > select ERRATA_THEAD > > > > - select SUN4I_TIMER > > > > help > > > > This enables support for Allwinner sun20i platform hardware, > > > > including boards based on the D1 and D1s SoCs. > > > > > > > > > > > > But unfortunately the board still doesn't boot: > > > > https://pastebin.com/raw/AwRxcfeu > > > > > > I think we should enable debug prints in DD core and see > > > which device is not getting probed due to lack of a provider. > > > > > > Just add "#define DEBUG" at the top in drivers/base/core.c > > > and boot again with "loglevel=8" kernel parameter (along with > > > the above change). > > > > With the above changes this is what I get: > > https://pastebin.com/raw/JfRrEahT > > You should see prints like below which show producer consumer > relation: > > [ 0.214589] /soc/rtc@101000 Linked as a fwnode consumer to /soc/plic@c000000 > [ 0.214966] /soc/serial@10000000 Linked as a fwnode consumer to > /soc/plic@c000000 > [ 0.215443] /soc/virtio_mmio@10008000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.216041] /soc/virtio_mmio@10007000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.216482] /soc/virtio_mmio@10006000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.216868] /soc/virtio_mmio@10005000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.217477] /soc/virtio_mmio@10004000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.217949] /soc/virtio_mmio@10003000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.218595] /soc/virtio_mmio@10002000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.219280] /soc/virtio_mmio@10001000 Linked as a fwnode consumer > to /soc/plic@c000000 > [ 0.219908] /soc/plic@c000000 Linked as a fwnode consumer to > /cpus/cpu@0/interrupt-controller > [ 0.220800] /soc/plic@c000000 Linked as a fwnode consumer to > /cpus/cpu@1/interrupt-controller > [ 0.221323] /soc/plic@c000000 Linked as a fwnode consumer to > /cpus/cpu@2/interrupt-controller > [ 0.221838] /soc/plic@c000000 Linked as a fwnode consumer to > /cpus/cpu@3/interrupt-controller > [ 0.222347] /soc/clint@2000000 Linked as a fwnode consumer to > /cpus/cpu@0/interrupt-controller > [ 0.222769] /soc/clint@2000000 Linked as a fwnode consumer to > /cpus/cpu@1/interrupt-controller > [ 0.223864] /soc/clint@2000000 Linked as a fwnode consumer to > /cpus/cpu@2/interrupt-controller > [ 0.224370] /soc/clint@2000000 Linked as a fwnode consumer to > /cpus/cpu@3/interrupt-controller > [ 0.225217] /soc/pci@30000000 Linked as a fwnode consumer to > /soc/plic@c000000 > > To get further prints, I suggest enabling SBI_HVC console and use > "console=hvc0" as kernel parameter. > > Regards, > Anup I did some follow-up research into this. The hanging after "cpuidle: using governor menu" is due to being stuck inside of check_unaligned_access(). Specifically, there is a check that appears to be waiting for jiffies to start ticking, but they never do: while ((now = jiffies) == start_jiffies) cpu_relax(); `jiffies` is fixed at 0xfffedb08, effectively making this a while(true) loop. This happens with and without SUN4I_TIMER. This hang unfortunately happens before the "Linked as a fwnode consumer" print statements start. After bypassing this with the configs CONFIG_NONPORTABLE=y CONFIG_RISCV_EFFICIENT_UNALIGNED_ACCESS=y A new warning is tripped: [ 1.015134] No max_rate, ignoring min_rate of clock 9 - pll-video0 [ 1.021322] WARNING: CPU: 0 PID: 1 at drivers/clk/sunxi-ng/ccu_common.c:155 sunxi_ccu_probe+0x144/0x1a2 [ 1.021351] Modules linked in: [ 1.021360] CPU: 0 PID: 1 Comm: swapper Tainted: G W 6.10.0-rc6 #1 [ 1.021372] Hardware name: Allwinner D1 Nezha (changed) (DT) [ 1.021377] epc : sunxi_ccu_probe+0x144/0x1a2 [ 1.021386] ra : sunxi_ccu_probe+0x144/0x1a2 [ 1.021397] epc : ffffffff80405a50 ra : ffffffff80405a50 sp : ffffffc80000bb80 [ 1.021406] gp : ffffffff815f69c8 tp : ffffffd801df8000 t0 : 6100000000000000 [ 1.021414] t1 : 000000000000004e t2 : 61725f78616d206f s0 : ffffffc80000bbe0 [ 1.021422] s1 : ffffffff81537498 a0 : 0000000000000036 a1 : 000000000000054b [ 1.021430] a2 : 00000000ffffefff a3 : 0000000000000000 a4 : ffffffff8141f628 [ 1.021438] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 000000004442434e [ 1.021446] s2 : 0000000000000009 s3 : 0000000000000000 s4 : ffffffd801dc9010 [ 1.021453] s5 : ffffffd802428a00 s6 : ffffffd83ffdcf20 s7 : ffffffc800015000 [ 1.021462] s8 : ffffffff80e55360 s9 : ffffffff81034598 s10: 0000000000000000 [ 1.021470] s11: 0000000000000000 t3 : ffffffff8160a257 t4 : ffffffff8160a257 [ 1.021478] t5 : ffffffff8160a258 t6 : ffffffc80000b990 [ 1.021485] status: 0000000200000120 badaddr: 0000000000000000 cause: 0000000000000003 [ 1.021493] [] sunxi_ccu_probe+0x144/0x1a2 [ 1.021510] [] devm_sunxi_ccu_probe+0x48/0x82 [ 1.021524] [] sun20i_d1_ccu_probe+0xba/0xfa [ 1.021546] [] platform_probe+0x4e/0xa6 [ 1.021562] [] really_probe+0x10a/0x2dc [ 1.021581] [] __driver_probe_device.part.0+0xb2/0xe8 [ 1.021597] [] driver_probe_device+0x7a/0xca [ 1.021621] [] __driver_attach+0x52/0x164 [ 1.021638] [] bus_for_each_dev+0x56/0x8c [ 1.021656] [] driver_attach+0x1a/0x22 [ 1.021673] [] bus_add_driver+0xea/0x1d8 [ 1.021690] [] driver_register+0x3e/0xd8 [ 1.021709] [] __platform_driver_register+0x1c/0x24 Emil[ 1.021725] [] sun20i_d1_ccu_driver_init+0x1a/0x22 [ 1.021746] [] do_one_initcall+0x46/0x1be [ 1.021762] [] kernel_init_freeable+0x1c6/0x220 [ 1.021791] [] kernel_init+0x1e/0x112 Linked as a fwnode consumer[ 1.021807] [] ret_from_fork+0xe/0x1c The warning is not fatal, so execution continues until hanging at [ 2.110919] printk: legacy console [ttyS0] disabled [ 2.136911] 2500000.serial: ttyS0 at MMIO 0x2500000 (irq = 205, base_baud = 1500000) is a 16550A�[ 2.145674] printk: legacy console [ttyS0] enabled [ 2.145674] printk: legacy console [ttyS0] enabled [ 2.155095] printk: legacy bootconsole [sbi0] disabled [ 2.155095] printk: legacy bootconsole [sbi0] disabled I have not been able to discover why it hangs here. The clock is somehow relying on the previous behavior of this PLIC driver. - Charlie > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv