From nobody Mon Aug 23 13:07:34 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C0F291797B1B for ; Mon, 23 Aug 2021 13:07:43 +0000 (UTC) (envelope-from mats@exmandato.se) Received: from mailout.mellstrand.net (mailout.mellstrand.net [IPv6:2001:2040:4:1::52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailout.mellstrand.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GtXbL40qtz3kgJ for ; Mon, 23 Aug 2021 13:07:42 +0000 (UTC) (envelope-from mats@exmandato.se) Received: by mailout.mellstrand.net Mon, 23 Aug 2021 15:07:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=exmandato.se; s=mailout; t=1629724054; bh=TmbfQO9VYNuR6xtt7RshzqhVFySFj2YiXkpgPWBHdwk=; h=From:Subject:Date:To; b=OTnc37XRic14vnEiFegn7gdsIakdPjWwRqJp91sJGd3WUSK0kgz4E7rH4e9JnLuYq NXsSuQnNySuVUch5QP0XgGE30j0zvyqN/AMXxR23WUZq19aaJWgkpkw9ieujUR/8qk +QvsZSI21K678wFm+9xF++mbGkqrjF6aGr5uOcdfsusOuoRVt8LjzuokTSfcqOQVaD kwPFTPAaWM7co6M3Q9Lma9pwnHuZenBC7YCWEd7WE0yuKTdA3cq9MBh/UOdCUnmllg bgiTPf62QtMTDi327bXF4aKdp7/SaCYhw7p6xqBMGJjlGoi2su5LHAE2LMlNwCuufv JuNkSDch7uX/g== Content-Type: multipart/signed; boundary="Apple-Mail=_4C5BEB7F-7CD4-48EE-A6AD-A0D8E62B00A3"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 Subject: Raspberry Pi 4 panics when using /dev/led/led1 Message-Id: Date: Mon, 23 Aug 2021 15:07:34 +0200 To: freebsd-arm@freebsd.org X-Rspamd-Queue-Id: 4GtXbL40qtz3kgJ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=exmandato.se header.s=mailout header.b=OTnc37XR; dmarc=pass (policy=reject) header.from=exmandato.se; spf=pass (mx1.freebsd.org: domain of mats@exmandato.se designates 2001:2040:4:1::52 as permitted sender) smtp.mailfrom=mats@exmandato.se X-Spamd-Result: default: False [-5.60 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[exmandato.se:s=mailout]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; R_SPF_ALLOW(-0.20)[+mx]; DKIM_TRACE(0.00)[exmandato.se:+]; DMARC_POLICY_ALLOW(-0.50)[exmandato.se,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:3301, ipnet:2001:2040::/32, country:SE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Reply-To: mats@exmandato.se From: Mats Mellstrand via freebsd-arm X-Original-From: Mats Mellstrand X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_4C5BEB7F-7CD4-48EE-A6AD-A0D8E62B00A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Raspberry Pi 4 8 Gbyte Booting from USB stick Latest snapshot FreeBSD XX 14.0-CURRENT FreeBSD 14.0-CURRENT #0 = main-n248803-eba8e643b19: Thu Aug 19 10:08:23 UTC 2021 = root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC = arm64 Booting works fine. # morse -l =E2=80=9CSOS=E2=80=9D > /dev/led/led0 works as expected. But when I try: # morse -l "SOS" > /dev/led/led1 # lock order reversal: (sleepable after non-sleepable) 1st 0xffff000000c31c58 LED mtx (LED mtx, sleep mutex) @ = /usr/src/sys/kern/kern_mutex.c:211 2nd 0xffffa00000ffec10 Raspberry Pi firmware gpio (Raspberry Pi = firmware gpio, sx) @ = /usr/src/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c:252 lock order LED mtx -> Raspberry Pi firmware gpio attempted at: #0 0xffff0000004e1b58 at witness_checkorder+0xc0c #1 0xffff00000047e348 at _sx_xlock+0x7c #2 0xffff0000007edc60 at rpi_fw_gpio_pin_set+0xe8 #3 0xffff0000001e998c at led_timeout+0xe8 #4 0xffff000000491368 at softclock_call_cc+0x13c #5 0xffff000000491674 at softclock+0x44 #6 0xffff000000430e64 at ithread_loop+0x2a8 #7 0xffff00000042d724 at fork_exit+0x74 #8 0xffff0000007774cc at fork_trampoline+0x14 panic: malloc(M_WAITOK) with sleeping prohibited cpuid =3D 0 time =3D 1629719529 KDB: stack backtrace: db_trace_self() at db_trace_self db_trace_self_wrapper() at db_trace_self_wrapper+0x30 vpanic() at vpanic+0x184 panic() at panic+0x44 malloc_dbg() at malloc_dbg+0xf8 malloc() at malloc+0x2c bcm2835_firmware_property() at bcm2835_firmware_property+0x44 rpi_fw_gpio_pin_set() at rpi_fw_gpio_pin_set+0x100 led_timeout() at led_timeout+0xe8 softclock_call_cc() at softclock_call_cc+0x13c softclock() at softclock+0x44 ithread_loop() at ithread_loop+0x2a8 fork_exit() at fork_exit+0x74 fork_trampoline() at fork_trampoline+0x14 KDB: enter: panic [ thread pid 12 tid 100028 ] Stopped at kdb_enter+0x44: undefined f905011f db> --Apple-Mail=_4C5BEB7F-7CD4-48EE-A6AD-A0D8E62B00A3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEDr+9RcE612tpmSJHQ/tbBFhN7RsFAmEjnZYACgkQQ/tbBFhN 7RucaQ//aa+V4yOgYxEyR9Y1JoNpn7Mq1rm0ppbBBGJ1NKIuaeIcqfvksEKnHLEv fWnMzq8qxXGH2buHh/np6QY3V8cMZaq1d2BLBtbOtFP5QK7eTheHVUhRmhpt9Vji JZNNfnvs0QqLkOMbV05i6nJzBRJxOpuF8WRYo+bq7TqWmxEdLu8/yk6ImHDchhGp thFxUAiw4RxP4sF28OJEMssIv/e2tvJ2Az0sZQmuNfEDxZ45tRA50b2Yotl/aHSC 1t51wet1eHZ5aWal2m6SZV0iaD0cio/BVkBjJYh0lRooyVLmge40z1Ej7GzR3Unc nF99oxole1uKj7kNmTkKVQf6PRPrjxfL9XlnFrep/VCA0HMqma5ikhEwYuEhSPbK 5pXGf5V1own4VeOGzN4gcqcX930quL0fQ/vqWEDDHH39jZCOhVyPOq5OhQFs4UPc MP2qLl6VncqtYrk1wVmTNMutAxeH3W8pMfaAhLdbQs9/MWR/fcrFjhAyL2Ek39sl RBaoKcX1XWLjrSMh751fhCB//aFD5EYGaowxt6SSRZNdabR8sjNW1+/IIGHIU5m4 HQkO0HoLhiZ/fwIg5DTouu+NDgINF3leiwS6H7DUrXnrgeDiV8tzodKSfT+KbTbi rN2RjOxD8A+8OMcygi9I3Pe1eGh+NV5fQX2VECUMUm+BEi67Uxw= =y708 -----END PGP SIGNATURE----- --Apple-Mail=_4C5BEB7F-7CD4-48EE-A6AD-A0D8E62B00A3-- From nobody Tue Aug 24 05:51:12 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6549E1783921 for ; Tue, 24 Aug 2021 05:51:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GtysD2N68z4bXH for ; Tue, 24 Aug 2021 05:51:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FFEA22F45 for ; Tue, 24 Aug 2021 05:51:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 17O5pCEK027592 for ; Tue, 24 Aug 2021 05:51:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 17O5pC7m027591 for freebsd-arm@FreeBSD.org; Tue, 24 Aug 2021 05:51:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 258019] Raspberry Pi 4 panics when using /dev/led/led1 Date: Tue, 24 Aug 2021 05:51:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mats@exmandato.se X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258019 Bug ID: 258019 Summary: Raspberry Pi 4 panics when using /dev/led/led1 Product: Base System Version: CURRENT Hardware: arm64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: mats@exmandato.se Raspberry Pi 4 8 Gbyte Booting from USB stick Running latest snapshot FreeBSD localhost 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n248803-eba8e643b19: Thu Aug 19 10:08:23 UTC 2021=20=20=20=20 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC ar= m64 Booting works fine. # morse -l =E2=80=9CSOS=E2=80=9D > /dev/led/led0 works as expected. But when I try: # morse -l "SOS" > /dev/led/led1 # lock order reversal: (sleepable after non-sleepable) 1st 0xffff000000c31c58 LED mtx (LED mtx, sleep mutex) @ /usr/src/sys/kern/kern_mutex.c:211 2nd 0xffffa00000ffec10 Raspberry Pi firmware gpio (Raspberry Pi firmware gp= io, sx) @ /usr/src/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c:252 lock order LED mtx -> Raspberry Pi firmware gpio attempted at: #0 0xffff0000004e1b58 at witness_checkorder+0xc0c #1 0xffff00000047e348 at _sx_xlock+0x7c #2 0xffff0000007edc60 at rpi_fw_gpio_pin_set+0xe8 #3 0xffff0000001e998c at led_timeout+0xe8 #4 0xffff000000491368 at softclock_call_cc+0x13c #5 0xffff000000491674 at softclock+0x44 #6 0xffff000000430e64 at ithread_loop+0x2a8 #7 0xffff00000042d724 at fork_exit+0x74 #8 0xffff0000007774cc at fork_trampoline+0x14 panic: malloc(M_WAITOK) with sleeping prohibited cpuid =3D 0 time =3D 1629719529 KDB: stack backtrace: db_trace_self() at db_trace_self db_trace_self_wrapper() at db_trace_self_wrapper+0x30 vpanic() at vpanic+0x184 panic() at panic+0x44 malloc_dbg() at malloc_dbg+0xf8 malloc() at malloc+0x2c bcm2835_firmware_property() at bcm2835_firmware_property+0x44 rpi_fw_gpio_pin_set() at rpi_fw_gpio_pin_set+0x100 led_timeout() at led_timeout+0xe8 softclock_call_cc() at softclock_call_cc+0x13c softclock() at softclock+0x44 ithread_loop() at ithread_loop+0x2a8 fork_exit() at fork_exit+0x74 fork_trampoline() at fork_trampoline+0x14 KDB: enter: panic [ thread pid 12 tid 100028 ] Stopped at kdb_enter+0x44: undefined f905011f db> --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Wed Aug 25 08:30:42 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B58881785BFA for ; Wed, 25 Aug 2021 08:30:48 +0000 (UTC) (envelope-from rozk@laposte.net) Received: from smtp-outgoing-1803.laposte.net (smtp-outgoing-1803.laposte.net [160.92.124.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GvfLv4xC6z3q5C for ; Wed, 25 Aug 2021 08:30:47 +0000 (UTC) (envelope-from rozk@laposte.net) X-mail-filterd: {"version":"1.3.1","queueID":"4GvfLl06y1zYcmV","contextId":"d156eafd-b0dd-4bc6-83d4-98aee5d6e883"} Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0118.laposte.net (SMTP Server) with ESMTP id 4GvfLl06y1zYcmV for ; Wed, 25 Aug 2021 10:30:39 +0200 (CEST) X-mail-filterd: {"version":"1.3.1","queueID":"4GvfLk6SlLzYcmC","contextId":"f80d68f0-00b6-403e-80b8-7b05d53ee9cd"} X-lpn-mailing: LEGIT X-lpn-spamrating: 50 X-lpn-spamlevel: not-spam X-lpn-spamcause: OK, (0)(0000)gggruggvucftvghtrhhoucdtuddrgedvtddruddtledgtdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecunfetrffquffvgfdpqfgfvfdpggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvkffugggtsehmtderredttdejnecuhfhrohhmpehrohiikhcuoehrohiikheslhgrphhoshhtvgdrnhgvtheqnecuggftrfgrthhtvghrnheptdfhvdejffefudetueefleekkeetgfdutdffjeeghefhieeijeeuhfevledugfeinecukfhppeekiedrvddtvddrvdduiedrvdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepkeeirddvtddvrddvudeirddvkedphhgvlhhopegluddtrddtrdefrddugegnpdhmrghilhhfrhhomheprhhoiihksehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepfhhrvggvsghsugdqrghrmhesfhhrvggvsghsugdrohhrgh Received: from [10.0.3.14] (lfbn-lyo-1-132-28.w86-202.abo.wanadoo.fr [86.202.216.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mlpnf0118.laposte.net (SMTP Server) with ESMTPSA id 4GvfLk6SlLzYcmC for ; Wed, 25 Aug 2021 10:30:38 +0200 (CEST) Date: Wed, 25 Aug 2021 10:30:42 +0200 To: freebsd-arm Message-ID: Subject: RPI CM4 boot kernel panic List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EdoMail6125ffb2_1a1bccb2_4c39" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=lpn-wlmd; t=1629880240; bh=BA1bykzSHoZLEVEz8qr9Te0N8a1p8SucOpoO4in2q9k=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type; b=b407VELZF7OJiX3mFsd8LkkDxXzEZINS7+OSP+n1Qa3n+/bYDhlHtJlymJ+Se/bfLXJnNTLshDIlKks7jPdhBseQ3jC1E6lWj7LrSCKcKDWOBYjB7TSVdjvW9Aw5erZMRv64RuOq302qtfQxGEyhH+fpyNXOA9BwKeBtsbI7SJ7IjL7RLHLwSZO47eyeEVHtiKUQsAheoKqAOg0AaHNDPqNQ5SyKi0QDIxHUoQuMBRntgs0vAF1CWW9JJAF8vJ2DV0wEjVG1VH7GLcahsSRpFPY67wvp0PWVuX+/0Er33e2XT3Cu0Q/wDc0JlXrmnvdGa/GvGMBxa+YiBUXO9jV0Pg==; X-Rspamd-Queue-Id: 4GvfLv4xC6z3q5C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=laposte.net header.s=lpn-wlmd header.b=b407VELZ; dmarc=pass (policy=reject) header.from=laposte.net; spf=pass (mx1.freebsd.org: domain of rozk@laposte.net designates 160.92.124.104 as permitted sender) smtp.mailfrom=rozk@laposte.net X-Spamd-Result: default: False [-2.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[laposte.net]; R_SPF_ALLOW(-0.20)[+ip4:160.92.124.64/26]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[laposte.net:+]; DMARC_POLICY_ALLOW(-0.50)[laposte.net,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[86.202.216.28:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~,5:~]; FREEMAIL_ENVFROM(0.00)[laposte.net]; ASN(0.00)[asn:8677, ipnet:160.92.124.0/24, country:FR]; RCVD_IN_DNSWL_LOW(-0.10)[160.92.124.104:from]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[laposte.net:s=lpn-wlmd]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/mixed,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[laposte.net:dkim]; MID_RHS_NOT_FQDN(0.50)[] Reply-To: rozk@laposte.net From: rozk via freebsd-arm X-Original-From: rozk X-ThisMailContainsUnwantedMimeParts: Y --EdoMail6125ffb2_1a1bccb2_4c39 Content-Type: multipart/alternative; boundary="EdoMail6125ffb2_10079440_4c39" --EdoMail6125ffb2_10079440_4c39 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I tested 13-RELEASE, 13-STABLE and CURRENT on a Raspberry PI Compute Module 4 and got kernel panic on boot with every version tested. There's something wrong with rman and libdevinfo, see attached patch and dmesg. Another way to avoid the kernel panic is to add : devmatch_enable="NO" in : /etc/rc.conf Kind Regards, Rozie --EdoMail6125ffb2_10079440_4c39-- --EdoMail6125ffb2_1a1bccb2_4c39-- From nobody Wed Aug 25 08:34:58 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B7E121789479 for ; Wed, 25 Aug 2021 08:37:10 +0000 (UTC) (envelope-from s199p.wa1k9r@gmail.com) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GvfVF6TS2z3s0V for ; Wed, 25 Aug 2021 08:37:09 +0000 (UTC) (envelope-from s199p.wa1k9r@gmail.com) Received: by mail-io1-xd36.google.com with SMTP id b10so17741212ioq.9 for ; Wed, 25 Aug 2021 01:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=gZF2T7CMPXtD5r/iN8D4JEMwOGZThLphQ5OzOaD7n/A=; b=soc3St5agSRsJ9Xn0cbouQw+DsYziZCxkRoFxz4/pjbEppNSn862t6gI96crj/74gq KVEb3I/fEtt2/B6y97N5M3CvmO+vQJl8PTZ7SiTR5UmlBe7Q1A/3urBF2riNfnia2+GG mdtoHvOkiiiW9IO4OFNV3sqy8WR1lrJK/zksQqYutN39U+oIiHY2AB7QvEdzPUh4KCl9 pJ5+lkSMwi8XuOuvlL5x0xZJfwSRURQ85/XvXY4colsupw8obHTwyEjJ7heKKVb0NyN8 aSX7w7lQynG3Xi+BaA3Z6VoBa7kL2BoOMps0VMot+GGhpgxirrvd4J8EFIcdgHMnCgHV 4ZAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gZF2T7CMPXtD5r/iN8D4JEMwOGZThLphQ5OzOaD7n/A=; b=s6SSiUAY5c4Nww5gP5NzvzQBUAbZnHfCJ96YdQXi/GAXOWDxtqsjralpk0HN+yvxj4 7oMRUatM13EmVhKBUBaXwGG1r7B/98Q3Xu2QI6FAAHDGUp+NNjN7BV0MlhrMGZyZzAtf gCj4x/OWOevmmaX63f0I2nvDP8/4vLu/73ZuFb2br6vDxViGj7ukh2Aoz9K+dG8h27ks PN+y3umWs4M7stowbjZhtmmQ38hG51jSh05fXbkKP/a0glkR2GzvlwruINcZO0/7Gtux TbKQcF7jlfN02y51V9pFWIUPoILuTTEbA3+iOwdsLrjEKqkiOoinXVoTT5s5tVrbpdv8 pyOg== X-Gm-Message-State: AOAM533pl3Um//U4A2YPKez3FLAYu1uZ+2tpJqGlhmNaG3R1HaWCfqTf HxWzZzIFeAE8VJ4refE3ZOtNQ8cODYSA4JGqyv2ei1eUE6k= X-Google-Smtp-Source: ABdhPJwojiTks74CXiDKC2AsR5GkpZ9mrwdCQWcm7wRBl1nIhfEvg8u8Iidp6hyCF6qJvfYvtS/z6qqMfHqzQ8BfvBc= X-Received: by 2002:a5e:d80c:: with SMTP id l12mr26607547iok.120.1629880629079; Wed, 25 Aug 2021 01:37:09 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 From: Sleep Walker Date: Wed, 25 Aug 2021 11:34:58 +0300 Message-ID: Subject: FreeBSD-13.0-CURRENT on Baikal-m(aarch64) SoC To: Free BSD Content-Type: multipart/alternative; boundary="000000000000ec35cd05ca5e2729" X-Rspamd-Queue-Id: 4GvfVF6TS2z3s0V X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=soc3St5a; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of s199pwa1k9r@gmail.com designates 2607:f8b0:4864:20::d36 as permitted sender) smtp.mailfrom=s199pwa1k9r@gmail.com X-Spamd-Result: default: False [0.00 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d36:from]; NEURAL_SPAM_SHORT(1.00)[1.000]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: Y --000000000000ec35cd05ca5e2729 Content-Type: text/plain; charset="UTF-8" Hi! I am trying to add support for the new SoC Baikal-M in FreeBSD. https://www.baikalelectronics.com/products/338/ https://www.cnx-software.com/2021/08/10/desktop-and-all-in-one-arm-linux-computers-launched-with-baikal-m-processor/ The system is already starting in multi-user mode, but only one core out of eight is detected. To find out the reason, I slightly changed the code by adding the output of the error code. sys/arm64/arm64/mp_machdep.c ------------------------------------------------------------------------------------------------------------------------- printf("Starting CPU %u (%lx)\n", cpuid, target_cpu); pa = pmap_extract(kernel_pmap, (vm_offset_t)mpentry); err = psci_cpu_on(target_cpu, pa, cpuid); if (err != PSCI_RETVAL_SUCCESS) { printf("Starting CPU %u (%lx) psci_cpu_on return (%d)\n", cpuid, target_cpu, err); /* * Panic here if INVARIANTS are enabled and PSCI failed to * start the requested CPU. psci_cpu_on() returns PSCI_MISSING * to indicate we are unable to use it to start the given CPU. */ KASSERT(err == PSCI_MISSING || (mp_quirks & MP_QUIRK_CPULIST) == MP_QUIRK_CPULIST, ("Failed to start CPU %u (%lx), error %d\n", cpuid, target_cpu, err)); pcpu_destroy(pcpup); kmem_free((vm_offset_t)dpcpu[cpuid - 1], DPCPU_SIZE); dpcpu[cpuid - 1] = NULL; kmem_free((vm_offset_t)bootstacks[cpuid], PAGE_SIZE); bootstacks[cpuid] = NULL; mp_ncpus--; return (false); } -------------------------------------------------------------------------------------------------------------------------- I got the following log --------------------------------- Starting CPU 1 (1) Starting psci_cpu_on(1, f22008c8, 1) Starting CPU 1 (1) psci_cpu_on return (-9) Starting CPU 1 (100) Starting psci_cpu_on(100, f22008c8, 1) Starting CPU 1 (100) psci_cpu_on return (-9) Starting CPU 1 (101) ...... ---------------------------------- This document describes return codes https://developer.arm.com/documentation/den0022/latest 5.2.2 Return error codes Table 6 defines the values for error codes used with PSCI functions. All errors are 32-bit signed integers. SUCCESS 0 NOT_SUPPORTED -1 INVALID_PARAMETERS -2 DENIED -3 ALREADY_ON -4 ON_PENDING -5 INTERNAL_FAILURE -6 NOT_PRESENT -7 DISABLED -8 INVALID_ADDRESS -9 But in kernel sources in the file sys/dev/psci/psci.h no definition of INVALID_ADDRESS !!!!! /* * PSCI return codes. */ #define PSCI_RETVAL_SUCCESS 0 #define PSCI_RETVAL_NOT_SUPPORTED -1 #define PSCI_RETVAL_INVALID_PARAMS -2 #define PSCI_RETVAL_DENIED -3 #define PSCI_RETVAL_ALREADY_ON -4 #define PSCI_RETVAL_ON_PENDING -5 #define PSCI_RETVAL_INTERNAL_FAILURE -6 #define PSCI_RETVAL_NOT_PRESENT -7 #define PSCI_RETVAL_DISABLED -8 That is, no one expected the return code -9 to appear. What do you think is the reason for this error? Maybe someone has already encountered this behavior psci_cpu_on ? The DT files say the following. psci { compatible = "arm,psci-1.0", "arm,psci-0.2"; method = "smc"; }; Full DT files can be viewed here https://personalbsd.org/download/baikal/dts/ The complete system startup log can be viewed here. https://dmesgd.nycbug.org/index.cgi?do=view&id=6236 --- Sergey Tyuryukanov. --000000000000ec35cd05ca5e2729-- From nobody Wed Aug 25 10:51:14 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 63D2A1772548 for ; Wed, 25 Aug 2021 10:51:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4GvjTj1D44z3CYC for ; Wed, 25 Aug 2021 10:51:52 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [192.168.42.24] (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 124514E755; Wed, 25 Aug 2021 10:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1629888675; bh=kmIQhQDYDd6qsT079PLM5cTFhHovZi1mCTMaEofYZTQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=WZx/HUIGl4gYe0EvJe9lSa4lX9rwbkXLbasBPATtKawWF+okENchU5Yfm6wt55Bdp vpkD3AG2qSkFNqxUV8R/v1I57vsj76nr1eYeuhpBIW8GhylDZ4GP1N96tTip+Qg/9s FFBGrsKXPfVkF6jYmR4aHEbn15CkQu9Y8t3FOZgUlpaLR+gWrbBc3OAxAWW34a8j4n Rb5pnThSC0+rYvwOkxDdl66PuAqi1/o1OUMtxiUw5Wz6Dsce6SHaNJlqXC/IGZiQdk OJ9ZlqTVEsN+Dbi99iq96INMgj4Hrfh53nT/ZawDrSmbLlRodYOXmgk2ILAlO4X7vR 3Ro0s2Fq4hjc2pBpfM9Hxf3vGLdVxn5zVwvs5jmYoU58lPk7E8vgrkEGoM8o/mgh9z 605UFecJrmMmCeKuyyKtrSv5hx2kFscpDtleI4Zhvm718xlIwehKjkZOaQyHP5lQWc zWCRUDyFIGVS6n3bBG9RtPvGhI5CeCHJr7khKW2DafB3Pm+M2U+D5U/wjo6Bvf8g8A 0r7AkQqlrqEfqVdtKN8acZARFM43cxQE94bPuS4Vzr7vXBSb0f4ergkoH4KV4l2Ckn waoexXNz3c3/qyJ1e0WxkC99KzlCYcPSnI6JKbUxCqGiGhWrr5vcxseV5UfI8Oxe4Y 2hEJBiRcjyDhB9bQSMY9Qsgk= Content-Type: text/plain; charset=utf-8 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: FreeBSD-13.0-CURRENT on Baikal-m(aarch64) SoC From: Andrew Turner In-Reply-To: Date: Wed, 25 Aug 2021 11:51:14 +0100 Cc: Free BSD Content-Transfer-Encoding: quoted-printable Message-Id: <0B22D0E6-2510-4CE8-9DE2-E72EB1BB5665@fubar.geek.nz> References: To: Sleep Walker X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4GvjTj1D44z3CYC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 25 Aug 2021, at 09:34, Sleep Walker wrote: >=20 > Hi! >=20 > I am trying to add support for the new SoC Baikal-M in FreeBSD. > https://www.baikalelectronics.com/products/338/ > = https://www.cnx-software.com/2021/08/10/desktop-and-all-in-one-arm-linux-c= omputers-launched-with-baikal-m-processor/ >=20 > The system is already starting in multi-user mode, but only one core = out of > eight is detected. > To find out the reason, I slightly changed the code by adding the = output of > the error code. > sys/arm64/arm64/mp_machdep.c > = --------------------------------------------------------------------------= ----------------------------------------------- > printf("Starting CPU %u (%lx)\n", cpuid, target_cpu); > pa =3D pmap_extract(kernel_pmap, (vm_offset_t)mpentry); > err =3D psci_cpu_on(target_cpu, pa, cpuid); >=20 > if (err !=3D PSCI_RETVAL_SUCCESS) { > printf("Starting CPU %u (%lx) psci_cpu_on return = (%d)\n", > cpuid, target_cpu, err); > /* > * Panic here if INVARIANTS are enabled and PSCI failed = to > * start the requested CPU. psci_cpu_on() returns > PSCI_MISSING > * to indicate we are unable to use it to start the = given > CPU. > */ > KASSERT(err =3D=3D PSCI_MISSING || > (mp_quirks & MP_QUIRK_CPULIST) =3D=3D = MP_QUIRK_CPULIST, > ("Failed to start CPU %u (%lx), error %d\n", > cpuid, target_cpu, err)); > pcpu_destroy(pcpup); > kmem_free((vm_offset_t)dpcpu[cpuid - 1], DPCPU_SIZE); > dpcpu[cpuid - 1] =3D NULL; > kmem_free((vm_offset_t)bootstacks[cpuid], PAGE_SIZE); > bootstacks[cpuid] =3D NULL; > mp_ncpus--; > return (false); > } > = --------------------------------------------------------------------------= ------------------------------------------------ > I got the following log > --------------------------------- > Starting CPU 1 (1) > Starting psci_cpu_on(1, f22008c8, 1) > Starting CPU 1 (1) psci_cpu_on return (-9) > Starting CPU 1 (100) > Starting psci_cpu_on(100, f22008c8, 1) > Starting CPU 1 (100) psci_cpu_on return (-9) > Starting CPU 1 (101) > ...... > ---------------------------------- The firmware thinks this address is invalid. =46rom the version of the = Trusted Firmware-A I found it checks if the address is within one of the = three DRAM banks and not within the secure region. These two checks = should pass. It then tries to read the fdt memory node and check if the = address is within one of the regions it provides. It can also file if it = is unable to read this node, or the entry point is not within one of the = memory regions the node describes. Are you able to get a dump of the /memory@80000000 node from the = firmware? e.g. from loader.efi the following commands should work = (assuming it=E2=80=99s passed into loader by the firmware): fdt cd /memory@80000000 fdt prop Andrew From nobody Sun Aug 29 21:00:49 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F1C191798338 for ; Sun, 29 Aug 2021 21:00:49 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GyQpT24plz4WVM for ; Sun, 29 Aug 2021 21:00:49 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A80011A9F for ; Sun, 29 Aug 2021 21:00:49 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 17TL0ner094899 for ; Sun, 29 Aug 2021 21:00:49 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 17TL0n4D094898 for freebsd-arm@FreeBSD.org; Sun, 29 Aug 2021 21:00:49 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202108292100.17TL0n4D094898@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: freebsd-arm@FreeBSD.org Subject: Problem reports for freebsd-arm@FreeBSD.org that need special attention Date: Sun, 29 Aug 2021 21:00:49 +0000 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="16302708490.54CCb.93640" Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: Y --16302708490.54CCb.93640 Date: Sun, 29 Aug 2021 21:00:49 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 238576 | Raspberry Pi 3B+ "shutdown -p" does not shut off Open | 239673 | Spurious Interrupt message from /dev/led/led1 Open | 257670 | mpr(4): SAS3008 PCI-Express Fusion-MPT SAS-3: Fat 3 problems total for which you should take action. --16302708490.54CCb.93640--