Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8052920rwr; Wed, 10 May 2023 17:14:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+jRV30xK0vVvFz9j6oyzZVUp9637SF5mj/ypbyFTUG7LhvgtXjpY3dp2yUu5xBzH/HSwi X-Received: by 2002:a05:6a00:10ce:b0:639:9089:798e with SMTP id d14-20020a056a0010ce00b006399089798emr25813836pfu.19.1683764061159; Wed, 10 May 2023 17:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683764061; cv=none; d=google.com; s=arc-20160816; b=aESVUkkmfht9eAKATscnmZL103O+179y282hWPQyLE572sv4miUfTlogL9/fsMaqFx RXCTA4Dt6MQ+pi/FTctfabXfiSCOC22gg5WM2AbkvyFSjWFnzb+11pPJiB/lanCMVaLQ Slqt5rsAMiEbyrKsTHCSQI2b8N/36pbIgS+Z1/3Gnd+J/yBITs2w9KHoD7z8VQzju0MR 4YD97QbeYGb7fpbSl+19baLMDdsm4mESym8foUof1weqyjlESFt4Q8FIZfOblQHCX6CR amNW/gCB0tAotKToQoB7bLXJyll0S9ny0mRhBMiIdLqhVRpJkDlw43vKKiSfDB6QpLnL P1Fw== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rf8eRSKfJPDMFusnZzOI0itkuuwBnCgk1u412CdsNUs=; b=x9Xkgfz39q7F2+Cr1dW+MgxfzZeSzLqGZN6CN7YFC6V1JvJRFbTy4e63qhL1hSyg74 GPRhtUNHjUE2+S9Rv5Q0gPdsGjkRiW9vV9Yqfz9uyMIOWSYoSXsbx5HvDhlf/V3LLCUT IbKGJAiKedWZSblajvCebkn743r7CPIrogSPznCqbdGQX4cytaRw7R5cAxzJc5de9q/Z CtbUPFZEO0M3aJW0l0827tHhCbjBnqm+e3W4+lIFyFi2Ym4bngnpMAYz+83Mc3dFTLOy nJWueOFj6QyBEo6ywRmDodgdQZMTIq/ZryrJVb9kM0gNknpk3jFZuR9L/x0/2DsDrSPH 4PKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=jK+juGZO; 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 h26-20020aa796da000000b0063b630df52asi6184093pfq.252.2023.05.10.17.13.59; Wed, 10 May 2023 17:14:21 -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=20221208 header.b=jK+juGZO; 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 S229447AbjEKACD (ORCPT + 99 others); Wed, 10 May 2023 20:02:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236189AbjEKACC (ORCPT ); Wed, 10 May 2023 20:02:02 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E44A10DA for ; Wed, 10 May 2023 17:02:01 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-64395e2a715so7891742b3a.3 for ; Wed, 10 May 2023 17:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683763320; x=1686355320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rf8eRSKfJPDMFusnZzOI0itkuuwBnCgk1u412CdsNUs=; b=jK+juGZOt4vgvnxNo5tcj/LdUEB+c2rlpnJHmz1GYSkiDr0DIbw05+MB/IiJR7/inR iUekynMomtYvXcSGIklN4fA0YvIxurE5z6L+bKg/htRw/KhSZYehBTVs+4l162AAVlYR /TGPSTEWPIU0qGhFFHAQlsWJhVWA5f2Afi4uV5vTbQzeDicxv78BgdDmxKyrmpq25nyp EHOyi2gDF2kx8oTzjffT5AvQ6Guh0HqGEBRDO1kj8JXnnGPC/xtyqEEgzxNO2J3fOc4+ twcdZEooVu8tkst6qGiF7uXEfU8kNvvmCKpihDlXwc/9TCW9yHKUcVo4C5w7g75+bTWk mksA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683763320; x=1686355320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rf8eRSKfJPDMFusnZzOI0itkuuwBnCgk1u412CdsNUs=; b=fZdl5l/gbYZhtvqXXW7u9+mqCPKXg5K1caQAkjx6GoiRmgJ9YOJgQlThhEweURR5xq b7T/EA3bZ/RrQ8mQdiUKX630DMDprxtD5uLdctUZ9PIiqzIuAvX55D6IlpfAdrVnJqdM PBCxFSRA8rkiPTzxDFyuC15tdfma7vWDRcMIlTHfVVG3WgMtAihVo1cjj4ns77jqonSP Euj9fn+zCiWZsDClJolZRCugamL6L47rzDvhe/NUEb8u25VRVN2MRDSaTmgnyXtVo4PZ 0tpbF++rplg00cVEpd9HzfIsXfoimqWZLnwh067Gr93ZaY+sLm2+CT9m1FNsfMfe0SGY n36Q== X-Gm-Message-State: AC+VfDy6I6XL5uiBeNmWb78s01zmY3m+D2DGqYL/w+t52Tv35UTHfWtV KoUzbIE7EyrL17wtCAx2Qd3kGVtuwi0= X-Received: by 2002:a05:6a21:9996:b0:f5:6530:c7a8 with SMTP id ve22-20020a056a21999600b000f56530c7a8mr24698821pzb.22.1683763320207; Wed, 10 May 2023 17:02:00 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id g15-20020a63f40f000000b0053031f7a367sm3761604pgi.85.2023.05.10.17.01.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 17:01:58 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/2] shared/bap: Fix not sending ASE Receiver Stop Ready Date: Wed, 10 May 2023 17:01:55 -0700 Message-Id: <20230511000155.3721222-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230511000155.3721222-1-luiz.dentz@gmail.com> References: <20230511000155.3721222-1-luiz.dentz@gmail.com> 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,T_SCC_BODY_TEXT_LINE 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 This fixes not sending ASE Receiver Stop Ready if stream is on disabling state when CIS is disconnected. Fixes: https://github.com/bluez/bluez/issues/516 --- src/shared/bap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index 6131c312865a..f194f466fde1 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1115,6 +1115,18 @@ static bool match_stream_io(const void *data, const void *user_data) return stream->io == io; } +static void stream_stop_disabling(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + + if (stream->io || stream->ep->state != BT_ASCS_ASE_STATE_DISABLING) + return; + + DBG(stream->bap, "stream %p", stream); + + bt_bap_stream_stop(stream, NULL, NULL); +} + static bool bap_stream_io_detach(struct bt_bap_stream *stream) { struct bt_bap_stream *link; @@ -1133,6 +1145,9 @@ static bool bap_stream_io_detach(struct bt_bap_stream *stream) /* Detach link if in QoS state */ if (link->ep->state == BT_ASCS_ASE_STATE_QOS) bap_stream_io_detach(link); + } else { + /* Links without IO on disabling state shall be stopped. */ + queue_foreach(stream->links, stream_stop_disabling, NULL); } stream_io_unref(io); -- 2.40.0