Linux-Next discussions
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>
Cc: Hans de Goede <johannes.goede@oss.qualcomm.com>,
	Ibrahim Abdelkader <iabdelka@qti.qualcomm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	Pauli Virtanen <pav@iki.fi>, Radek Podgorny <radek@podgorny.cz>
Subject: linux-next: manual merge of the bluetooth tree with the master tree
Date: Tue, 25 Aug 2026 14:09:03 +0100	[thread overview]
Message-ID: <ao2T73snYdj5OUsq@sirena.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 3374 bytes --]

Hi all,

Today's linux-next merge of the bluetooth tree got a conflict in:

  net/bluetooth/hci_sync.c

between commit:

  cb19774faa57c ("Bluetooth: hci_sync: Clear HCI_CMD_PENDING when dropping the last request")

from the master tree and commits:

  ed516e3f1aa61 ("Bluetooth: hci_sync: Clear HCI_CMD_PENDING when dropping the last request")
  2fe8aa99af557 ("Bluetooth: hci_sync: Factor common cleanup code into a helper")

from the bluetooth tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined net/bluetooth/hci_sync.c
index ffd7b37e74018,24eeb76f72074..0000000000000
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@@ -5358,6 -5358,30 +5358,30 @@@ static int hci_dev_init_sync(struct hci
  	return ret;
  }
  
+ static void hci_dev_drop_last_cmd_req_and_close(struct hci_dev *hdev)
+ {
+ 	/* Drop last sent command */
+ 	if (hdev->sent_cmd) {
+ 		cancel_delayed_work_sync(&hdev->cmd_timer);
+ 		kfree_skb(hdev->sent_cmd);
+ 		hdev->sent_cmd = NULL;
+ 	}
+ 
+ 	/* Drop last request */
+ 	if (hdev->req_skb) {
+ 		kfree_skb(hdev->req_skb);
+ 		hdev->req_skb = NULL;
+ 		hci_dev_clear_flag(hdev, HCI_CMD_PENDING);
+ 	}
+ 
+ 	clear_bit(HCI_RUNNING, &hdev->flags);
+ 	hci_sock_dev_event(hdev, HCI_DEV_CLOSE);
+ 
+ 	/* After this point our queues are empty and no tasks are scheduled. */
+ 	hdev->close(hdev);
+ 	hdev->flags &= BIT(HCI_RAW);
+ }
+ 
  int hci_dev_open_sync(struct hci_dev *hdev)
  {
  	int ret;
@@@ -5444,23 -5468,7 +5468,7 @@@
  		if (hdev->flush)
  			hdev->flush(hdev);
  
- 		if (hdev->sent_cmd) {
- 			cancel_delayed_work_sync(&hdev->cmd_timer);
- 			kfree_skb(hdev->sent_cmd);
- 			hdev->sent_cmd = NULL;
- 		}
- 
- 		if (hdev->req_skb) {
- 			kfree_skb(hdev->req_skb);
- 			hdev->req_skb = NULL;
- 			hci_dev_clear_flag(hdev, HCI_CMD_PENDING);
- 		}
- 
- 		clear_bit(HCI_RUNNING, &hdev->flags);
- 		hci_sock_dev_event(hdev, HCI_DEV_CLOSE);
- 
- 		hdev->close(hdev);
- 		hdev->flags &= BIT(HCI_RAW);
+ 		hci_dev_drop_last_cmd_req_and_close(hdev);
  	}
  
  done:
@@@ -5627,28 -5635,10 +5635,10 @@@ int hci_dev_close_sync(struct hci_dev *
  	skb_queue_purge(&hdev->cmd_q);
  	skb_queue_purge(&hdev->raw_q);
  
- 	/* Drop last sent command */
- 	if (hdev->sent_cmd) {
- 		cancel_delayed_work_sync(&hdev->cmd_timer);
- 		kfree_skb(hdev->sent_cmd);
- 		hdev->sent_cmd = NULL;
- 	}
- 
- 	/* Drop last request */
- 	if (hdev->req_skb) {
- 		kfree_skb(hdev->req_skb);
- 		hdev->req_skb = NULL;
- 		hci_dev_clear_flag(hdev, HCI_CMD_PENDING);
- 	}
- 
- 	clear_bit(HCI_RUNNING, &hdev->flags);
- 	hci_sock_dev_event(hdev, HCI_DEV_CLOSE);
- 
- 	/* After this point our queues are empty and no tasks are scheduled. */
- 	hdev->close(hdev);
+ 	/* Drop last sent command, last request and close */
+ 	hci_dev_drop_last_cmd_req_and_close(hdev);
  
  	/* Clear flags */
- 	hdev->flags &= BIT(HCI_RAW);
  	hci_dev_clear_volatile_flags(hdev);
  	hci_dev_clear_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE);
  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

                 reply	other threads:[~2026-08-25 13:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ao2T73snYdj5OUsq@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=iabdelka@qti.qualcomm.com \
    --cc=johan.hedberg@gmail.com \
    --cc=johannes.goede@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=pav@iki.fi \
    --cc=radek@podgorny.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox