On Mon, 24 Jun 2024 23:19:55 +0200, Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> said: > On Mon, 24 Jun 2024 at 23:47, Bartosz Golaszewski <brgl@xxxxxxxx> wrote: >> >> On Mon, Jun 24, 2024 at 10:17 PM Dmitry Baryshkov >> <dmitry.baryshkov@xxxxxxxxxx> wrote: >> > >> > On Mon, 24 Jun 2024 at 22:45, Bartosz Golaszewski <brgl@xxxxxxxx> wrote: >> > > >> > > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx> >> > > >> > > We unnecessarily fallthrough the case for QCA6390 when initializing the >> > > device and hit the condition where - due to the lack of the enable-gpio >> > > - we disable power management despite using the power sequencer. We don't >> > > need to look for clocks on this model so it makes more sense to just >> > > register the hci device and break the switch. >> > > >> > > Reported-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> >> > > Fixes: 4029dba6b6f1 ("Bluetooth: qca: use the power sequencer for QCA6390") >> > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx> >> > >> > Is this going to break the QCA6390 as present on M.2 / PCIe cards? Or >> > the older DT which didn't have pwrseq entries? >> > >> >> Neither of these has clocks that need to be driven by linux. The only >> user of QCA6390 Bluetooth in mainline is RB5. Bindings didn't exist >> before so no commitment was ever made. > > This might make some laptop users unhappy. But anyway, restarting the > hci0 now gives: > > [ 24.387344] Bluetooth: hci0: setting up ROME/QCA6390 > [ 24.387439] qcom_geni_serial 998000.serial: serial engine reports 0 > RX bytes in! > [ 24.554349] qcom_geni_serial 998000.serial: serial engine reports 0 > RX bytes in! > [ 24.562056] arm-smmu 15000000.iommu: Unhandled context fault: > fsr=0x402, iova=0xfffd1080, fsynr=0x750013, cbfrsynra=0x5a3, cb=3 > [ 26.914225] Bluetooth: hci0: command 0xfc00 tx timeout > [ 35.042619] Bluetooth: hci0: Reading QCA version information failed (-110) > [ 35.049721] Bluetooth: hci0: Retry BT power ON:0 > [ 37.539492] Bluetooth: hci0: command 0xfc00 tx timeout > [ 45.539519] Bluetooth: hci0: Reading QCA version information failed (-110) > [ 45.546667] Bluetooth: hci0: Retry BT power ON:1 > [ 48.035863] Bluetooth: hci0: command 0xfc00 tx timeout > [ 56.034783] Bluetooth: hci0: Reading QCA version information failed (-110) > [ 56.041901] Bluetooth: hci0: Retry BT power ON:2 > [ 58.532174] Bluetooth: hci0: command 0xfc00 tx timeout > [ 66.531928] Bluetooth: hci0: Reading QCA version information failed (-110) > > How do you reproduce it because it works fine for me: root@qcom-armv8a:~# btmgmt --index 0 public-addr 00:11:22:33:44:55 [ 429.096397] Bluetooth: MGMT ver 1.23 hci0 Set Public Address complete, options: [ 429.102024] Bluetooth: hci0: setting up ROME/QCA6390 root@qcom-armv8a:~# [ 429.184052] Bluetooth: Received HCI_IBS_WAKE_ACK in tx state 0 [ 429.497264] Bluetooth: hci0: QCA Product ID :0x00000010 [ 429.502854] Bluetooth: hci0: QCA SOC Version :0x400a0200 [ 429.508412] Bluetooth: hci0: QCA ROM Version :0x00000200 [ 429.513974] Bluetooth: hci0: QCA Patch Version:0x00000d2b [ 429.519533] Bluetooth: hci0: QCA controller version 0x02000200 [ 429.525534] Bluetooth: hci0: QCA Downloading qca/htbtfw20.tlv [ 430.449793] Bluetooth: hci0: QCA Downloading qca/htnv20.bin root@qcom-armv8a:~# [ 430.689052] Bluetooth: hci0: QCA setup on UART is completed [ 430.752854] NET: Registered PF_ALG protocol family root@qcom-armv8a:~# root@qcom-armv8a:~# hciconfig hci0 up [ 437.505116] Bluetooth: hci0: setting up ROME/QCA6390 [ 437.586969] Bluetooth: Received HCI_IBS_WAKE_ACK in tx state 0 [ 437.912683] Bluetooth: hci0: QCA Product ID :0x00000010 [ 437.918286] Bluetooth: hci0: QCA SOC Version :0x400a0200 [ 437.923890] Bluetooth: hci0: QCA ROM Version :0x00000200 [ 437.929613] Bluetooth: hci0: QCA Patch Version:0x00000d2b [ 437.935184] Bluetooth: hci0: QCA controller version 0x02000200 [ 437.941207] Bluetooth: hci0: QCA Downloading qca/htbtfw20.tlv [ 438.918868] Bluetooth: hci0: QCA Downloading qca/htnv20.bin [ 439.158671] Bluetooth: hci0: QCA setup on UART is completed root@qcom-armv8a:~# root@qcom-armv8a:~# root@qcom-armv8a:~# hciconfig hci0 down root@qcom-armv8a:~# root@qcom-armv8a:~# cat /sys/kernel/debug/pwrseq pwrseq.0: targets: target: [bluetooth] (target unit: [bluetooth-enable]) target: [wlan] (target unit: [wlan-enable]) units: unit: [regulators-enable] - enable count: 1 unit: [clock-enable] - enable count: 1 unit: [bluetooth-enable] - enable count: 0 dependencies: [regulators-enable] [clock-enable] unit: [wlan-enable] - enable count: 1 dependencies: [regulators-enable] [clock-enable] root@qcom-armv8a:~# root@qcom-armv8a:~# hciconfig hci0 up [ 454.407376] Bluetooth: hci0: setting up ROME/QCA6390 [ 454.485238] Bluetooth: Received HCI_IBS_WAKE_ACK in tx state 0 [ 454.813289] Bluetooth: hci0: QCA Product ID :0x00000010 [ 454.818892] Bluetooth: hci0: QCA SOC Version :0x400a0200 [ 454.824461] Bluetooth: hci0: QCA ROM Version :0x00000200 [ 454.830035] Bluetooth: hci0: QCA Patch Version:0x00000d2b [ 454.835599] Bluetooth: hci0: QCA controller version 0x02000200 [ 454.841651] Bluetooth: hci0: QCA Downloading qca/htbtfw20.tlv [ 455.773967] Bluetooth: hci0: QCA Downloading qca/htnv20.bin [ 456.011213] Bluetooth: hci0: QCA setup on UART is completed Bart