public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] device: Remove device after all bearers are disconnected
@ 2024-09-25  7:32 Cheng Jiang
  2024-09-25  9:01 ` [v1] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng Jiang @ 2024-09-25  7:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: quic_jiaymao

For a combo mode remote, both BR/EDR and BLE may be connected.
RemoveDevice should be handled after all bearers are droped,
otherwise, remove device is not performed in adapter_remove_connection.
---
 src/device.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index f8f61e643..b440b6b51 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3492,8 +3492,16 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type,
 		DBusMessage *msg = device->disconnects->data;
 
 		if (dbus_message_is_method_call(msg, ADAPTER_INTERFACE,
-								"RemoveDevice"))
+								"RemoveDevice")) {
+
+			/* Don't handle the RemoveDevice msg if device is connected.
+			* For a dual mode remote, both BR/EDR and BLE may be connected,
+			* RemoveDevice should be handled after all bearers are
+			* disconnects. */
+			if (device->bredr_state.connected || device->le_state.connected)
+				break;
 			remove_device = true;
+		}
 
 		g_dbus_send_reply(dbus_conn, msg, DBUS_TYPE_INVALID);
 		device->disconnects = g_slist_remove(device->disconnects, msg);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [v1] device: Remove device after all bearers are disconnected
  2024-09-25  7:32 [PATCH v1] device: Remove device after all bearers are disconnected Cheng Jiang
@ 2024-09-25  9:01 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2024-09-25  9:01 UTC (permalink / raw)
  To: linux-bluetooth, quic_chejiang

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

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=892676

---Test result---

Test Summary:
CheckPatch                    FAIL      0.71 seconds
GitLint                       PASS      0.32 seconds
BuildEll                      PASS      24.18 seconds
BluezMake                     PASS      1590.90 seconds
MakeCheck                     PASS      12.94 seconds
MakeDistcheck                 PASS      176.77 seconds
CheckValgrind                 PASS      249.60 seconds
CheckSmatch                   PASS      349.54 seconds
bluezmakeextell               PASS      117.92 seconds
IncrementalBuild              PASS      1470.89 seconds
ScanBuild                     PASS      1042.01 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v1] device: Remove device after all bearers are disconnected
WARNING:TYPO_SPELLING: 'droped' may be misspelled - perhaps 'dropped'?
#94: 
RemoveDevice should be handled after all bearers are droped,
                                                     ^^^^^^

WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#109: FILE: src/device.c:3495:
+								"RemoveDevice")) {

WARNING:LONG_LINE_COMMENT: line length of 84 exceeds 80 columns
#111: FILE: src/device.c:3497:
+			/* Don't handle the RemoveDevice msg if device is connected.

WARNING:LONG_LINE_COMMENT: line length of 87 exceeds 80 columns
#112: FILE: src/device.c:3498:
+			* For a dual mode remote, both BR/EDR and BLE may be connected,

WARNING:BLOCK_COMMENT_STYLE: Block comments should align the * on each line
#112: FILE: src/device.c:3498:
+			/* Don't handle the RemoveDevice msg if device is connected.
+			* For a dual mode remote, both BR/EDR and BLE may be connected,

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#114: FILE: src/device.c:3500:
+			* disconnects. */

WARNING:LONG_LINE: line length of 88 exceeds 80 columns
#115: FILE: src/device.c:3501:
+			if (device->bredr_state.connected || device->le_state.connected)

/github/workspace/src/src/13811736.patch total: 0 errors, 7 warnings, 17 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13811736.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-25  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25  7:32 [PATCH v1] device: Remove device after all bearers are disconnected Cheng Jiang
2024-09-25  9:01 ` [v1] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox