From nobody Thu May 11 04:05:19 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 4QGywb5nzsz49cP4 for ; Thu, 11 May 2023 04:05:19 +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 4QGywb331dz47xT for ; Thu, 11 May 2023 04:05:19 +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=1683777919; 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=N19oYBhEcLRakTb0HOfylrLm3BT4XRgUq4cI+ZUCG1A=; b=JsuOhpjAj2YsZ50g5z70mTv1h+VI1WMyHJFqdbFwLJgixItDiYgQOdzCQn6VJoN4p5Dslg BrJu+FuEMNyMkNJZTF0ttFaQxzLzroG435NuDkvfvDpUMvwMBRx/MkIBgOWelZVIvSW3cd LLvG0xY3U2xXII4TGBKiJuUp9BK4tBmHfk5f5bBzeiH9BNnlucU6Xq7ICtEuLFBIt4CfiC raw4DEjXqJhI1/xZjuY+TtmJhOyBm1PRQB97LtdsfM8c3qP9mepZQxhiSPkPBJOuAhTswS i7EwaHmcbmx4vbwFoBhcKmVP5+C3G0NQ/bx4qLlCrD7XsaxfsmwDPKdKhH6a+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683777919; a=rsa-sha256; cv=none; b=YkrE2Z2KFUDDzLL/+XDcfdIUzldispWotNcZT26cP8/tCPWjqM4uLQCD4AfTHPGsm610Py LqXWwrmFDkF+r0y+KarNdv0lCokpxzHcFsABzzz7EEPVRBhQB6QZiJ28sATs8ClWtT+Vtf ZwOuXT9GBcL7HyKUlSGe/rXwbN7me8mu/ujNAZMhkolETzeyqEzGUyMph4YJc/w1SRNAmI fis6Sc1srpN4yBG9YY5nR6NECndB+lpxfBNDqR4kR3YHavLqGKlrx85focOGwNELO6ay6s YIdkx9iSOORwxYQfTFtWk3GkPtgFWGj8T/Llc3PRGf8RSUDk/+yisTqu76Hv0w== 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 4QGywb25ZHzctc for ; Thu, 11 May 2023 04:05:19 +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 34B45Jb5067912 for ; Thu, 11 May 2023 04:05:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 34B45Jos067911 for freebsd-arm@FreeBSD.org; Thu, 11 May 2023 04:05:19 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 271359] RPi4: reset after shutdown -h doesn't work. Date: Thu, 11 May 2023 04:05:19 +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: 13.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: t_uemura@macome.co.jp 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 attachments.created 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=3D271359 Bug ID: 271359 Summary: RPi4: reset after shutdown -h doesn't work. Product: Base System Version: 13.2-STABLE Hardware: arm64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: t_uemura@macome.co.jp Created attachment 242116 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D242116&action= =3Dedit Ugly but reliable way of workaround. On RPi4B running 13.2-RELEASE official image (or home-brew 13.2-STABLE with more recent u-boot and firmware), reset after shutdown -h by pressing a key= to "The operating system has halted.\nPlease press any key to reboot." prompt never works as expected. It simply freezes just after "Rebooting..." messag= e, and a power cycle is required to restart the operating system. Precisely, reset after shutdown -h is handled by sys/kern/kern_shutdown.c:shutdown_reset() but there are two hardware specif= ic issues here.=20 The one is that mtx_lock_spin(&smp_ipi_mtx) never returns. I don't know how important this lock is and tried to see by commenting it out, and faced ano= ther issue. If I omitted the lock, then psci_call(PSCI_FNID_SYSTEM_RESET) was subsequen= tly called from cpu_lock() and it never successfully reset the board. Just stop. Screen was still on and "Rebooting..." was intact. I don't know whether this psci_call() failure is caused by the skipped lock. To workaround, a watchdog firing is good alternative, as did in sys/arm/broadcom/bcm2835/bcm2835_wdog.c:bcmwd_reboot_system(). I was very reluctant to add machine-dependent code to the file under sys/ke= rn, but I couldn't think of any other way to get around the lock other than what was did in the attached patch. --=20 You are receiving this mail because: You are the assignee for the bug.=