Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp185301lqe; Thu, 4 Apr 2024 03:52:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIVE4QZajIcTRzComEOHTothiKSmeqGI0A+SDa8Vx2YF4BxN+CsyjS2RPxMn4V6DARKosydGMeUqzIHlUr+QAOwuZal7x4AQh/0+15fg== X-Google-Smtp-Source: AGHT+IEmLkChz70tjk7Ez5+fPv5HiFz12gLzJ5AYcZGaVFhTZHnQKNEDWE0BwpF6apJWcXBgyTza X-Received: by 2002:a05:6a21:170f:b0:1a3:c407:39d8 with SMTP id nv15-20020a056a21170f00b001a3c40739d8mr2288338pzb.45.1712227928375; Thu, 04 Apr 2024 03:52:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712227928; cv=pass; d=google.com; s=arc-20160816; b=We0Sk3Adng9fD5RmdexDLUfrxDfIWznl67aduE84iy/kPzttNNsl7QnZ2KUnvjF5Dr 7hndhvbL2FbRzMh2sWJ7v7N82tR64zNVecyKP1E65qannZW+tSATIPFYEylMQgYbCoLp TFVAAzTo90VPxeSqGooB9mnhErwJGIbxm8PhXlg8tRpia2n6lJDWx4r+gzsUY2oxDzRI swiVa+VNDtzI2Wv7KaRBe69qY7mXe6CGZvbMSYTxJ22m51lLUmo/pZntFAmax91tQWdY pDuYOAc7NZ60mvSTNlV3I8Fzkd3Qhj7jkEvhenhNH4SUgY2rDL5bZmUkNcNEd1ENQHqK l8eA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=Mlncb6RTaE9eevbsiI44CKn4YnO0CJ8k+DNS9ZBOEnY=; fh=EpCK0DyYapU60T0A+yllVv/j0lhTbOXznSfsH9z0MLY=; b=yRUR1HHEXogiJrKkYyq5B1j26liHWPoGj12qKZNa4husd/M6yBVhsqiwt3Nu0GpqIb 4gKEouqeIhZNVXP/HJftNXDKaR94VHSBs6yTpAFOBKSnDVIixGD9GcuJCSr4S3iVJ8yZ 11FGvWY1+3FRHGqAo/Ce+o68uM/fPXeHcyVSyRehQ89XCgvM0rcN7ylY9Y2iLz4561Ii H/HRKphdUB79N6XbiZ+tmR93wvGLe1arfvj1P9wOjWzXpJ1dOONh/UQSJDFhs7jvWHwa i1NrWlbo4R4e2geNerBG1E3UlSTX4i5vfzc3VbC4jBQcbXcYhg2Ah/vnzDZGJqu7zNlH SQuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2tmtILFg; arc=pass (i=1 spf=pass spfdomain=flex--apusaka.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3195-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3195-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j3-20020a63b603000000b005e838ab5bf9si15225205pgf.627.2024.04.04.03.52.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 03:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3195-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2tmtILFg; arc=pass (i=1 spf=pass spfdomain=flex--apusaka.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3195-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3195-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1518828BAD2 for ; Thu, 4 Apr 2024 10:52:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55D8F80C0B; Thu, 4 Apr 2024 10:50:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2tmtILFg" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 4430A8627C for ; Thu, 4 Apr 2024 10:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712227836; cv=none; b=MYHXLZMP4GJ8rAt/b4YK1KY4wTrV+XTa1yGuaWTf91IaA2KWKRIvzanV/5nLnMLXZZJPjE/GOZ7+mm0w/GmQkhyWDp2d98qctcT9NOj9MPh5ndaJjZG9EIR/Ytx+zmFd9Pur5XspQ6VGorkXiBh9/U0CxmZ/mXt7WV8n1tsZBos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712227836; c=relaxed/simple; bh=hCUJ9Vyeg9IAERTsInyGPjcv+2BcLki9AiF4RXL+nKk=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=pX5HfylX5UhBdFk1CeEO2lf0mQEvWhnFt59TuqD9RqLFkPj44pFX8VuHQQ0ZnGvvnA9dtRZRe6mUWin2wMH03qj1k81pnYuatO9sWJWIyPI097YlNxXnIS8GmmhekQffcqCTsXG/NaMgv8LVkz2w71eCtFEgKAIVZ/qvSKUD2dI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--apusaka.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2tmtILFg; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--apusaka.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6ceade361so1592871276.0 for ; Thu, 04 Apr 2024 03:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712227834; x=1712832634; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Mlncb6RTaE9eevbsiI44CKn4YnO0CJ8k+DNS9ZBOEnY=; b=2tmtILFgzR/QN7WpyW0RJt/3lmH03ce4DXVSkPSwKzDI2n8r/PWBcRjowntWQMvtXH n+TodXalvp5hKOUfou2G90+RZ6g7g0uaoH59ILJGIicTA407EM4uqonV9aAy431eoEUf Y+bl/Yq9UafV5xZfMSomxHwGQkw9bSjcXth45TQi9cs2yi0tGzs9m4ECiDoISdrPtv3y 7rI2aABIdutCdP/zwU1YVXDr9hWl7QRQEyK0kgnzKcRXpzMLd9KZwJb72JqQrlp+yeXc +aj52IYr3T67WwtGtXQu3zd6Swl3f9KSSVyOzlAIL8rCwda6LNXVI3QR2edf2T1jS1Bk t8rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712227834; x=1712832634; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Mlncb6RTaE9eevbsiI44CKn4YnO0CJ8k+DNS9ZBOEnY=; b=BciufOn/OPaRts/FD8nTTCxe2/ugUBh7kRqq8AEg2wNZbR6GOHz7hFvSpoEAnT4iHT MbLiDdos+XFt7XbBdhi4sm4bS6WFymcskOCzXppsVI5rZKHzf2BTtMhmwkrmJkW1hifq W+5zsR3OKYUBRJQB52FUsgFgnfbOCEN779aObiObv7I7QCN0TrOXJ+zbAnfFJWEa+fNW oMFVNuOXY4PKAtkHIhCH3w0jaznirMDrqVVsVbnaJ7tBQ+2fkhiPbWshLRcZOaFWt7V5 cB8nBNP+KSpiqDoVn/e2lYSyrf4GAhKFkH6YfHFF561frRi5L1oDU1gtOq3CNXM7HU1r NGhA== X-Gm-Message-State: AOJu0YzAzJPiST7s9zN/RH0VoGTxhTWxbekaMc4z6ChOIgjWko9X4y4k OOnNwI5NWJNc/ZEv/TLKZdxqv3WylhpHZQuqAbQABxTszz/CariMgAhJ502TFsKhGKMtfhw3q69 1Tb4hhzgV149FK8m0DtWTMR3+RgGkQqnrUSYXPrYk6G9OcGLvoPeWY9gr/I+AJXUqKJ+TYg8U0x N7u0FOxfJ4J8g9zjribhu5o8n21ihHt6ACGCjfb8USolOE04jm8w== X-Received: from apusaka-p920.tpe.corp.google.com ([2401:fa00:1:17:7828:b507:ed1b:110d]) (user=apusaka job=sendgmr) by 2002:a05:6902:1505:b0:dcd:ad52:6932 with SMTP id q5-20020a056902150500b00dcdad526932mr642375ybu.5.1712227834197; Thu, 04 Apr 2024 03:50:34 -0700 (PDT) Date: Thu, 4 Apr 2024 18:50:23 +0800 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240404185022.1.Ic27505c8f1ca7d4a653b1dcc1b08cdfc862a4622@changeid> Subject: [PATCH] Bluetooth: l2cap: Don't double set the HCI_CONN_MGMT_CONNECTED bit From: Archie Pusaka To: linux-bluetooth , Luiz Augusto von Dentz , Johan Hedberg , Marcel Holtmann Cc: CrosBT Upstreaming , Archie Pusaka , Manish Mandlik , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" From: Archie Pusaka The bit is set and tested inside mgmt_device_connected(), therefore we must not set it just outside the function. Fixes: eeda1bf97bb5 ("Bluetooth: hci_event: Fix not indicating new connection for BIG Sync") Signed-off-by: Archie Pusaka Reviewed-by: Manish Mandlik --- net/bluetooth/l2cap_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index cf3b8e9b7b3ba..b0970462a6899 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4063,8 +4063,7 @@ static int l2cap_connect_req(struct l2cap_conn *conn, return -EPROTO; hci_dev_lock(hdev); - if (hci_dev_test_flag(hdev, HCI_MGMT) && - !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags)) + if (hci_dev_test_flag(hdev, HCI_MGMT)) mgmt_device_connected(hdev, hcon, NULL, 0); hci_dev_unlock(hdev); -- 2.44.0.478.gd926399ef9-goog