Skip to contentSkip to conversation

shared/att: Don't keep retrying the same operation

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Oct 3, 2023 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 shared/att: Don't keep retrying the same operation

From: Luiz Augusto von Dentz <[email protected]>

If an operation has been retried already don't attempt to change the security again.

---
 src/shared/att.c | 8 ++++++++
 1 file changed, 8 insertions(+)
src/shared/att.c +8 -0
index 85feead77d0f..62c884b65721 100644
@@ -193,6 +193,7 @@ struct att_send_op {
 	uint8_t opcode;
 	void *pdu;
 	uint16_t len;
+	bool retry;
 	bt_att_response_func_t callback;
 	bt_att_destroy_func_t destroy;
 	void *user_data;
@@ -785,6 +786,12 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
 
 	*opcode = rsp->opcode;
 
+	/* If operation has already been marked as retry don't attempt to change
+	 * the security again.
+	 */
+	if (op->retry)
+		return false;
+
 	/* Attempt to change security */
 	if (!change_security(chan, rsp->ecode))
 		return false;
@@ -798,6 +805,7 @@ static bool handle_error_rsp(struct bt_att_chan *chan, uint8_t *pdu,
 	DBG(att, "(chan %p) Retrying operation %p", chan, op);
 
 	chan->pending_req = NULL;
+	op->retry = true;
 
 	/* Push operation back to channel queue */
 	return queue_push_head(chan->queue, op);
Signature · 1 line
2.41.0
#1 lore raw

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=789685

---Test result---

Test Summary:

CheckPatch                    PASS      0.39 seconds
GitLint                       PASS      0.26 seconds
BuildEll                      PASS      33.91 seconds
BluezMake                     PASS      993.14 seconds
MakeCheck                     PASS      13.66 seconds
MakeDistcheck                 PASS      191.90 seconds
CheckValgrind                 PASS      308.54 seconds
CheckSmatch                   PASS      414.86 seconds
bluezmakeextell               PASS      127.84 seconds
IncrementalBuild              PASS      811.02 seconds
ScanBuild                     PASS      1271.64 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 7 lines · On Tue, 3 Oct 2023 11:42:22 -0700 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

If an operation has been retried already don't attempt to change the security again.

---
 src/shared/att.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Here is the summary with links:
- [BlueZ] shared/att: Don't keep retrying the same operation

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7ff68ce57fb4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html