From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E9BF448393; Tue, 14 Jul 2026 12:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784032427; cv=none; b=oLzAeEcyTHlctueI3ensw+jVgQ9IpvHVRA6ixVt9x2dDLNjDw7ALP9NIIt3zoBAe8+bXBgcDBkA9nhTWFofhpx/x3+E/mvblUmECdzixVbDEPYuwZ0b9Pw12BLqJqx8j8FMKGo7hFZ66fSGagZyN5msGnNkRcNGtjvndzM1ucE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784032427; c=relaxed/simple; bh=/tX3LmyIgjGCSKTG4vWoxaECrIeQXTlsdyJakbY9Tg0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gk+ZXeEUfTyby4ibzWEIP78ZRPlIjVj93SEeLXKfq33TybEjwxxyIzHHVZWGuyzf0PHAtqXVhqItT7KMXsejTBUq+37cM0XtlHGC8vzS1lVi3jvT4PYq5avz+u9aVSlqPk72fARebirzqkG2KgZVAY9QxDgbFdy5SJi/69zGYMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=cpU+7a55; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="cpU+7a55" X-UUID: 30dd9bb87f8011f18dc8c9802ae25ab1-20260714 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=f/cTAXxiF3k07rNmAgKvsKAUCLozevrZSLPZeWFNbt0=; b=cpU+7a55GNOFtYxRJW8boUTr0Doaa2az4/es2ImdbPcNdqHdWv4nqRjaML3i0vrF2++iAL3FZpEX+V8QHyXeR8aQS11MVERUHEa35HhP21TnvI1vpbCyetRNlF31Kyx493SpI2FgZN4MY7II6aLk7KRPcb0v/X/ZZW7/Qc1DFBQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.17,REQID:cdd338b9-fc70-4fa6-9e57-b8b689c5bf42,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:9d8e2115-ea64-44d4-98db-4e1fb89955a3,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: 30dd9bb87f8011f18dc8c9802ae25ab1-20260714 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1376438619; Tue, 14 Jul 2026 20:33:17 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) 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; Tue, 14 Jul 2026 20:33:16 +0800 Received: from mtksitap99.mediatek.inc (10.233.130.16) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Tue, 14 Jul 2026 20:33:16 +0800 From: Chris Lu To: Marcel Holtmann , Johan Hedberg , Luiz Von Dentz CC: Sean Wang , Will Lee , SS Wu , Steve Lee , Paul Menzel , linux-bluetooth , linux-kernel , linux-mediatek , Chris Lu Subject: [PATCH v10 6/7] Bluetooth: btmtk: Improve BT firmware logging Date: Tue, 14 Jul 2026 20:33:12 +0800 Message-ID: <20260714123314.814333-7-chris.lu@mediatek.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260714123314.814333-1-chris.lu@mediatek.com> References: <20260714123314.814333-1-chris.lu@mediatek.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 3fe6b4fdc438..75519765bb49 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -148,6 +148,8 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, size_t expected_size; 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); @@ -188,8 +190,8 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, goto err_release_fw; } - 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