From owner-freebsd-x11@freebsd.org Tue Apr 21 13:09:50 2020 Return-Path: Delivered-To: freebsd-x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A21E2CD157 for ; Tue, 21 Apr 2020 13:09:50 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4963nT4Wrkz4J3L for ; Tue, 21 Apr 2020 13:09:49 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: by mailman.nyi.freebsd.org (Postfix) id 9B2DE2CD153; Tue, 21 Apr 2020 13:09:49 +0000 (UTC) Delivered-To: x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AEFC2CD152 for ; Tue, 21 Apr 2020 13:09:49 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mxt.nsu.ru (mxt.nsu.ru [84.237.50.40]) (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 4963nR5BbQz4J3F; Tue, 21 Apr 2020 13:09:47 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from zimbra.nsu.ru ([84.237.50.42]) by mxt.nsu.ru with esmtp (Exim 4.89) (envelope-from ) id 1jQsel-0007Yj-9v; Tue, 21 Apr 2020 20:09:43 +0700 Received: from localhost (localhost [127.0.0.1]) by zimbra.nsu.ru (Postfix) with ESMTP id 45A2DAC06DB; Tue, 21 Apr 2020 20:09:43 +0700 (+07) Received: from zimbra.nsu.ru ([127.0.0.1]) by localhost (zimbra.nsu.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id g4sfl8RXBCVp; Tue, 21 Apr 2020 20:09:42 +0700 (+07) Received: from localhost (localhost [127.0.0.1]) by zimbra.nsu.ru (Postfix) with ESMTP id D9013AC127E; Tue, 21 Apr 2020 20:09:42 +0700 (+07) X-Virus-Scanned: amavisd-new at zimbra.nsu.ru Received: from zimbra.nsu.ru ([127.0.0.1]) by localhost (zimbra.nsu.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1b7GUpEQ_Uzh; Tue, 21 Apr 2020 20:09:42 +0700 (+07) Received: from regency.nsu.ru (unknown [84.237.50.47]) by zimbra.nsu.ru (Postfix) with ESMTPS id AC063AC06DB; Tue, 21 Apr 2020 20:09:42 +0700 (+07) Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.14.2/8.14.2) with ESMTP id 03LDA0lT011171; Tue, 21 Apr 2020 20:10:01 +0700 (+07) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.14.2/8.14.2/Submit) id 03LD9t23011114; Tue, 21 Apr 2020 20:09:55 +0700 (+07) (envelope-from danfe) Date: Tue, 21 Apr 2020 20:09:55 +0700 From: Alexey Dokuchaev To: Niclas Zeising Cc: x11@freebsd.org Subject: Re: GPU firmware naming and problems with loading Message-ID: <20200421130955.GA8165@regency.nsu.ru> References: <20200421090909.GB13384@regency.nsu.ru> <8990dbd6-65b7-81f4-e0c5-4541e34afee2@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8990dbd6-65b7-81f4-e0c5-4541e34afee2@freebsd.org> User-Agent: Mutt/1.4.2.1i X-KLMS-Rule-ID: 3 X-KLMS-Message-Action: skipped X-KLMS-AntiSpam-Status: not scanned, whitelist X-KLMS-AntiPhishing: not scanned, whitelist X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, not scanned, whitelist X-Rspamd-Queue-Id: 4963nR5BbQz4J3F X-Spamd-Bar: / X-Spamd-Result: default: False [0.72 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.10)[-0.100,0]; R_DKIM_ALLOW(-0.20)[nsu.ru:s=email]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mxt.nsu.ru]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.75)[-0.748,0]; IP_SCORE(1.77)[ip: (5.17), ipnet: 84.237.48.0/21(2.04), asn: 3335(1.63), country: RU(0.01)]; DKIM_TRACE(0.00)[nsu.ru:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[40.50.237.84.list.dnswl.org : 127.0.11.0]; DMARC_POLICY_ALLOW(-0.50)[nsu.ru,quarantine]; FORGED_SENDER(0.30)[danfe@nsu.ru,danfe@regency.nsu.ru]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:3335, ipnet:84.237.48.0/21, country:RU]; FROM_NEQ_ENVFROM(0.00)[danfe@nsu.ru,danfe@regency.nsu.ru]; RCVD_COUNT_SEVEN(0.00)[8]; DWL_DNSWL_NONE(0.00)[nsu.ru.dwl.dnswl.org : 127.0.11.0] X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 13:09:50 -0000 On Tue, Apr 21, 2020 at 01:24:05PM +0200, Niclas Zeising wrote: > On 2020-04-21 11:09, Alexey Dokuchaev via freebsd-x11 wrote: > > ... > >Looks as new DRM code tries to load `/boot/modules/radeon/ARUBA_pfp.bin.ko' > >et al., does not find them, and locks up the system, while the legacy code > >would try to replace the slash with underscore to generate "mapped name", > >which works (since /boot/modules/radeon_ARUBA_pfp_bin.ko does exist). > > > >Can we please decide on the firmware layout, fix this naming/search bug > >and make it universal across all DRM ports, at the very least? How does > >this even works for other people? :-/ > > As you can see in the two prints, the "could not load firmware image", > comes from ./sys/kern/subr_firmware.c in the base system. > The reason it appears twice, at least for drm-kmod, is that the code > tries to load the firmware multiple times, guessing where it is. It > first tries radeon/TAHITI_pfp.bin twice, then replaces / and . with _ > and tries again. > > IIRC, this was done in order to handle differences between how Linux and > FreeBSD, and AMD and Intel handles firmware and firmware names. *sigh* Classic example of Linux' development methodologies. Instead of fixing the mess, they're trying to heuristically embrace it. :-) > Please test the patch and give the output, that way we should be able to > see how far firmware loading goes. Thanks, I've applied and rebuilt. I've also applied EDID patch from PR 245730 just in case. Here's more complete log, including what was printed before "Loading ARUBA Microcode". Should I worry about those lines marked with *'s? [drm] radeon kernel modesetting enabled. drmn0: on vgapci0 vgapci0: child drmn0 requested pci_enable_io last message repeated 1 times [drm] initializing kernel modesetting (ARUBA 0x1002:0x990D 0x103C:0x1992 0x00). [drm] register mmio base: 0xD6000000 [drm] register mmio size: 262144 * [drm:radeon_device_init] Unable to find PCI I/O BAR * [drm:radeon_atombios_init] Unable to find PCI I/O BAR; using MMIO for ATOM IIO ATOM BIOS: HP drmn0: VRAM: 768M 0x0000000000000000 - 0x000000002FFFFFFF (768M used) drmn0: GTT: 1024M 0x0000000030000000 - 0x000000006FFFFFFF [drm] Detected VRAM RAM=768M, BAR=256M [drm] RAM width 64bits DDR [TTM] Zone kernel: Available graphics memory: 7958688 kiB [TTM] Zone dma32: Available graphics memory: 2097152 kiB [TTM] Initializing pool allocator [drm] radeon: 768M of VRAM memory ready [drm] radeon: 1024M of GTT memory ready. [drm] Loading ARUBA Microcode drmn0: try to load firmware with name: radeon/ARUBA_pfp.bin radeon/ARUBA_pfp.bin: could not load firmware image, error 2 drmn0: retry to load firmware with name: radeon/ARUBA_pfp.bin radeon/ARUBA_pfp.bin: could not load firmware image, error 2 drmn0: successfully linked firmware module with mapped name: radeon_ARUBA_pfp_bin drmn0: try (0) to load firmware image with name: radeon/ARUBA_pfp.bin drmn0: successfully loaded firmware image with name: radeon/ARUBA_pfp.bin drmn0: try to load firmware with name: radeon/ARUBA_me.bin radeon/ARUBA_me.bin: could not load firmware image, error 2 drmn0: retry to load firmware with name: radeon/ARUBA_me.bin radeon/ARUBA_me.bin: could not load firmware image, error 2 drmn0: successfully linked firmware module with mapped name: radeon_ARUBA_me_bin drmn0: try (0) to load firmware image with name: radeon/ARUBA_me.bin drmn0: successfully loaded firmware image with name: radeon/ARUBA_me.bin drmn0: try to load firmware with name: radeon/ARUBA_rlc.bin radeon/ARUBA_rlc.bin: could not load firmware image, error 2 drmn0: retry to load firmware with name: radeon/ARUBA_rlc.bin radeon/ARUBA_rlc.bin: could not load firmware image, error 2 drmn0: successfully linked firmware module with mapped name: radeon_ARUBA_rlc_bin drmn0: try (0) to load firmware image with name: radeon/ARUBA_rlc.bin drmn0: successfully loaded firmware image with name: radeon/ARUBA_rlc.bin [drm] Internal thermal controller without fan control [drm] radeon: dpm initialized drmn0: try to load firmware with name: radeon/TAHITI_uvd.bin radeon/TAHITI_uvd.bin: could not load firmware image, error 2 drmn0: retry to load firmware with name: radeon/TAHITI_uvd.bin radeon/TAHITI_uvd.bin: could not load firmware image, error 2 drmn0: successfully linked firmware module with mapped name: radeon_TAHITI_uvd_bin drmn0: try (0) to load firmware image with name: radeon/TAHITI_uvd.bin drmn0: successfully loaded firmware image with name: radeon/TAHITI_uvd.bin drmn0: try to load firmware with name: radeon/TAHITI_vce.bin radeon/TAHITI_vce.bin: could not load firmware image, error 2 drmn0: retry to load firmware with name: radeon/TAHITI_vce.bin radeon/TAHITI_vce.bin: could not load firmware image, error 2 drmn0: successfully linked firmware module with mapped name: radeon_TAHITI_vce_bin Why is it trying to load TAHITI modules is another question. It was always just three ARUBA modules AFAIR, all the way back to ca. 2017 when X11 was fully working on this laptop. ./danfe