Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp549561lqp; Sun, 9 Jun 2024 08:06:41 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCX85xdc4N2sg3kuIHvsTIE7+u97tQ5O9irjKZ9kfmpVGVjxyHgOj8gX2do8/rYxot/qr5LWo3kQ0DuBp4Cbhu9+MwKgJbhttvwN03BYMA== X-Google-Smtp-Source: AGHT+IEvNKJ4sMmE90H9WNe0nG1mZUmz92fXt4o8py3dOUixskQKN+XV7YWo9+goXtf7i/42qELv X-Received: by 2002:a05:6a00:2d0d:b0:705:9669:af1f with SMTP id d2e1a72fcca58-7059669b656mr732800b3a.10.1717945601240; Sun, 09 Jun 2024 08:06:41 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1717945601; cv=pass; d=google.com; s=arc-20160816; b=uqccn2tQngBQHGZiwK6hN7pc0Nh0jvDPONgYU4Dz2ri1s+jMJb6k9/dFGLUAyTY661 ZH5m4C495dHjDbYd9AT5n6uz1XvbEsa85uz38TqVhQw+u9eqUALVu8I63UQA5eoxXmaD 0ukgP8flkfF35eBXYIyw0xT2PLdL85W97sA80UGXulFBrwrvKHLAzEf1ijRgdGjxn6+8 /e440RV9F8Ticy0b+JKaFxRN+7We59CMJJoZBPDQ73KieM98n58b/HJvxO+YUFKKwnpG OnqhL7gImCOVxI5+ZDfzMHZ5FKZYOTNTX5OG4keRIW71K7ki2dSYpHIWwTG6Vavx/aFp mFwA== ARC-Message-Signature: i=3; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uWdjrq++B+FOCbuXHCPq7PJ9s19J5GeWTrapYXSiC0U=; fh=2XO0eO7ZUAfoOL2w0JvGaI/tzWwXHDRpxyL0xTBk05g=; b=r3rr//9n2RsqPvGItbExc6i4i81nYOormYGmzZkUc6QoTZQp5T/tXNewruDn0hmo0P H3YOUT2EwV+UY/WU/I4mjfE/hBW4KDklaD6tbMroJSq8+dMT/Kkbq2su3E2uVS2jJTO+ Luc3KW3Lebh3o86LLkBYRLlKSpOL1RaRGbnoIAKSrFCexkbOmy5Pn4OAeI1jmfSRidt8 OVTZLFSZ6+LFbZdrQm4QmF24ZUMSBHZDOQrCkppvcNq03bMEkoKeFWbNkgh1Rf0K8TgG lKFZAdEm0sM92bG6oD0+GsFbJqQyhAT0sZUAyLr/y1e/yEo93Hw3zVxYfDEWnQ11p/Sf VCmw==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=rWif+wR2; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-5216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5216-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70419094c9csi2283802b3a.18.2024.06.09.08.06.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 08:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=rWif+wR2; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-5216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5216-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E039E281312 for ; Sun, 9 Jun 2024 15:06:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DBE942ABB; Sun, 9 Jun 2024 15:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="rWif+wR2" X-Original-To: linux-bluetooth@vger.kernel.org Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA4491CD39 for ; Sun, 9 Jun 2024 15:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717945591; cv=pass; b=Wus1N0/S9pAYkmYItGqDLF+hxhkwIobQkG6+OYM310u1QXH06zS10jfBqL9avJnPJyIMC5aCRXdyRdLpXcU2ar6sy42yIuzWcoXapLwZDBEeJgZ4r9RCxAH3+TRf1oDJT+aTt2UgmJP5sHcvzXFxH6WCYvS0M9gwQbn9Kkz9FN0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717945591; c=relaxed/simple; bh=VSlKgT7RsWzDeHBJYkDwFlw3dCLKx4i/ocpT+WeNJHo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lg1UW+RF3AEHZRkeeU+8sgtTkFHHbZAGnCtUI7m2scI04rUpeR8ubAlDKMV+Ye808bJmZ+vcvB51yvkS5cVaK4/8n8V2tOzvWUsWo5gCkv2+clp71aIeS+252r+0yvMxMVWCA5q+ctmpIh8AW6OKC0XS9eLCm3rCXiLyK19OHWE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=rWif+wR2; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Received: from monolith.lan (unknown [193.138.7.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id 4Vxyv554qtzyQL; Sun, 9 Jun 2024 18:06:25 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1717945586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uWdjrq++B+FOCbuXHCPq7PJ9s19J5GeWTrapYXSiC0U=; b=rWif+wR2Zs7MsaHSfyUdEGYYd2HXQRdGlPk17QnaakIajVRGKqtTbsaTs8eCkJL08ElhWD /rIeeD6aBcoNjUTg0oS8J2Dv6GL9xM/Vi6sGXDJHIHInouBVfhE3jdmkP69Hbdi/OgHMny 0V9ysdg4YNVuqUV7HhziiVS9j/vyNX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1717945586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uWdjrq++B+FOCbuXHCPq7PJ9s19J5GeWTrapYXSiC0U=; b=IW85KDDqcppLLKrjZlwg4VshMvx2C8mzdOJAod12mNi9QPYBgmzqpYF5L1ws9s10ycMcvZ hlDDGSk0UBCliqx+Q7vvA37le5kWHl0TIfnOEVrbLztPSb1A7vHHUMKkzbi+UXPbUtTwrh lz48QFTqVdiTi+yEGA4w8r5wilADVqw= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1717945586; a=rsa-sha256; cv=none; b=FGrnCCrOwW4rC35XJYVawqNi1mFXhhk95IlIFr2jMZvf0qQtkuMILeN2+aE17aIwg6HsW3 B+t1ZhR2Ew0szt2OGQ4BQtcFeAVNtUOjJmuolPF+rtZFYqVUI4Da3EKpp+WDqqHZcBlrT4 sM54plIx0CnX+s5+s2HWroYFDP1jh94= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen , luiz.von.dentz@intel.com, der.timosch@gmail.com Subject: [PATCH v2] Bluetooth: fix connection setup in l2cap_connect Date: Sun, 9 Jun 2024 18:06:20 +0300 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The amp_id argument of l2cap_connect() was removed in commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support") It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie. non-AMP controller). In the above commit, the code path for amp_id != 0 was preserved, although it should have used the amp_id == 0 one. Restore the previous behavior of the non-AMP code path, to fix problems with L2CAP connections. Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support") Signed-off-by: Pauli Virtanen --- Notes: v2: do the change in the actually right if branch Tried proofreading the commit, and this part seemed suspicious. Can you try if this fixes the problem? net/bluetooth/l2cap_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index c49e0d4b3c0d..aed025734d04 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4011,8 +4011,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, status = L2CAP_CS_AUTHOR_PEND; chan->ops->defer(chan); } else { - l2cap_state_change(chan, BT_CONNECT2); - result = L2CAP_CR_PEND; + l2cap_state_change(chan, BT_CONFIG); + result = L2CAP_CR_SUCCESS; status = L2CAP_CS_NO_INFO; } } else { -- 2.45.2