Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp732421imn; Thu, 28 Jul 2022 14:10:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqkgkWbYGU4KaJoNxYI31YI1jbPVLjoHvKiRTj8WYyVCfIt0bdrNVuAMXYP16a0uPLqk51 X-Received: by 2002:a17:907:60c7:b0:72b:5651:e1f8 with SMTP id hv7-20020a17090760c700b0072b5651e1f8mr520527ejc.375.1659042600526; Thu, 28 Jul 2022 14:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659042600; cv=none; d=google.com; s=arc-20160816; b=i6rv6d4dJtEEWMWbWuJa6W6v0arfslnTcmaTSAu3dyK7kgQ3xXJAoq5YlDYdXvG7aQ 0CeL364Hsq+NShpKZxhz9BWjteOrgdox9OyO+iCLgD6kRw8SOz8GT0tJiMS1FbBYzSA5 o7UEJd8zQfiLFNAVRmm208fxWcBKBcqkNY1bkIYwGsbsQti/6nBUv+6TFBjdHPBNqxGW Wetx4rcQV9HZBH+Ig1mM5SWBTqhongd1P/OTZZtz6l9uGOqigZWEx2lifEXUc0+yJQHQ INLO+YuEGVD89zkzZHJQu7bfqoRjlPCk6uPqqrB1P3diEhan1Glxs33eu9zU2jYXYnF7 LrOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=PPJVpWJ09MC5tGsRIBjIrwQ/efJoeRRc/GZpqbHs9tg=; b=nSZ59mngSqwhnT+K+v0R2m/jxF6AtSBa5XpuAdIQiqt8HFomRy2qcoteSlA1I8rxfU 0hcN3S8nq2BvP9JdkVKqRLcVyB4lBXy8tehuGFamN5jElz1y1r1qaWrJKwMnW8TuJwT7 aydmuzG+U0CU7p8lgQIrqr6Fk10DkaCcVZtzBLkqMoyfEFER4K5K9cA4BPqwKaAZyKOB kwsM7sp8vpE6p6P59qmoYLRtpgWbFFQOOkXe0KeTl3aF89lZ35y4oA1/I1risTiJGPo/ PGVz1/nBuq48ssRe44Y40TqMVPX1yau+Q26GB5rXD4mta2+6VWzqi1ZgNNErvN1ZMV0v 0BUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bDiqtp8T; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t28-20020a508d5c000000b0043bfc7006b0si1566801edt.234.2022.07.28.14.09.20; Thu, 28 Jul 2022 14:10:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bDiqtp8T; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbiG1VGC (ORCPT + 99 others); Thu, 28 Jul 2022 17:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiG1VGB (ORCPT ); Thu, 28 Jul 2022 17:06:01 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 333451C139 for ; Thu, 28 Jul 2022 14:06:00 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 6so2448601pgb.13 for ; Thu, 28 Jul 2022 14:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PPJVpWJ09MC5tGsRIBjIrwQ/efJoeRRc/GZpqbHs9tg=; b=bDiqtp8TQkaK5BkYVgH/tEpAoHtxjRH+4bYifXoO6bTRUCRicCoNp2CKRi5/dvDo3R RGiqSjZM+zsDy1MBCKEGAoYgFch5c74ddr+Nrl0KPBGmzXLvIOJ8pp6WTfsML/xhpr8Y +kH3Tn+L18eYtEGvXmr/12ldqCX7s3v1CWk2XL4BsRy2tV5acEom22IfzpLt1m4L22/U AHl/dYXsM0dvQas53ARoed+ZNc1P6HhAMIDvNYNPT3AyCFIluYeKTgQW3+PATCIevM1v T0hojqCRb7NBKY4wZbBW/qpESVpNlBSnv5sOZB389cfVW8EHCM78s96b/0bqbzMzr58n THWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PPJVpWJ09MC5tGsRIBjIrwQ/efJoeRRc/GZpqbHs9tg=; b=ORDtPXo4XLIG5/7k4exyWKnakyONhO7zmySBi+RyVH7keiCmS2Nch2j5kT1G81l9+h rArf97QOFQqzy0W5+NLfW1f5wc0nRVSioD4eguMTMbk/E86nkgsVV02ETCy873EJbuKy zQl3mtZ9Ok3DdimdAew7/O6KjHMUNnkDH7yJ2SycC9oXUQzYZvUpZa2R3XiFG5BjgEHD 1GRWESXCa1fe73V2d0S7wzJhnMWvMy230L8qtKfo5wt2kQ3tsOIiSm6XCOPZhJqxqQ+F +6VzoZu/AZkta9Ll0+kZsLiL/q1jtefApndrmxLETWM5rfjOxvd/+LMPmNHJDU8A1CKy ORcw== X-Gm-Message-State: AJIora/YDmDQzggXoTz6vzB0pnZr9GYdBH7YMEsEMXgzK2gt1sd643+t ZyfWi+pI/mTRN/FAwGutTUfx3kC31uALPw== X-Received: by 2002:a63:155f:0:b0:41b:6acb:68b6 with SMTP id 31-20020a63155f000000b0041b6acb68b6mr452920pgv.225.1659042359142; Thu, 28 Jul 2022 14:05:59 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id b12-20020a1709027e0c00b0016d3a354cffsm1764832plm.89.2022.07.28.14.05.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 14:05:58 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: hci_conn: Fix updating ISO QoS PHY Date: Thu, 28 Jul 2022 14:05:56 -0700 Message-Id: <20220728210556.1236145-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz 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 --- 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