All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_conn: Fix updating ISO QoS PHY
@ 2022-07-28 21:05 Luiz Augusto von Dentz
  2022-07-28 22:03 ` bluez.test.bot
  2022-07-29  0:10 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-07-28 21:05 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

BT_ISO_QOS has different semantics when it comes to QoS PHY as it uses
0x00 to disable a direction but that value is invalid over HCI and
sockets using DEFER_SETUP to connect may attempt to use hci_bind_cis
multiple times in order to detect if the parameters have changed, so to
fix the code will now just mirror the PHY for the parameters of
HCI_OP_LE_SET_CIG_PARAMS and will not update the PHY of the socket
leaving it disabled.

Fixes: 26afbd826ee32 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_conn.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f54864e19866..9777e7b109ee 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1551,8 +1551,8 @@ static void cis_add(struct iso_list_data *d, struct bt_iso_qos *qos)
 	cis->cis_id = qos->cis;
 	cis->c_sdu  = cpu_to_le16(qos->out.sdu);
 	cis->p_sdu  = cpu_to_le16(qos->in.sdu);
-	cis->c_phy  = qos->out.phy;
-	cis->p_phy  = qos->in.phy;
+	cis->c_phy  = qos->out.phy ? qos->out.phy : qos->in.phy;
+	cis->p_phy  = qos->in.phy ? qos->in.phy : qos->out.phy;
 	cis->c_rtn  = qos->out.rtn;
 	cis->p_rtn  = qos->in.rtn;
 
@@ -1735,13 +1735,6 @@ struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
 	if (!qos->in.latency)
 		qos->in.latency = qos->out.latency;
 
-	/* Mirror PHYs that are disabled as SDU will be set to 0 */
-	if (!qos->in.phy)
-		qos->in.phy = qos->out.phy;
-
-	if (!qos->out.phy)
-		qos->out.phy = qos->in.phy;
-
 	if (!hci_le_set_cig_params(cis, qos)) {
 		hci_conn_drop(cis);
 		return ERR_PTR(-EINVAL);
-- 
2.37.1


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

* RE: Bluetooth: hci_conn: Fix updating ISO QoS PHY
  2022-07-28 21:05 [PATCH] Bluetooth: hci_conn: Fix updating ISO QoS PHY Luiz Augusto von Dentz
@ 2022-07-28 22:03 ` bluez.test.bot
  2022-07-29  0:10 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-07-28 22:03 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1096 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=663884

---Test result---

Test Summary:
CheckPatch                    PASS      2.55 seconds
GitLint                       PASS      0.88 seconds
SubjectPrefix                 PASS      0.59 seconds
BuildKernel                   PASS      33.41 seconds
BuildKernel32                 PASS      28.76 seconds
Incremental Build with patchesPASS      40.18 seconds
TestRunner: Setup             PASS      478.62 seconds
TestRunner: l2cap-tester      PASS      16.65 seconds
TestRunner: bnep-tester       PASS      6.22 seconds
TestRunner: mgmt-tester       PASS      98.96 seconds
TestRunner: rfcomm-tester     PASS      9.47 seconds
TestRunner: sco-tester        PASS      9.24 seconds
TestRunner: smp-tester        PASS      9.25 seconds
TestRunner: userchan-tester   PASS      6.39 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH] Bluetooth: hci_conn: Fix updating ISO QoS PHY
  2022-07-28 21:05 [PATCH] Bluetooth: hci_conn: Fix updating ISO QoS PHY Luiz Augusto von Dentz
  2022-07-28 22:03 ` bluez.test.bot
@ 2022-07-29  0:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2022-07-29  0:10 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 28 Jul 2022 14:05:56 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> BT_ISO_QOS has different semantics when it comes to QoS PHY as it uses
> 0x00 to disable a direction but that value is invalid over HCI and
> sockets using DEFER_SETUP to connect may attempt to use hci_bind_cis
> multiple times in order to detect if the parameters have changed, so to
> fix the code will now just mirror the PHY for the parameters of
> HCI_OP_LE_SET_CIG_PARAMS and will not update the PHY of the socket
> leaving it disabled.
> 
> [...]

Here is the summary with links:
  - Bluetooth: hci_conn: Fix updating ISO QoS PHY
    https://git.kernel.org/bluetooth/bluetooth-next/c/8ce91829ab3a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-07-29  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 21:05 [PATCH] Bluetooth: hci_conn: Fix updating ISO QoS PHY Luiz Augusto von Dentz
2022-07-28 22:03 ` bluez.test.bot
2022-07-29  0:10 ` [PATCH] " patchwork-bot+bluetooth

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.