From nobody Tue Aug 22 16:28:05 2023 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 4RVZX56CC8z4r6JS for ; Tue, 22 Aug 2023 16:28:05 +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 4RVZX549Vfz4Y7Y for ; Tue, 22 Aug 2023 16:28:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692721685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnThIxVV6imfWnhrc6bgUZruwfq/8CFx7NHMy3EP/Ak=; b=sY1swOZfzACXPzzGDgWtYS6MA6cHiAtx1K2mYRRHkx0NURoVz9V2cnrIoXUEwLi950ggPh pkauYtlvxPnUArDSWyoCjScmAn5LTvP+jXDhJJBFjW+16eaYH1FJJTVA+FdseMc1/tZhKE IO8F4YusJ1+pFgcwd4nC+x+mTS54701okSB03CgGaSfL/PQgLu1SfPSH4jS6vrfRakMzhv P9rqLWEnEpyGjEPCBZCbJDBVBEenLrW+IXWlLjg1KAKlQYT7FXqM5q2dLjX9khGq038RVk IsG0fEIzHWLEdbV7NbTeQ4GYkPAKT1qUIhSHq4cEVQio9n0wX9FwaYFXl5rfSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692721685; a=rsa-sha256; cv=none; b=Q6+NLqpcuU5GsLKuO8akxdd3oXGcbkhtHzTRjfeYiviPljNuKsiWQfAoGSNkLtTTCTW5Bd f8cM+n8mLEdViDSqhuIBiaMxHldtVB/I11+x3c8cs18WRu6g0Qo9vxlk6QcsYxB18R3NX4 2tUlNIDFG9+De/HoyYeOIaRup5RLORPCnMMARZa183HiB2WHmWAm3mYyRTKHkIYshPKxFt qhMO2cYPMvyzMQ5Aawz1ELtzHqbUkc+MzYb3q6f7XEV7VV3ggaQkkGbmDz3vmy99NHqJGM jLnTWLX1CpoyGNpRdncEak78FoIdip/IN7axHzcQoObASKp3urNUIb95cC6usg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RVZX53DKrz18n7 for ; Tue, 22 Aug 2023 16:28:05 +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 37MGS5Xk079895 for ; Tue, 22 Aug 2023 16:28:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 37MGS5lv079894 for freebsd-arm@FreeBSD.org; Tue, 22 Aug 2023 16:28:05 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 273295] lock order reversal and nonsleepable lock in malloc in gpioled0 attach on Raspberry Pi Date: Tue, 22 Aug 2023 16:28:05 +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 Some People X-Bugzilla-Who: karels@freebsd.org 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273295 Bug ID: 273295 Summary: lock order reversal and nonsleepable lock in malloc in gpioled0 attach on Raspberry Pi Product: Base System Version: CURRENT Hardware: arm64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: karels@freebsd.org When booting 14.0-ALPHA2 on Raspberry Pi 3B+ and 4B, a lock order reversal = is found when attaching gpioled0. This is followed by 3 or 4 complaints about malloc being called with a non-sleepable lock held (3 on RPi 4, 4 on RPi 3)= .=20 The messages from RPi3 are included here: gpioled0: on ofwbus0 lock order reversal: (sleepable after non-sleepable) 1st 0xffff000000d446f8 LED mtx (LED mtx, sleep mutex) @ /usr/src/sys/dev/led/led.c:296 2nd 0xffffa000017b1c10 Raspberry Pi firmware gpio (Raspberry Pi firmware g= pio, sx) @ /usr/src/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c:250 lock order LED mtx -> Raspberry Pi firmware gpio attempted at: #0 0xffff0000004d6db8 at witness_checkorder+0xa98 #1 0xffff000000471184 at _sx_xlock+0x7c #2 0xffff0000008b6230 at rpi_fw_gpio_pin_set+0xe0 #3 0xffff0000001c75ac at led_create_state+0x158 #4 0xffff000000191280 at gpioled_attach+0x290 #5 0xffff0000004a1598 at device_attach+0x3f8 #6 0xffff0000004a1108 at device_probe_and_attach+0x7c #7 0xffff0000004a3448 at bus_generic_new_pass+0xfc #8 0xffff0000004a33f8 at bus_generic_new_pass+0xac #9 0xffff0000004a33f8 at bus_generic_new_pass+0xac #10 0xffff00000049e324 at bus_set_pass+0x4c #11 0xffff0000003eb910 at mi_startup+0x1fc #12 0xffff0000000008ac at virtdone+0x70 uma_zalloc_debug: zone "malloc-64" with the following non-sleepable locks h= eld: exclusive sleep mutex LED mtx (LED mtx) r =3D 0 (0xffff000000d446f8) locked= @ /usr/src/sys/dev/led/led.c:296 stack backtrace: #0 0xffff0000004d71fc at witness_debugger+0x5c #1 0xffff0000004d8400 at witness_warn+0x400 #2 0xffff0000007869cc at uma_zalloc_debug+0x30 #3 0xffff00000078654c at uma_zalloc_arg+0x2c #4 0xffff000000439b78 at malloc+0x8c #5 0xffff0000008ab498 at bcm2835_firmware_property+0x44 #6 0xffff0000008b6248 at rpi_fw_gpio_pin_set+0xf8 #7 0xffff0000001c75ac at led_create_state+0x158 #8 0xffff000000191280 at gpioled_attach+0x290 #9 0xffff0000004a1598 at device_attach+0x3f8 #10 0xffff0000004a1108 at device_probe_and_attach+0x7c #11 0xffff0000004a3448 at bus_generic_new_pass+0xfc #12 0xffff0000004a33f8 at bus_generic_new_pass+0xac #13 0xffff0000004a33f8 at bus_generic_new_pass+0xac #14 0xffff00000049e324 at bus_set_pass+0x4c #15 0xffff0000003eb910 at mi_startup+0x1fc #16 0xffff0000000008ac at virtdone+0x70 uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks h= eld: exclusive sleep mutex LED mtx (LED mtx) r =3D 0 (0xffff000000d446f8) locked= @ /usr/src/sys/dev/led/led.c:296 stack backtrace: #0 0xffff0000004d71fc at witness_debugger+0x5c #1 0xffff0000004d8400 at witness_warn+0x400 #2 0xffff0000007869cc at uma_zalloc_debug+0x30 #3 0xffff00000078654c at uma_zalloc_arg+0x2c #4 0xffff000000439b78 at malloc+0x8c #5 0xffff0000007d1c4c at bounce_bus_dmamem_alloc+0x50 #6 0xffff0000008adf04 at bcm2835_mbox_property+0xdc #7 0xffff0000008ab4cc at bcm2835_firmware_property+0x78 #8 0xffff0000008b6248 at rpi_fw_gpio_pin_set+0xf8 #9 0xffff0000001c75ac at led_create_state+0x158 #10 0xffff000000191280 at gpioled_attach+0x290 #11 0xffff0000004a1598 at device_attach+0x3f8 #12 0xffff0000004a1108 at device_probe_and_attach+0x7c #13 0xffff0000004a3448 at bus_generic_new_pass+0xfc #14 0xffff0000004a33f8 at bus_generic_new_pass+0xac #15 0xffff0000004a33f8 at bus_generic_new_pass+0xac #16 0xffff00000049e324 at bus_set_pass+0x4c #17 0xffff0000003eb910 at mi_startup+0x1fc uma_zalloc_debug: zone "malloc-128" with the following non-sleepable locks held: exclusive sleep mutex LED mtx (LED mtx) r =3D 0 (0xffff000000d446f8) locked= @ /usr/src/sys/dev/led/led.c:296 stack backtrace: #0 0xffff0000004d71fc at witness_debugger+0x5c #1 0xffff0000004d8400 at witness_warn+0x400 #2 0xffff0000007869cc at uma_zalloc_debug+0x30 #3 0xffff00000078654c at uma_zalloc_arg+0x2c #4 0xffff000000439b78 at malloc+0x8c #5 0xffff0000007d1c9c at bounce_bus_dmamem_alloc+0xa0 #6 0xffff0000008adf04 at bcm2835_mbox_property+0xdc #7 0xffff0000008ab4cc at bcm2835_firmware_property+0x78 #8 0xffff0000008b6248 at rpi_fw_gpio_pin_set+0xf8 #9 0xffff0000001c75ac at led_create_state+0x158 #10 0xffff000000191280 at gpioled_attach+0x290 #11 0xffff0000004a1598 at device_attach+0x3f8 #12 0xffff0000004a1108 at device_probe_and_attach+0x7c #13 0xffff0000004a3448 at bus_generic_new_pass+0xfc #14 0xffff0000004a33f8 at bus_generic_new_pass+0xac #15 0xffff0000004a33f8 at bus_generic_new_pass+0xac #16 0xffff00000049e324 at bus_set_pass+0x4c #17 0xffff0000003eb910 at mi_startup+0x1fc uma_zalloc_debug: zone "malloc-64" with the following non-sleepable locks h= eld: exclusive sleep mutex LED mtx (LED mtx) r =3D 0 (0xffff000000d446f8) locked= @ /usr/src/sys/dev/led/led.c:296 stack backtrace: #0 0xffff0000004d71fc at witness_debugger+0x5c #1 0xffff0000004d8400 at witness_warn+0x400 #2 0xffff0000007869cc at uma_zalloc_debug+0x30 #3 0xffff00000078654c at uma_zalloc_arg+0x2c #4 0xffff000000439b78 at malloc+0x8c #5 0xffff0000007d1d1c at bounce_bus_dmamem_alloc+0x120 #6 0xffff0000008adf04 at bcm2835_mbox_property+0xdc #7 0xffff0000008ab4cc at bcm2835_firmware_property+0x78 #8 0xffff0000008b6248 at rpi_fw_gpio_pin_set+0xf8 #9 0xffff0000001c75ac at led_create_state+0x158 #10 0xffff000000191280 at gpioled_attach+0x290 #11 0xffff0000004a1598 at device_attach+0x3f8 #12 0xffff0000004a1108 at device_probe_and_attach+0x7c #13 0xffff0000004a3448 at bus_generic_new_pass+0xfc #14 0xffff0000004a33f8 at bus_generic_new_pass+0xac #15 0xffff0000004a33f8 at bus_generic_new_pass+0xac #16 0xffff00000049e324 at bus_set_pass+0x4c #17 0xffff0000003eb910 at mi_startup+0x1fc armv8crypto0: CPU lacks AES instructions --=20 You are receiving this mail because: You are the assignee for the bug.=