Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp3459987rwb; Sun, 30 Jul 2023 08:06:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlExIsDNYidAPSOPTgZWnWCBK9rlkKzpPUYQKF7k7RqGwhWlZ8Rv8kd9JM94dtY89NylbHx/ X-Received: by 2002:aa7:c741:0:b0:51d:9ddf:f0f6 with SMTP id c1-20020aa7c741000000b0051d9ddff0f6mr6584572eds.36.1690729590652; Sun, 30 Jul 2023 08:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690729590; cv=none; d=google.com; s=arc-20160816; b=h5JuU4kJgCFwseW7rkkzZjwtl+lxozZL5eADaD6MgnhbWSGOxnaNX3zkWyLXJCArrI NqRDyzf1v6m7tFD6mdZwGGIcrSJFwVjyhViiMI78LlTnhCZYOxDiE49rjzO85fzUcJQ1 IOOwDzsDBjeWpXvuhGry2QbVcIkhRfEpi0lyrYMNl/gIcK19zQqC/3Y5ObLc9RFdyVJZ zyqHE2ZR5QuY69bX8m+faX7eDn69WNXWnt+jQZVdGo9emw3nkUU2GxohXVo4hdJoNfrd aCybCkW4ThcT70HgqyhFY0l0QgM4Ys2wRcFjqLHm6o1npfn0elXa7Y6doL1KAsMf1ivv IQEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :subject:from:to:content-language:mime-version:date:message-id :dkim-signature; bh=c0h5A/pykgYTd2SJil4rljQR3NvacFZcrBdPcRCugw8=; fh=yiWmj4nqmtU8mMD8rsV7ywTQe755WBqbyyQsJzehF4Y=; b=QD7k0nqVVWg/PXoDrsdPTJZz1qdIL7w9ZXNiS3Bc9P/Mr793+OJBsD+gyzvrIURlyv 1JcAcSgO/QhqK/JKaI7Ik6Uk1bX9/qzwAUXtRmwDyt7aMV59SR82DHN2GNckg2G0CIqa tHOZIjZO3XEp8aXxOFCzBXZup272W8ZUgf33ffXFUNyIKftyALTUCB238lDaKBnWc+A8 Uyb6/wR3YWgz6CgsroPR3pH8XhQCc9US3OqwwJHglSP9hCIJVBpcL7c0twjk+bPAT9IR usv2Y7R4WRfL7jcWPxr2CczN58WWPcq4Bmz2jXnJh6r2mv2l44RaiOVg1ANROx+nxwKE axlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=XuseGh+R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020aa7ce0e000000b00521e50a9c89si2582068edv.435.2023.07.30.08.06.03; Sun, 30 Jul 2023 08:06:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=XuseGh+R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230118AbjG3Nam (ORCPT + 99 others); Sun, 30 Jul 2023 09:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbjG3Nal (ORCPT ); Sun, 30 Jul 2023 09:30:41 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ECB01700 for ; Sun, 30 Jul 2023 06:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.com; s=s31663417; t=1690723836; x=1691328636; i=aros@gmx.com; bh=l5krJ3jVttvwQkkfk6cfKWWfR1eKtB3g81VmPSj2Ekc=; h=X-UI-Sender-Class:Date:To:From:Subject; b=XuseGh+RbeY3H6gFebUMw71HjxguP0+z0NHYQNO4EmtvM3u7bIJk+9b5wNPNh9zOSmtGAkI rHCtheKUYUqazBbujxmzuFN3jaYZ6/i407cryxCdkh2drBKB4vpIslnizS/5ZGCSTmVN+WBRr x8KMIcjPMMBYp5tM7j1bk6y+czwjlKy1lK8A7SfEtbNnmzbEkQvSRZg/oMlgnCwKtvWWLhe/n U+dYXvEyGiZ3wsgq54xNylZOk1t73gSEzkyMpCdf5/NNhmDEcaSyWlwRjRbUYDmGuK1SQxsBa PMlnCbY2MiWP+BZ1qqAV9uYd8y7jgtlvE4iMjJzwFLUDB7uCc3OQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [10.35.110.16] ([98.159.234.36]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M42jQ-1qQ6VH2wwS-0004Em; Sun, 30 Jul 2023 15:30:35 +0200 Message-ID: <16a44663-808c-2eb4-ea6e-66f51a66f7cf@gmx.com> Date: Sun, 30 Jul 2023 13:30:34 +0000 MIME-Version: 1.0 Content-Language: en-US To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org From: "Artem S. Tashkinov" Subject: Very bad bad firmware loading reporting situation Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:1pMQTssx+5e9+gHWi7B2riude2WpZ4J8wUFZSk6jFQYY0cOEdUA SmgvwyXZO7nrGCnlBEJR/xPSZbl0sdEfygKig/Jvfh0VaxdYslQ0x0aWqq2/Xg2p/sU4z/q j8Dje0uRZSkPBydcF0MW/ofPXn4RMONOmGi0edjTX8CcGU6fIBXVfHoBa9UpxAqGGiP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, score=0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_SBL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everyone, I really dislike how firmware loading is handled by kernel [modules]: * Many modules don't report which firmware files are getting loaded * Often no information is reported in regard to firmware files themselves, such as version, date or firmware file size. In a perfect world it would be nice to at least see the CRC32 checksum of the firmware file. * Often bus and address are not clearly indicated. * All the required firmware files must be probed simultaneously (file_exists()) and reported if any of them are missing _before_ attempting to load any of them. For instance missing firmware files for the amdgpu driver may lead to a system instability or outright crashes= . This needs to change. What I expect to see in `dmesg`: module_name: PCI-e 0000:01:00.0 Loading firmware file 'directory/fw1.bin', version 1.2.3, size 12345 bytes module_name: PCI-e 0000:01:00.0 Loading firmware file 'directory/fw2.bin', version , size 23456 bytes module_name: PCI-e 0000:01:00.0 Loading firmware file 'directory/fw3.bin', version 1.0.0, size 4444 bytes In case fw2.bin or fw3.bin is missing, the module must report that info _before_ attempting to load any found/existing firmware files. module_name: PCI-e 0000:01:00.0 Warning: missing firmware file 'directory/fw3.bin' module_name: PCI-e 0000:01:00.0 Warning: missing firmware file 'directory/fw2.bin' module_name: PCI-e 0000:01:00.0 Loading firmware file 'directory/fw1.bin', version 1.2.3, size 12345 bytes As it currently stands firmware files are loaded on a one by one basis, so in case you don't want to keep hundreds of megabytes of useless files in /lib/firmware, several reboot attempts may be required to figure out all the missing firmware files which is far from optimal. Case in point: cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2 cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2 cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: xz decompression failed (xz_ret= =3D6) cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Falling back to default firmware= . No information about firmware being requested whatsoever. No information about bus or hardware device or maybe there is but it's hard to read. There's no module named "cs35l41-hda". Another example: mt7921e 0000:01:00.0: enabling device (0000 -> 0002) mt7921e 0000:01:00.0: ASIC revision: 79220010 mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 2023062714370= 2a mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20230627143946 No information about firmware file(s) being loaded whatsoever. Actually three files are being loaded by this device (Wi-Fi + BlueTooth). This issue is tracked here: https://bugzilla.kernel.org/show_bug.cgi?id=3D217734