Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1187699rdb; Mon, 4 Sep 2023 06:00:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+nPtms6/4guA4DFaJAWj5AprggJiST6mYX36tWSlDE5Q0al8FZDuaybLBihofjjdFDKJ4 X-Received: by 2002:a05:6a00:1a8e:b0:68b:a137:372c with SMTP id e14-20020a056a001a8e00b0068ba137372cmr12650402pfv.25.1693832448358; Mon, 04 Sep 2023 06:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693832448; cv=none; d=google.com; s=arc-20160816; b=iAil+FwRuNRGa+yO7BO6l1BNZmEx1qXJ3NNp2bW27dOzLFfb2gCFAoEyNN10bJFlTa l2p5kT7fKCvbEaA8siIMYclYnJt4v4T8Am6b79qo8TSBl+W2dXFPDS4xEpPU8xnIS8CW Q/WrlrhgSWXYBSmMOiF+G+ImGrXfiymL5yC2RyhGpK2+nIgoSwnoYimCANL0Nn/3kFbK 4KhqENqMdMw/xAxMJhMot3CIPZibe+VMgFucJh4wHSlxmq8nXXMbGoMZIgDRUh8meCtE HP1zs8zDQh8PRCbKUwRHAAPwAXb30H2O0srVKWczzz6vTzMrB0nea4GZd9ZovymKk/2G +vig== 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=Dpto1fvv5VOSVSH/8MEKtRPaOcMR89IKnZWEThTnaCo=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=MWFiaY81o1xvxGiQW1Ty7QFGfGvfTb/qVRiLFbOrvb/7eMFTH3xXOXTBl7IrCCHAe6 iLz/a2YBcdk5ZWhBZiX48zMvdxd4xV/G/vZACNXjFtwUJgibTqYgsGxpgYBQRqTcK1Ii qKnrVkrV5QJBaDhDQkIbFP9pP5VPBJlVDQFC4ddhbiQ8UA538SOAy9vYfXeW5Jnq7NHN ldQO/P3m92/iTrulce+JDEdIbVnj4NG+0czDppSXZyG06NV0XkFcBLA0Ko0XDeVxo8vo r+wlonOazdicR7P8t7ylCWeUMmVpDtPFD2z68coE/xlSmlXNFZvS9QcHtA2E+zmVGFCZ jzbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=saymlD5F; 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 d66-20020a633645000000b00565325c20ddsi7686692pga.77.2023.09.04.06.00.23; Mon, 04 Sep 2023 06:00:48 -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=saymlD5F; 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 S232753AbjHaWBo (ORCPT + 99 others); Thu, 31 Aug 2023 18:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjHaWBn (ORCPT ); Thu, 31 Aug 2023 18:01:43 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7174D11B for ; Thu, 31 Aug 2023 15:01:41 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-56b2e689828so1042708a12.1 for ; Thu, 31 Aug 2023 15:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693519300; x=1694124100; 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=Dpto1fvv5VOSVSH/8MEKtRPaOcMR89IKnZWEThTnaCo=; b=saymlD5FQA3AlmqcWIaGj+f3qZEibjnxHu2WqT8zivl5fRe7a+0hGBF7YgQLqgNsRU 9nGQhDankvQqBZFX7i0kjrJnlQ2lsYcYww/59sqNpRYexQS6XW3TcqL1E0FZOjfTM0t1 SgKE3A50AiVxU210EOtfYwPudzirK+i45R4OiT/FgtPLhIECQKvXDjx7JEOrOeSC37E8 K+6KcAFdhksQJ6BcfrvCpFhanF4PIRT1/nlBYm7Ju4Zdx9Yx3wieraZO1lvrgRmAtudp YG3Zjq7+PAYgHZ/WrLJuVoIIjeJprKT4gbG4ZjPEqGZFDTz0ai/WGJ91pY6VH20Y07Ye MMnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693519300; x=1694124100; 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=Dpto1fvv5VOSVSH/8MEKtRPaOcMR89IKnZWEThTnaCo=; b=hCwc3qt9yafqbHGRP/0Z4bcPaJFP1zld7WgSLGBDMdzQJzhGtLAO/ge2S8+zOus3+3 XB/6p+wvwd6VjfmjITj5weKV3sEPbxIv8cHMji/t3F8PbO+LOw45ArIkrg6olM/JIG8A WMBIZ6Q9k8rJgtRyOEJUwkwj9s26s5onMxZ+h4CS4+eFykgpaBJq9GM8GBk4YqAbpYOF 9XXvn56ttY2YEfeKjG/DLTxs6wgrqcYvXHQDO6qMzcqZ1GlzxlIN5rBWnx7NFJo5sPFc U9AwaPUAanRbyF8AN6cejoj2tydFHsuja7AngvA+jExcnPLtCAgW8T0JRmdlHE3V7bi2 c1mg== X-Gm-Message-State: AOJu0Yzvlg7N7lhVqk9OrEXMU+Dn4ZxZYnX2Y9MA2dptq+rrsRHdSiyo fS4/ctqCan+tO4tF4SyM0ZY+2qUIZRA= X-Received: by 2002:a17:90b:153:b0:269:1e3f:a54d with SMTP id em19-20020a17090b015300b002691e3fa54dmr619473pjb.10.1693519299993; Thu, 31 Aug 2023 15:01:39 -0700 (PDT) Received: from lvondent-mobl4.. (c-98-232-221-87.hsd1.or.comcast.net. [98.232.221.87]) by smtp.gmail.com with ESMTPSA id fw13-20020a17090b128d00b0026d4100e0e8sm1760685pjb.10.2023.08.31.15.01.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 15:01:39 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] bap: Fix not always calling bap_io_close on disconnect Date: Thu, 31 Aug 2023 15:01:37 -0700 Message-ID: <20230831220137.1164891-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 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_BLOCKED,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 bap_io_disconnected was getting registered for all links while connecting which prevented bap_io_close to be called when ISO socket is disconnected thus the cig_active flag will remain set preventing the IO to be recreated. --- profiles/audio/bap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 001a47bdc47b..9634ae4fc6c3 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1936,6 +1936,8 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd, if (!ep->io) { io = g_io_channel_unix_new(fd); + ep->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, + bap_io_disconnected, ep); ep->io = io; } else io = ep->io; -- 2.41.0