Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6028284rdb; Thu, 14 Dec 2023 06:37:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEv8MGpZrQNllK4BHHu82aKGbOoCWNv547tXNWqSpX1w3R4mT7NABqaVuuJHk2SZTefixaC X-Received: by 2002:ac8:5ad1:0:b0:425:9d92:821d with SMTP id d17-20020ac85ad1000000b004259d92821dmr16714201qtd.135.1702564622023; Thu, 14 Dec 2023 06:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702564622; cv=none; d=google.com; s=arc-20160816; b=u0TI6QdJSTfPxCwip1n/EpO1nBSmvhXzKQvjXxhfUXrhJV1Xm0AzBbHptGhBHaix0g nqx2qXHszrQtogjStKp3tLaTeV4AttzI7ZdY64gM25HZOV5fCE22jYD3hGRiCKj14Cf5 5D51vxTtC5mS7mFgFIO4v04xACViOzfgx/t4kcE8Av0lkJBBPisAqRUbGByCVbRW9Lr0 pvzXzILFi0j5/LZNR+FFh4gfACqFJ0DAiVvO+FriMmEEqgwVWThU0usI9P2ao9MOYpKo 7WJsS7uYFBqxeYaGYM6voq2CKzlV2fyY4hwXPe+K7M1DYolxtGpMkQKFDKZbqsmwEvyP EKXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=Nlelb2y9H3cIvChzvUI6PEGZViCUJdZB0fK+EaZ+T4M=; fh=VlNjpI0r2Jj0j5jyS5lhOBBMjIdr4Cy9IaJfcVIjLl0=; b=UI727EIflqAFVYj2o2hPvDVfCZqpAo9TCADeiN45vkyryXNDmBBast9DNNGc+iKwpy 2lbfA6DwfV/VCUZcnXpkeaIFFXOW3XkrCPmBJxCMpXZWkDGuslBAK4T78jIGjugFlbwQ FCPzmeQxNprFV8XBKpTvYj/9S2el6MPB4xAkhg3e35bQYJmgxmbxbvKx0Rh8Y15vMUi1 prbkzYSHhKv9YoHCKeqBsjErtTRmxJTOTiYTCcTd0hHJTRDpM01B5MBc/zsVLUzPhcPQ KnF30kFVHNhcnk2uRZ0ZXc8QG9swl9JWBb0ihIcKJGdtYVULSM0DICbP4/dXq2ux6gGK cwaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=oEQ++XgT; spf=pass (google.com: domain of linux-bluetooth+bounces-590-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v6-20020ac87286000000b00423961c8e7csi13940316qto.155.2023.12.14.06.37.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 06:37:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-590-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=oEQ++XgT; spf=pass (google.com: domain of linux-bluetooth+bounces-590-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 370C11C218ED for ; Thu, 14 Dec 2023 14:37:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E7345A11A; Thu, 14 Dec 2023 14:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="oEQ++XgT" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6E5C116 for ; Thu, 14 Dec 2023 06:36:51 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BECMAKg030938; Thu, 14 Dec 2023 14:36:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=Nlelb2y9H3cIvChzvUI6PEGZViCUJdZB0fK+EaZ+T4M=; b=oE Q++XgTgqKmdOoFSQCZ+n9SNDqriOuCYYN/kdPrtuBlA0zju32aZUW/V5g2EJRt/3 SH1/tn2qCS1BXkwT8+kzdFQypfi5Az7p1Ay2ddZu4o8OAI2oOpJcXChlrURFA+fk slFfaLF1gJKSP1KylWerAFmZR1cGCvZC+f44iqAdikbsrAsWbtvR/Z0SHr0VpL+l P+sHPRmkdimcDHRMSBjS3lfyKsVjv0ZuAZsdFz9S68bRV77EWcxixBxdLHTaS7xP X84ROgnGO+REhW8/OsZMQobHuk2TEu4q5DIGkH1sQJCsXgK/TqYoWn6FPLyI0jjf QyNpXsqvAkXj3PYWaMEg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uynja9q4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 14:36:47 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BEEakAj014509 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 14:36:46 GMT Received: from zijuhu-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 14 Dec 2023 06:36:44 -0800 From: Zijun Hu To: , , , CC: , Subject: [PATCH v1 1/1] Bluetooth: hci_event: Fix power save marking logic Date: Thu, 14 Dec 2023 22:36:38 +0800 Message-ID: <1702564598-3034-1-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: YYd70lJQV8jaywHRc08iTm5I-p71E5DN X-Proofpoint-ORIG-GUID: YYd70lJQV8jaywHRc08iTm5I-p71E5DN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 priorityscore=1501 mlxlogscore=964 mlxscore=0 clxscore=1011 lowpriorityscore=0 bulkscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312140102 Flag HCI_CONN_POWER_SAVE stands for sniff mode, but hci_mode_change_evt() wrongly set the flag for active mode and clear for sniff mode, it is fixed by reversing power save marking logic. Signed-off-by: Zijun Hu --- net/bluetooth/hci_event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index ef8c3bed7361..74a14f2e0eaa 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -4601,9 +4601,9 @@ static void hci_mode_change_evt(struct hci_dev *hdev, void *data, if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags)) { if (conn->mode == HCI_CM_ACTIVE) - set_bit(HCI_CONN_POWER_SAVE, &conn->flags); - else clear_bit(HCI_CONN_POWER_SAVE, &conn->flags); + else + set_bit(HCI_CONN_POWER_SAVE, &conn->flags); } if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->flags)) -- The Qualcomm Innovation Center