Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2632578rdb; Fri, 8 Dec 2023 14:12:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKb1WwwdJc62th4MZO/fgKjqgY9BjhRsQwEZl9WSzEfezGlyJ2sU1R/AXQmx3tRuEfK9oM X-Received: by 2002:a92:cd8c:0:b0:35d:9890:92db with SMTP id r12-20020a92cd8c000000b0035d989092dbmr1024206ilb.10.1702073558179; Fri, 08 Dec 2023 14:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702073558; cv=none; d=google.com; s=arc-20160816; b=WRP5fNQ+tHpJhGMljx1RUy3dWQ1x7/oC/g9FEkk9+D7r+qXob4RsG+MqJ+8EQNmXD6 RwYoF/vnnWeG/H0idY+AZ+XkMzqcBYu/qC5P5lVL16kMxUoLtfGWgQEows5i/ULIBQQu 5gnQeh68LVZUx3CrsVKb/z4aE1DecdIDaAaWV0aKoBE7tnlphxzCHvoeiwEWtDOvKRWB nUocaMt1hXutvrtFi6WsUJwBeY8ggEfGe6yXnEEdykdMrnogrDm65rhhqRt4aUfiWHMi 67SCkr1e0C5sh0OyKubPsaTHtWuY29A/PAlJSuu870EL5ppipVHwI+MaPtpoMxnGB1WU bLrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=aKrCIqNtifZgEzmFWurZkUt24Tu0FBrpZVFeJEQSHNE=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=tdHS40lI3KZZH4UVr7QK9VN1nZIJmSkFkOtIhYTcBU06BbDKaSsULGdK3e3K0cuWIM uiwbb3XyPcHXvs8vzb9vON+IqsQXGPgOn26dFB7cknUmv3xTdWOUGzE8JT7gqRgyrV1P 1xzSnfQcSov+64SfWAjvLa34JPI2jx02sF1XgPOCr5OKEl2mCXQY44uzBkAMeCXZllk/ gLVLYXNhM0cWwD4QyNUZziGNc8SutVAJLaV7mnGp+DfOkhmkJLxgZRIx8xBf/ZBvMrcM NQc7PS0RUbUXEBFBEg4KtZZ22F7XkLy8tcYutCm2Z5IJLDACCzrgXY/rTjJdleVOhz22 Rcpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WA4Esl6j; spf=pass (google.com: domain of linux-bluetooth+bounces-488-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-488-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b2-20020a63eb42000000b005b99697d854si2065279pgk.673.2023.12.08.14.12.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 14:12:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-488-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WA4Esl6j; spf=pass (google.com: domain of linux-bluetooth+bounces-488-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-488-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6EE6DB20BE1 for ; Fri, 8 Dec 2023 22:12:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6599759B51; Fri, 8 Dec 2023 22:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WA4Esl6j" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7309D1723 for ; Fri, 8 Dec 2023 14:12:23 -0800 (PST) Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-589d4033e84so1316251eaf.1 for ; Fri, 08 Dec 2023 14:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702073541; x=1702678341; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aKrCIqNtifZgEzmFWurZkUt24Tu0FBrpZVFeJEQSHNE=; b=WA4Esl6j/cm4lAG4Z9mNij5kbbijdvXlzUzlqHIL/I+3U9xy3nm4gHfuwClP4PWbds dCCSLgBdUn9mT3vhkhNcKWqFp/sm+zeNG70mNnOlMtib+A3utsWEbYSDDfKjrIyuJSBo Dby7b6epqLiD2NXECJmgyZBA159NQ6nuKElKav0DOr7cIlBIuo3GnkEmDZeoexgnFotf NJwhDjuPrts9MBOzMm4tcYjMKR4gHJCHKZNTVu8IlafIBZXNKR7gt/3SdIfdUMthRrDF MuR0hdYUkxBCLpJBQV+tG3LfFsoNgf6257oMUhlKcIU2Elqx3rst7ZE450sHySCuV3eZ 25gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702073541; x=1702678341; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aKrCIqNtifZgEzmFWurZkUt24Tu0FBrpZVFeJEQSHNE=; b=OIJIl+IFpg2uL5m8J6B+1mQ1Fr18WslusjTXiPw37uHtgmwk5/Zx7uRGqVljMxYC07 QrpmfRPSJ7IXW8RPnK3Ymm4hcou5ygIFp3XE5etza9kPCQUv7NmlP9/KNiVh+RIPZYJL BC7bX6Cm5zpELfE3JT5FAsrc94AUxosPy4U0Avl5yHapibboLKjr8OhJWIlvymCwy2UU vMQ7Kn4gjWi2GLfncyZcTwF0FVW/dazDgwmrLH/Z94jxaUxGutQngUfapqRg3xvf2RUE TQDk2LTTvPQp+bpSUQwXRC3NEcMB+POb2LL3vKi+SgEbl4gtMTYdTtDWwYwE4FqU9O8Z hnsg== X-Gm-Message-State: AOJu0YyIvlbIuml0jhSNqySIWQamiwtLKgvmiFaIXvC42cBOYbHoEC8Y 5NxNljSHyEQviGdiC5c3LmBJGaWBTvE= X-Received: by 2002:a05:6820:820:b0:58d:7171:c27 with SMTP id bg32-20020a056820082000b0058d71710c27mr989740oob.8.1702073541537; Fri, 08 Dec 2023 14:12:21 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id a44-20020a4a98af000000b0058df21de4fasm378195ooj.10.2023.12.08.14.12.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 14:12:20 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1] bap: Don't attempt to release if old state was releasing Date: Fri, 8 Dec 2023 17:12:13 -0500 Message-ID: <20231208221219.54529-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz If the old state was releasing there is no reason to call bt_bap_stream_release yet again when IO could not be created as that will likely create a loop situation when the remote stack caches the codec configuration. --- profiles/audio/bap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index c279b5b0e133..c530799915f3 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1918,7 +1918,9 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, bap_create_io(data, ep, stream, true); if (!ep->io) { error("Unable to create io"); - bt_bap_stream_release(stream, NULL, NULL); + if (old_state != BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, NULL, + NULL); return; } -- 2.43.0