Skip to content

Commit

Permalink
Bluetooth: hci_qca: fix debugfs registration
Browse files Browse the repository at this point in the history
commit 47c5d82 upstream.

Since commit 3e4be65 ("Bluetooth: hci_qca: Add poweroff support
during hci down for wcn3990"), the setup callback which registers the
debugfs interface can be called multiple times.

This specifically leads to the following error when powering on the
controller:

	debugfs: Directory 'ibs' with parent 'hci0' already present!

Add a driver flag to avoid trying to register the debugfs interface more
than once.

Fixes: 3e4be65 ("Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990")
Cc: stable@vger.kernel.org	# 4.20
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jhovold authored and gregkh committed Jun 14, 2023
1 parent 4a01cda commit 7b544ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/bluetooth/hci_qca.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ enum qca_flags {
QCA_HW_ERROR_EVENT,
QCA_SSR_TRIGGERED,
QCA_BT_OFF,
QCA_ROM_FW
QCA_ROM_FW,
QCA_DEBUGFS_CREATED,
};

enum qca_capabilities {
Expand Down Expand Up @@ -635,6 +636,9 @@ static void qca_debugfs_init(struct hci_dev *hdev)
if (!hdev->debugfs)
return;

if (test_and_set_bit(QCA_DEBUGFS_CREATED, &qca->flags))
return;

ibs_dir = debugfs_create_dir("ibs", hdev->debugfs);

/* read only */
Expand Down

0 comments on commit 7b544ae

Please sign in to comment.