From nobody Sun Dec 01 19:45:15 2024 X-Original-To: dev-commits-src-main@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 4Y1cp32zZTz5g5ZW; Sun, 01 Dec 2024 19:45:15 +0000 (UTC) (envelope-from git@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1cp32F9Sz4CN0; Sun, 1 Dec 2024 19:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733082315; 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=ojgvYdmT2vZjLG/GutE8GVj2qxDfSfkmOr0YGfvmrxA=; b=EBg0MqIh49EKEHgclFiZx3bk2tZL8JzdR24uM8V38W2WjQgwWJ4LPLx1NzsBSyMtRv9YRS HLx8a2kMWV8Q+iMFuKFHMwcS0vo9DbWhN6Un9C4nfR0OHmFAc56HLiWqndp7Iz12va265d rcW8DaaQ43mSgf78xkUZvL8qZQs+U1InBK+vi/yo+HMnku9OIJLO+2+eSl1CnuKnr/kHyd RxnDeDutoiH047Lg//ChWsNVJKVFjXWjryRRgiGSNlLuCfzuFzLsvyftscU2FJS0zM/ek1 0iV0jt8W+ev1ZTSwXznesRYSUfALssJk4TL4syh/cFvYaABCodiHimnNfx49rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733082315; 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=ojgvYdmT2vZjLG/GutE8GVj2qxDfSfkmOr0YGfvmrxA=; b=NKFuhvbAYkW7G9EXZ26mP8gSHRMJo7aMrEseP+jEegoEQmcXFGtgjvgrCbAi2gW56xdPDa v26Tf16mpGEIGiPXlpCVzT7JZZyN7BOZThbLPaM2XgsbIfGoVYHPmuMqtZlQqpxJJJuBxy ctd73ujZyBSWHDvrTQ9Ch+dMgdkSIqgkt+dN9+o72H7919NmrTbEosbztJn2QZNR3qzlfS r2DzSYHwWUyV05KJ6bqcGCfaTWjLcgzCJBp41ewWVGdVApw3I6nJdv+VsSsb/tVgdOPv4j /U+GygIdq/P7Ft3XIm8KgiXO0LifxRPJVkokWNHKXF5zch9V0qFkIUKWL5l1tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733082315; a=rsa-sha256; cv=none; b=nVdRZoEurYoZUO0WHEU4cqcZrvbPsTHr0SXMyVbwxwCYDWoiCqgh84duULX454d79UW6Ie DLjoK80/whGInq3bzExVFWZ9hj45pMBCLXIt7YHmPdMkmMLvUSmSB+USEsDxlvR8mVND+9 g96wAo3Eff6H2XsKWsgK494XHQDuGQAmX2LhAOJEQs3yV2faQg9zUKzOGt5CzLwjRLCpRs PLCvz6Ve9KDyDxurGy5TVOzIWmjp7PVFEIy+QX4vBkFsyk5ZHS35SGo5pMvCDT+bNXsSwj G6LuPc4LEmi4GE00LYBZaBSB2ljHPodt5Kj+ZMhc358C/IHFqgj6dWOXCdxqaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Y1cp31kFjz15wd; Sun, 1 Dec 2024 19:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B1JjF2b059133; Sun, 1 Dec 2024 19:45:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B1JjFHi059130; Sun, 1 Dec 2024 19:45:15 GMT (envelope-from git) Date: Sun, 1 Dec 2024 19:45:15 GMT Message-Id: <202412011945.4B1JjFHi059130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 30d2f84ef2cb - main - LinuxKPI: firmware: change order filenames trying to load firmware List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30d2f84ef2cba12c67c62a9fe4e1d8e22cf27bf9 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=30d2f84ef2cba12c67c62a9fe4e1d8e22cf27bf9 commit 30d2f84ef2cba12c67c62a9fe4e1d8e22cf27bf9 Author: Bjoern A. Zeeb AuthorDate: 2024-11-20 13:12:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-12-01 19:41:46 +0000 LinuxKPI: firmware: change order filenames trying to load firmware Given we have the support in main and stable/14 to load plain firmware files from /boot/firmware/ make use of that. Switch the order to try the original unmangled filename and path first before trying any replacements. This reduces time and console noise (especially under bootverbose). Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47682 --- sys/compat/linuxkpi/common/src/linux_firmware.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_firmware.c b/sys/compat/linuxkpi/common/src/linux_firmware.c index 17da91381280..12658df5ce83 100644 --- a/sys/compat/linuxkpi/common/src/linux_firmware.c +++ b/sys/compat/linuxkpi/common/src/linux_firmware.c @@ -88,17 +88,17 @@ _linuxkpi_request_firmware(const char *fw_name, const struct linuxkpi_firmware * * way rather than adding more name-mangling-hacks here in the future * (though we could if needed). */ - /* (1) Try any name removed of path. */ - fwimg = strrchr(fw_name, '/'); - if (fwimg != NULL) - fwimg++; - if (fwimg == NULL || *fwimg == '\0') - fwimg = fw_name; - fbdfw = firmware_get_flags(fwimg, flags); - /* (2) Try the original name if we have not yet. */ - if (fbdfw == NULL && fwimg != fw_name) { - fwimg = fw_name; - fbdfw = firmware_get_flags(fwimg, flags); + /* (1) Try the original name. */ + fbdfw = firmware_get_flags(fw_name, flags); + /* (2) Try any name removed of path, if we have not yet. */ + if (fbdfw == NULL) { + fwimg = strrchr(fw_name, '/'); + if (fwimg != NULL) + fwimg++; + if (fwimg == NULL || *fwimg == '\0') + fwimg = fw_name; + if (fwimg != fw_name) + fbdfw = firmware_get_flags(fwimg, flags); } /* (3) Flatten '/', '.' and '-' to '_' and try with adjusted name. */ if (fbdfw == NULL &&