From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2C5A4DDB48 for ; Thu, 8 Oct 2026 15:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791472394; cv=none; b=Gvw+Ltyn01OTi9gYB5GD1zVpSJeKapDvklr5GJunCFJLx4gtt8MV/RceqfEvYFmaEDDwb/3HVHilC5m2gMEYk1AuRKze6r8eF/AE9jOE6MGZoj8de+R0mOprbknsuPGqmMv3aH5q264M2/YbSoDHysHwMqwm5GdCqj42pBSMLQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791472394; c=relaxed/simple; bh=XK1oYlYECHEwBL7QCAkCIQPSESe0kV06DpwVskF/JVU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oi1zHvMltnEhdpV0rS/qpYmVhPf1H9HgzFOrTI4l/RCxG/MkzvTQO0JyYHcl28O/iFZHV53cYbV39IgWej/70a6FRDTSpcv+OhUGnibU3yJopAIL7RxJAEeK+hICugVi8OibL4bLc44hJNQAyAjb6BqUzkuuYficEtdIhmNK7uc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c/2k9wMY; arc=none smtp.client-ip=74.125.82.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c/2k9wMY" Received: by mail-dl1-f46.google.com with SMTP id a92af1059eb24-150b2fbd784so56058c88.0 for ; Thu, 08 Oct 2026 08:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791472385; x=1792077185; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gjpjkwPYKzGVosbZ1v1zTZF30K7B38BpoSgAGU1cdHg=; b=c/2k9wMYqXb7ONnuLoUFlI6uujG1MMT4GdhftCLUhSWOUUDlERVzsplpeMgAzS6hac 9apiFRrbh04lzcS0XIQiy/2cBshURRTCH48EeK2Vpr/uuKXDeUCgweG7btZ18AEP9j8o HVHiCs2Fp63mOtS+EYUvFKXWULYnRep6FH+8RjpCWT6MBWCp7boNL34EhiHdtcZIi5vE vEELD+QtWJ6tjAwQ1nPYf6HVVfbmi0OWlc6FaIRMl9P8+ro6H7oZn5Jmi+1tNEqwD5Tw OvdWEjGA4q7elKKTiJa+2ja+6C1F10vMuQjt95rfOtoNjv0YBoktWLcHmHJ5vNnaOjzc xIkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791472385; x=1792077185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=gjpjkwPYKzGVosbZ1v1zTZF30K7B38BpoSgAGU1cdHg=; b=tmRq3MBn//jmtVFQpBzdy+Za/ypRL6hITxPkPcDeyr3OyF6Rvd8T8SBkrbw42BGPLE ib+0iVL3Nn+xNi25cg1RENEWp6nUfy6q2tuRgBaSBNpvYazyxNggi8exp/3acP+I3O2c DwI+wVfoJ0Pz7vjxBTTBmuMeVnd2dJGzgDxYwBx5cbUQnMagLLVbWIDnyS9pI1Z9x2y2 EhCIZdI3hGPSXxK8J997YBQFwuVxz17jWmXVFCjj5yAZoWbgPzDsIE7Q+EzpvdUwhNUw AGYXEZ6Ot4WQqz05pIG/FKznkYsTfmkrOP32QaE59anRvA12Sjfyq2Sj2p+tLVP7VanH IklQ== X-Forwarded-Encrypted: i=1; AKwUvBzHDHhd1O2t3P+f3q697omh46vgqHUQiG+j+omA8tOo0civ3vDs/TOoAGzsjmJA3mrlgzZKeAR4DaYfgXw=@vger.kernel.org X-Gm-Message-State: AFq9FYITQCtTjSDB7b0Zdp8F2XjGCjxBLfLQs9FKZFH409Tc3eo3+Gjz P8iN5GWnVeWQBaGrWEHdtlxyTcbDM72FoR7Snd37F+Qi4feIH5wKb5eK X-Gm-Gg: AYBFou3XpUeKrmlhLdew+PNQJd3IXU44Aw/eQAqOsrVKXF3oSL63Btx/Z7NqdssVRf8 QWLiJKKaqpLtoNdW/QudshoN7CU/Md+7/ixW60ui7ZoLELVf7cnzMn/g/zC1rwj2HguGapW9M9P hqPK1msHcpYQMWGgxtXdpHnCf9cKyZ5cpDIql4zYBl38qg+Q2bGWr10EE1KRGI3ko8YhYl+Qq8d KPTyYWrxbCYW6YlW6PbaGDGgOWyJvPVIwZd5i1Jqjuh0qFrRrShdvxF8zXofcdQHPAn9Ec9aNB0 EtW91TeWjL33TJyk2txUvz2HzZLccdRAXiqQX3ESMkAF/BTlmADwn3nFF23s2GYwDOaa2LTT6k8 8mDhUJ3NZ5a09khsArJSggxWq/+Jk8z9ni6Y3qPjo+jjbLreq8stfpLm5EZ8Q+e63p4keeEDAfW 7AuB87lKLJzghbVaATj4czdIggr7oz1rJxu0JHSTjKbu1PrlW9jwobLNmPHqbmPKTfzTnbpWwF7 VBVAEkVmwKmk8KC8K8J8I6Ll8bY87B9zzs6OR3n X-Received: by 2002:a05:693c:4199:10b0:34b:47b2:677e with SMTP id 5a478bee46e88-351755e1cd9mr6229724eec.1.1791472384302; Thu, 08 Oct 2026 08:13:04 -0700 (PDT) Received: from hitalo (190-33-161-131.in-addr.arpa.host.souuni.com. [131.161.33.190]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3515afd00e0sm18052389eec.23.2026.10.08.08.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2026 08:13:03 -0700 (PDT) From: Hitalo Souza To: linux-bluetooth@vger.kernel.org Cc: marcel@holtmann.org, luiz.dentz@gmail.com, linux-kernel@vger.kernel.org, Hitalo Souza Subject: [PATCH v2 6/6] Bluetooth: hci_event: Notify the driver only of SCO links that came up Date: Thu, 8 Oct 2026 11:12:38 -0400 Message-ID: <20261008151238.2138665-7-enghitalo@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261008151238.2138665-1-enghitalo@gmail.com> References: <20261008151238.2138665-1-enghitalo@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit hci_sync_conn_complete_evt() notifies the driver of the air mode of a synchronous connection whether or not its link came up, while hci_conn_complete_evt() only does it for a link that did. A connection whose link failed, or that refused the handle as it is being aborted, is deleted right after, which notifies HCI_NOTIFY_DISABLE_SCO. btusb picks the alternate setting of its isochronous interface from the latest of these notifications whenever the number of SCO connections changes, and HCI_NOTIFY_DISABLE_SCO selects no air mode: with another SCO connection still up, the interface ends up at alternate setting 0, which stops the audio of the connection that is up. Only notify the driver when the link came up. Fixes: 1f8330ea1692 ("Bluetooth: add support to notify using SCO air mode") Assisted-by: LLM Signed-off-by: Hitalo Souza --- net/bluetooth/hci_event.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index b1c107457..781d7124c 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5317,10 +5317,11 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev, void *data, } bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev->air_mode); - /* Notify only in case of SCO over HCI transport data path which - * is zero and non-zero value shall be non-HCI transport data path + /* Notify only of a link that came up, and only in case of SCO over + * HCI transport data path which is zero and non-zero value shall be + * non-HCI transport data path */ - if (conn->codec.data_path == 0 && hdev->notify) { + if (!status && conn->codec.data_path == 0 && hdev->notify) { switch (ev->air_mode) { case 0x02: hdev->notify(hdev, HCI_NOTIFY_ENABLE_SCO_CVSD); -- 2.55.0