From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.16 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796008086; b=Co+dNcaPwhUF0Y/6bwJ0xNakdBGPYcmNPoqz1WGpOkD5U+vc8YsnLoZJ6e1AgVs8C+Fq k/Szn6j6X0i4lGgvInoyPslEUTH5PqpDwVzuYJ8Zv2sm5K+47FYSbVOGgDEs9du7Cxi5/ O53Ar/mJWVgnPi2RB3N7PFzecLo3qrsJ8egeSF1n+rO3kK6wb5bMkzj5HpxvveTPrILTM y551SOBozf6G6qYUWSRSiUHO9yk/Ym3uA+GAKvQ5K3ZgWsMygt0igACXn+Yje9phBqycu UIVjwNtIq2qgzh0twbBSB5VIwwR8t+pEu5L5eyKHy4ndBDtBYqwIDi2w44W/jSsl1HA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796008086; h=DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding: X-ZohoMailClient; bh=NsHNQvsgw99Gx5N6ApzrdAhjVIGB1fRn52v+Mj6ADJI=; b=gjFgLXeODzlEnAb4eiwOGaS5y4rX2K9hx/dvU8ARw+IiTzfJoOSKjX6iUtXpwJgxDnAh 6ZUvjHSovNgSuknoWH1dGFgdueV8hUpZrPeDnvx2ycIzVM8hYQYAzgbEAgRMsdpTJM3WA av2j3mHc/NMbLwnDtPZZ9wTtXaBOFEC372U8GaVl37InTgcTJjMzvcm6Y+8MMX5BiGbgj RqzLgTtM39585R5waGT3PEMhPHc1gI5gaL2qaIIT5K6Ko4FVmBEX/PwSykk2IRbBIoOKw P4ux5VZTD+ngJ0022HrV7lxVMY3idjPZ3NoN/6qwJdvSxM3kQl3dWp2Tk82heJ3n6sQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=permerror header.from=djacu.dev; spf=none smtp.mailfrom=djacu.dev; dkim=temperror header.d=djacu.dev header.i=@djacu.dev header.a=rsa-sha256 header.s=zmail header.b=PufLtetq; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.16 Received: from sender5-op-o16.zoho.com (sender5-op-o16.zoho.com [165.173.182.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16E1B606A69B; Mon, 30 Nov 2026 03:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=djacu.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=djacu.dev Authentication-Results: smtp.subspace.kernel.org; dkim=temperror header.d=djacu.dev header.i=@djacu.dev header.a=rsa-sha256 header.s=zmail header.b=PufLtetq ARC-Seal: i=1; a=rsa-sha256; t=1796008061; cv=none; d=zohomail.com; s=zohoarc; b=M/5MIADvM4uxdJH3/ZMPbOaaneeBlttVAuoukLWIbgwNNlp43MzuDuxPaV1ne+zTBA0NcbD3V4Jb8yyrqlQoY6XSAeMnalW3TmPyZdh8qkLnTr8OL32tF65s+7oprScU5LDNnIGAnJfyIFgmbadDaFCWr5zaxpPHvEEqjuldTXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796008061; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=NsHNQvsgw99Gx5N6ApzrdAhjVIGB1fRn52v+Mj6ADJI=; b=TkSLbhweZGZvhDe9KRCAkUiyNIuyet86//oj3TkjUegOuCQ6r7d/gAcSv717TU3rFgiisZhxk3N+AQhTYGtJwplSPSdfo8zCLJt1Bx/gdkACRlIdiLo09+8/xqSamAuY7s25+/oVqLUfGKyFLlTwwZLFtsjTfqv84STkIfWFfxc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=djacu.dev; spf=pass smtp.mailfrom=dan@djacu.dev; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=PufLtetqUjWS5BwHSHDzCp4+sWzTgAd+gPp4XQdLQlHmUuMOjfTceMdISYx3YGF1QGAgVAR6ljA/RGNO/vt8LrgSsJumg50LzAflZAkBK/83zmGluelHjZ8MltBmXw8AL4d2fo5cqGGBJd9EjypGRvK1MR18VcpHGwyQKC5Agsk=; c=relaxed/relaxed; s=zmail; d=djacu.dev; v=1; bh=NsHNQvsgw99Gx5N6ApzrdAhjVIGB1fRn52v+Mj6ADJI=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796008058516856.9263566627681; Sun, 29 Nov 2026 19:07:38 -0800 (PST) From: Daniel Baker To: an.wu@canonical.com Cc: chandrashekar.devegowda@intel.com, kiran.k@intel.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, luiz.dentz@gmail.com, marcel@holtmann.org, stable@vger.kernel.org, Daniel Baker Subject: Re: [PATCH v2] Bluetooth: btintel_pcie: guard debug dump before hdev setup Date: Sun, 29 Nov 2026 19:07:10 -0800 Message-ID: <20261130030710.1124364-1-dan@djacu.dev> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013125241.1230408-1-an.wu@canonical.com> References: <20261013125241.1230408-1-an.wu@canonical.com> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External On Tue, Oct 13, 2026 at 08:52:41PM +0800, ChunAn Wu wrote: > An MSI-X interrupt can reach the debug-dump helper before > btintel_pcie_setup_hdev() initializes data->hdev. The helper then > passes NULL to hci_get_drvdata() and crashes the interrupt thread. I hit this on 6.18.y and tested the patch there. The report and the test follow. Setup Framework Laptop 13 Pro (Intel Core Ultra Series 3), board FRANMJCP07 Bluetooth controller 8086:e476 at 0000:00:14.7 NixOS, kernels 6.18.49 and 6.18.64, tainted P and O by the out-of-tree ZFS module The machine unloads btintel_pcie before every suspend and loads it again after resume, to work around a suspend failure in the driver's sleep callbacks. That is why the module is loaded so often. Failure (2026-11-16, 6.18.49, BIOS 03.02, Bluetooth firmware 42-26.26) Between 2026-10-04 and 2026-11-28 the module was loaded this way 175 times, 94 times on 6.18.49 and 81 times on 6.18.64. One load failed. It came right after a resume from s2idle. About 0.5 s after modprobe started, the kernel logged: Bluetooth: null: Received gp1 mailbox interrupt BUG: kernel NULL pointer dereference, address: 0000000000000cb8 RIP: 0010:btintel_pcie_dump_debug_registers+0x1d/0x800 [btintel_pcie] Call Trace: btintel_pcie_irq_msix_handler+0x17d/0x4d0 [btintel_pcie] irq_thread_fn+0x25/0x70 irq_thread+0x181/0x2a0 note: irq/206-btintel[534802] exited with irqs disabled About 3 s after modprobe started, which matches the wait for the alive interrupt in btintel_pcie_enable_bt(): btintel_pcie 0000:00:14.7: probe with driver btintel_pcie failed with error -62 The module load then never returned. modprobe stayed in D state and SIGKILL did not end it: task:modprobe state:D __synchronize_irq+0x96/0xd0 free_irq+0x13c/0x310 release_nodes+0x38/0xb0 devres_release_all+0x94/0xd0 device_unbind_cleanup+0xe/0x80 really_probe+0x221/0x340 The next suspend attempt, 13 minutes later, and another one the next morning both failed with "Freezing user space processes failed after 20.001 seconds (1 tasks refusing to freeze, wq_busy=0)" (20.004 seconds the second time). The task listed was that modprobe. The machine needed a reboot. Test of v2 (2026-11-29, 6.18.64, BIOS 03.04, Bluetooth firmware 19-36.26) 1. I applied v2 to drivers/bluetooth/btintel_pcie.c from v6.18.64. It applies with an offset of -40 lines. 2. I cannot trigger the early interrupt, so I added a test-only call that runs the GP1 handler in btintel_pcie_probe() while data->hdev is still NULL: err = btintel_pcie_start_rx(data); if (err) goto exit_error; + btintel_pcie_msix_gp1_handler(data); + err = btintel_pcie_setup_hdev(data); In 6.18.y that handler logs the message above and then calls btintel_pcie_dump_debug_registers(data->hdev). 3. I built btintel_pcie.ko with both changes against the running 6.18.64 kernel, ran "rmmod btintel_pcie" and loaded the new module with insmod. I did this once. Result: the kernel logged Bluetooth: null: Received gp1 mailbox interrupt Bluetooth: hci0: Device revision is 0 followed by the usual firmware download messages. There was no oops, probe completed, and "bluetoothctl show" lists the controller as powered. Not tested: the patch on mainline; the test call without the patch, which I expect to oops and hang the module load as above; and a real early GP1 interrupt. Tested-by: Daniel Baker # 6.18.64 ChunAn, patchwork lists this patch as archived in state New, so it may need a resend: https://patchwork.kernel.org/project/bluetooth/patch/20261013125241.1230408-1-an.wu@canonical.com/ I used Claude Code (claude-fable-5-2) for the log analysis, the test change and the draft of this mail. Daniel