From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED86DC43458 for ; Wed, 1 Jul 2026 12:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dQ9pt6pdhAUEkIL6Lnhp9e6wagB58+Ey6NH5PgalHfc=; b=U/YBmrvmSDfwDzU2pbXh3ILtYr Xl+nwcOT0i6uPX/3by6sHa00U6V9Q89vkIAp4rwlBRVTs8jyNs5yqnjxnKN1PYmr5EdIP/ALMVlsy nCgsB0XO+HJDxlMA8NrUI5DgNOVmHTev+0R3SXgeD66ZuknnMQNmADPIZSBt+Sy7sgsHxZoYASRtV 1aW9+pOn0f8/hq283pJ+q8byNi5thGbTb0vdQXUnvXdaUNOuGLaxVhV4ebUpuNzRABsa5hpTviaYw hVs5kxtSPXYcSwtarOIK7umha2gpprMz5zLFTk+OXxBTJ3YYNTT1DxA1NXjqo93GweIbCpgTSoOXO IIxkVP9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wetpU-00000001oS0-04Qh; Wed, 01 Jul 2026 12:14:12 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wetpS-00000001oQS-2DAi for linux-mediatek@bombadil.infradead.org; Wed, 01 Jul 2026 12:14:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=dQ9pt6pdhAUEkIL6Lnhp9e6wagB58+Ey6NH5PgalHfc=; b=WliHdyHdOB5MMnnbCxdwAgLpqX 1ePqnrpGVyJiv9piGBrN52Zpk66xz95P7OVontrrtJ8Ht0n4vyOByyC9RAjhqn4UEBl1hrFnh2vR8 N0Pb1V5byouB31wFtvtNFBX3Z0XkyIzwD//fFhyrd358E7P3SYU2imLBPWpcEZ97j+HCbC0L3AcvZ asqbd+0d4J1DYjUs1hGLdbnj3qTd7tSomi3gvx3PazuphMZCVEAf+aBvde54rj22im4GngxjzUNMW 5RgVamUKqUuV3psr0hlyQXguBuKv0QJCtQiEmJlxUtTpjpRF0NIffdMQGRGjnfKeuTg1ULsf2BaJ7 JfcKiXpA==; Received: from [216.200.240.184] (helo=mailgw01.mediatek.com) by desiato.infradead.org with esmtps (Exim 4.99.2 #2 (Red Hat Linux)) id 1wetpP-00000002ifj-1NrB for linux-mediatek@lists.infradead.org; Wed, 01 Jul 2026 12:14:09 +0000 X-UUID: 5197e79e754611f1afed4741b24580c9-20260701 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=dQ9pt6pdhAUEkIL6Lnhp9e6wagB58+Ey6NH5PgalHfc=; b=d+mpgTyYqVyIwdBx0iYwG9BFYSVLnSWsYtfqDLf8/D4g/v0UT96vh0lThAbpOXu9Z+4nQ9mE5tMRL580AckmQlJEghxsnWk/XTLNsg8ztE0Nf/nzz06PYvPjWbwwXSbJ/yiLqpk9GOEASI1JCUW2onAimAmpw2gAuHxaUWR0mC0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.17,REQID:e5b6a00d-aac5-4e59-b949-7bccf85d4523,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:d497b38,CLOUDID:3561de81-6310-4e6b-a6b1-aca20d98ed8b,B ulkID:nil,BulkQuantity:0,SF:81|82|102|836|865|888|898,TC:-5,Content:0|15|5 0|99|200|213,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,COL: 0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 5197e79e754611f1afed4741b24580c9-20260701 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1270944332; Wed, 01 Jul 2026 05:13:50 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Wed, 1 Jul 2026 20:13:47 +0800 Received: from mtksitap99.mediatek.inc (10.233.130.16) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Wed, 1 Jul 2026 20:13:47 +0800 From: Chris Lu To: Marcel Holtmann , Johan Hedberg , Luiz Von Dentz CC: Sean Wang , Will Lee , SS Wu , Steve Lee , linux-bluetooth , linux-kernel , linux-mediatek , Paul Menzel , Chris Lu Subject: [PATCH v7 2/3] Bluetooth: btmtk: Improve BT firmware logging Date: Wed, 1 Jul 2026 20:13:44 +0800 Message-ID: <20260701121345.1231906-3-chris.lu@mediatek.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260701121345.1231906-1-chris.lu@mediatek.com> References: <20260701121345.1231906-1-chris.lu@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260701_131407_881164_F823CE55 X-CRM114-Status: GOOD ( 11.71 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Improve firmware loading log messages to provide more useful information: - Add firmware filename before loading to help identify which file is being loaded - Display chip ID (dev_id) as HW version instead of firmware's hwver field, which provides more meaningful hardware identification - Use %.16s format specifier for hdr->datetime field to prevent potential buffer over-read, as the field is a 16-byte array that may not be null-terminated log output with MT7922 [ 212.878783] Bluetooth: hci1: Loading BT firmware: mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin [ 212.889614] Bluetooth: hci1: BT HW ver: 0x7922, SW ver: 0x008a, Build Time: 20260224103448 [ 216.048877] Bluetooth: hci1: Device setup in 3096530 usecs [ 216.048890] Bluetooth: hci1: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported. [ 216.114179] Bluetooth: hci1: AOSP extensions version v1.00 [ 216.114220] Bluetooth: hci1: AOSP quality report is supported [ 216.116782] Bluetooth: MGMT ver 1.23 Signed-off-by: Chris Lu Assisted-by: Claude:Sonnet-4.5 --- drivers/bluetooth/btmtk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 40c2a64aa6b7..e24f9e9fc008 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -147,6 +147,8 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, u32 section_num, dl_size, section_offset; u8 cmd[64]; + bt_dev_info(hdev, "Loading BT firmware: %s", fwname); + err = request_firmware(&fw, fwname, &hdev->dev); if (err < 0) { bt_dev_err(hdev, "Failed to load firmware file (%d)", err); @@ -159,8 +161,8 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, globaldesc = (struct btmtk_global_desc *)(fw_ptr + MTK_FW_ROM_PATCH_HEADER_SIZE); section_num = le32_to_cpu(globaldesc->section_num); - bt_dev_info(hdev, "HW/SW Version: 0x%04x%04x, Build Time: %s", - le16_to_cpu(hdr->hwver), le16_to_cpu(hdr->swver), hdr->datetime); + bt_dev_info(hdev, "BT HW ver: 0x%04x, SW ver: 0x%04x, Build Time: %.16s", + dev_id & 0xffff, le16_to_cpu(hdr->swver), hdr->datetime); for (i = 0; i < section_num; i++) { first_block = 1; -- 2.45.2