All of lore.kernel.org
 help / color / mirror / Atom feed
From: Iulia Tanasescu <iulia.tanasescu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com,
	silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com,
	andrei.istodorescu@nxp.com, luiz.dentz@gmail.com,
	Iulia Tanasescu <iulia.tanasescu@nxp.com>
Subject: [PATCH BlueZ 1/2] btio: Remove POLLOUT check from bt_io_bcast_accept
Date: Wed, 27 Mar 2024 18:10:18 +0200	[thread overview]
Message-ID: <20240327161019.3078-2-iulia.tanasescu@nxp.com> (raw)
In-Reply-To: <20240327161019.3078-1-iulia.tanasescu@nxp.com>

For the Broadcast Sink defer setup scenario, there is no need to check
for the POLLOUT event on the PA sync socket before calling "read" to
issue the Create BIG sync command. This check has been inherited from
unicast, but it is unnecessary for broadcast, since currently after
accept and read, the event to signal BIG sync established is G_IO_IN.
---
 btio/btio.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/btio/btio.c b/btio/btio.c
index d30cfcac7..2d277e409 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -5,7 +5,7 @@
  *
  *  Copyright (C) 2009-2010  Marcel Holtmann <marcel@holtmann.org>
  *  Copyright (C) 2009-2010  Nokia Corporation
- *  Copyright 2023 NXP
+ *  Copyright 2023-2024 NXP
  *
  *
  */
@@ -1800,7 +1800,6 @@ gboolean bt_io_bcast_accept(GIOChannel *io, BtIOConnect connect,
 {
 	int sock;
 	char c;
-	struct pollfd pfd;
 	va_list args;
 	struct sockaddr_iso *addr = NULL;
 	uint8_t bc_num_bis = 0;
@@ -1857,22 +1856,11 @@ gboolean bt_io_bcast_accept(GIOChannel *io, BtIOConnect connect,
 			return FALSE;
 	}
 
-	memset(&pfd, 0, sizeof(pfd));
-	pfd.fd = sock;
-	pfd.events = POLLOUT;
-
-	if (poll(&pfd, 1, 0) < 0) {
-		ERROR_FAILED(err, "poll", errno);
+	if (read(sock, &c, 1) < 0) {
+		ERROR_FAILED(err, "read", errno);
 		return FALSE;
 	}
 
-	if (!(pfd.revents & POLLOUT)) {
-		if (read(sock, &c, 1) < 0) {
-			ERROR_FAILED(err, "read", errno);
-			return FALSE;
-		}
-	}
-
 	server_add(io, connect, NULL, user_data, destroy);
 
 	return TRUE;
-- 
2.39.2


  reply	other threads:[~2024-03-27 16:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 16:10 [PATCH BlueZ 0/2] Remove POLLOUT check before bcast defer accept Iulia Tanasescu
2024-03-27 16:10 ` Iulia Tanasescu [this message]
2024-03-27 18:10   ` bluez.test.bot
2024-03-27 16:10 ` [PATCH BlueZ 2/2] iso-tester: Separate iso_defer_accept into dedicated functions Iulia Tanasescu
2024-03-27 16:50   ` Luiz Augusto von Dentz
2024-03-27 17:48     ` Pauli Virtanen
2024-03-28 13:07       ` Iulia Tanasescu
2024-03-28 14:40 ` [PATCH BlueZ 0/2] Remove POLLOUT check before bcast defer accept patchwork-bot+bluetooth

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=20240327161019.3078-2-iulia.tanasescu@nxp.com \
    --to=iulia.tanasescu@nxp.com \
    --cc=andrei.istodorescu@nxp.com \
    --cc=claudia.rosu@nxp.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=mihai-octavian.urzica@nxp.com \
    --cc=silviu.barbulescu@nxp.com \
    --cc=vlad.pruteanu@nxp.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.