Bluetooth: Fix SMP channel registration for unconfigured controllers
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/1 Bluetooth: Fix SMP channel registration for unconfigured controllers
When the Bluetooth controllers requires an unconfigured state (for example when the BD_ADDR is missing), then it is important to try to register the SMP channels when the controller transitions to the configured state.
This also fixes an issue with the debugfs entires that are not present for controllers that start out as unconfigured.
--- net/bluetooth/hci_core.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
net/bluetooth/hci_core.c +13 -3
@@ -931,10 +931,20 @@ static int __hci_init(struct hci_dev *hdev)if (err <0 )return err; -/* Only create debugfs entries during the initial setup -* phase and not every time the controller gets powered on. +/* This function is only called when the controller is actually in +* configured state. When the controller is marked as unconfigured, +* this initialization procedure is not run. +* +* It means that it is possible that a controller runs through its +* setup phase and then discovers missing settings. If that is the +* case, then this function will not be called. It then will only +* be called during the config phase. +* +* So only when in setup phase or config phase, create the debugfs +* entries and register the SMP channels. */ -if (!test_bit (HCI_SETUP , &hdev->dev_flags)) +if (!test_bit (HCI_SETUP , &hdev->dev_flags) && + !test_bit (HCI_CONFIG , &hdev->dev_flags))return 0 ;hci_debugfs_create_common (hdev);
Signature · 1 line
2.1.0
Johan Hedberg
AppliedHi Marcel,
Quoted 5 lines · Marcel Holtmann
When the Bluetooth controllers requires an unconfigured state (for example when the
BD_ADDRis missing), then it is important to try to register the SMP channels when the controller transitions to the configured state.
Quoted 7 lines
This also fixes an issue with the debugfs entires that are not present for controllers that start out as unconfigured.
Signed-off-by Marcel Holtmann <[email protected]>--- net/bluetooth/hci_core.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
Applied to bluetooth-next. Thanks.
Johan