Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp609509lqp; Sun, 9 Jun 2024 10:41:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0ZxilXJsWGMi2P1BBbLnubtV5iHr2+4Vjx1SPpt56whdxxxkaEw9WLhwmqsoYZ1M0B3kPpw9bx0NIIvCCfmZFGUnc6+dORM3D1k/M6g== X-Google-Smtp-Source: AGHT+IFDtioukVlhFnGSnbAC2mbVsuvTjrUf1iZ4fX8qJnqLT3tDTLmX9hXWlo+Xk94WL6iDSn2/ X-Received: by 2002:a50:cd49:0:b0:57c:5c4f:a356 with SMTP id 4fb4d7f45d1cf-57c5c4fa4bcmr4067559a12.8.1717954896634; Sun, 09 Jun 2024 10:41:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717954896; cv=pass; d=google.com; s=arc-20160816; b=pURFTKT+GFOBEZJ7/xdkYFXFXSeKDE3HUI8EpZPbpO4qJtdz0ed/Jbb8qBOdSiqgXN jyWMN8BDC4bohvX6E76TFmRvyY639+g5fPQZ9IS2Q7IZdXrSCrZAlStdSCXBmkooZB5b 3GykHgPWcemk2zjtxA2ULEiMaclOYIrJrHVIvKgUpoMH6mtRW8WmlMpDOoC57Fgglx7d DW0l9tNlZQ0RoCSlS5GqoQHWsH8ZNrxAaEMtQIpLpEgGYlhB+O5a/sbQET2SbAKgQFqz qIatRiiVOTocwe/uMMaIDDMWkdvkd0Te9mfllU/4NOc5xkzrXawE0cetXYL8tM6gk/CL oWUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=zH2H04IM+hb/03hlWsewPXo09HIvj/f5k6s7zejtt7E=; fh=+43O0O6gzkSnH37V8c4p48swOdgKYNCyM8phCYpxiXw=; b=o2ic25XR9JMfFQQLGav2Jan56GZL7GfCOqPIvspCbBpThkrLUKQpfXCT+Me1ftc104 TwCS0kST4oKubdifWKQZHSO15XeMXVKXdisXuzvgRCAqncye26zfazzNY7UEvVutjTfO Rp9/6ROMY9kAqk3WLitTwdyDsWbCDHF8+3pVZCy7tgPBgueO1MRSPx9nQheOj59kGqEz x+tnXvPFQPP7Wiw7m/LlqGIC0qnqukvG8fGp0m3OsmD4BXvobYN4wJh5Nyo5jMTDBo79 tIPeRme/FWHlLfnKm/ngmgDta/q8OixSXTN8iEOmI5ep21LWP1t137PeDF57es2IiZQe B8Kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LfCiG40v; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5219-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c73069255si1353223a12.554.2024.06.09.10.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 10:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LfCiG40v; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5219-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5219-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5A2081F212D7 for ; Sun, 9 Jun 2024 17:41:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 527494AED7; Sun, 9 Jun 2024 17:41:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LfCiG40v" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 2B6F717554 for ; Sun, 9 Jun 2024 17:41:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717954886; cv=none; b=fokUpQt/UmAKrlWDQQIfOy014/42sxM6tEt8hxSVVcZYApVkk9vM82JaXUanxRxN2g+EKoraDD0k3MRU2yZXECEGZWtnO/RgM7h2hi/+P7jEKTyhv/ZrFyqVd7rnAD4JsdC35H2ZZJ6DmAZ3yb425Hgc3lpWz8u9JQ9rdX9twA0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717954886; c=relaxed/simple; bh=Ah+rH2/5DH2zHCMDhz53mX1X9YDCO+w2M2y6XlZ7lg4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CiKBJcAwnHZ/56E5mp7l/XNupJwU8u4/aQEUH3tC0irP6P4qcZ8xXyWoV/4sryWQwmWzzzYwnxId0eYXstLr2tBpHeORDRVAUOmjfOBqGHV4bRI+mrp50tcsyfYuBx4rnqhw/2YJH6shE0iXTI9Gd2sxGuEyJNN5ty8snYvMiZs= 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=LfCiG40v; arc=none smtp.client-ip=209.85.208.178 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 Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2e73359b979so44001511fa.1 for ; Sun, 09 Jun 2024 10:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717954883; x=1718559683; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zH2H04IM+hb/03hlWsewPXo09HIvj/f5k6s7zejtt7E=; b=LfCiG40vRRrf5oiKP6n1RQGrdeYNYXXk5AKvpBwmCgm7Rx4f431HyACZOygZXZzHuk aE12YDDozGrShqAjZwd5fzQAnVRxCGMXM6QBDwQS77iq3t2xtAyb6U7SzRvSbAHJNGs6 IesBZXPS2i3fWQpG3kjay0RdSBnIOzFwkgLpj9HnKNHFP3RV5tLYV3JfFErPED3t/e40 Og72ehdmieWPx+6z9Nd2wD0zwsazrIU2p3oyDZ5CF+NLiwd1zf5iEiKD9JzJHZOjgRzo pAw+fxReN1MUreSb4nwlAJ2YwJKQxo7C/K9N7DSFemQn/o/4aCXvSugerKxGNJCP14bA jtaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717954883; x=1718559683; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zH2H04IM+hb/03hlWsewPXo09HIvj/f5k6s7zejtt7E=; b=WpIOId40atErbqXyk1Y1cSUleNZYl7lJM+v9pcRTgvZihhyDRi2/7XfxPcOhw3Ca51 BSwds5cgNi0MpA9l1uNqdqP85bQe6w2La9HXHiKrS2IxS5Vo7WwLG57v47sMzNYhR8xO 1k8SX7z/lh0Rb5peKDbE15CUPNAp2HgXC/TH5tac4cYpgMkafLWm+k3TFzw5mFNLpn6r OqX3c6XMw7+rg1T74TxPyXbJfZXj4TPAdgYf7xQXCR8TMMrALtbNQB7JvZ34CtTZ7NJF VWqonulaSIIbT5APHY6kZ5YSlQx+qPSIZRqFQlbDxPABswEMaI3TIxM73ULfDugFnqL3 5jqw== X-Gm-Message-State: AOJu0YzUM7YB0jVTkxL35uMILDibyN0RCbKDOxfisrimZ4AvVxCOA/MP GBrMFEybemY6jjWP0C5YFZlkqzZPExhTAmkiLjB0pTW8vDbyckTrqYmqQNbz8SrPUiB3MkoQA4G vZfACEqS1ACXbglRkQdh+Ele8LMk= X-Received: by 2002:a05:651c:211b:b0:2eb:d94b:1d3a with SMTP id 38308e7fff4ca-2ebd94b20c3mr30792571fa.40.1717954883066; Sun, 09 Jun 2024 10:41:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Luiz Augusto von Dentz Date: Sun, 9 Jun 2024 13:41:10 -0400 Message-ID: Subject: Re: [PATCH v2] Bluetooth: fix connection setup in l2cap_connect To: Pauli Virtanen Cc: linux-bluetooth@vger.kernel.org, luiz.von.dentz@intel.com, der.timosch@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Pauli, On Sun, Jun 9, 2024 at 11:06=E2=80=AFAM Pauli Virtanen wrote: > > 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 =3D=3D 0, i.e. AMP_ID_BREDR =3D=3D 0x00 = (ie. > non-AMP controller). In the above commit, the code path for amp_id !=3D = 0 > was preserved, although it should have used the amp_id =3D=3D 0 one. > > Restore the previous behavior of the non-AMP code path, to fix problems > with L2CAP connections. While at it we could create a test case to cover this code path with l2cap-tester. > 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 =3D L2CAP_CS_AUTHOR_PEND; > chan->ops->defer(chan); > } else { > - l2cap_state_change(chan, BT_CONNECT2); > - result =3D L2CAP_CR_PEND; > + l2cap_state_change(chan, BT_CONFIG); > + result =3D L2CAP_CR_SUCCESS; > status =3D L2CAP_CS_NO_INFO; > } > } else { > -- > 2.45.2 > > --=20 Luiz Augusto von Dentz