Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7203579rdb; Wed, 3 Jan 2024 07:55:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJrb1XFKn36HfOF9I0070pKq2XwW9GNvROGeLIaNBnvaKfaQWcfgV5JSssKeDJvh224pMe X-Received: by 2002:a17:90b:1296:b0:28c:2614:2caa with SMTP id fw22-20020a17090b129600b0028c26142caamr5589684pjb.17.1704297329941; Wed, 03 Jan 2024 07:55:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704297329; cv=none; d=google.com; s=arc-20160816; b=cKc+XC2d6F90b2pBXFUEI9crxL0BVUy8SzjdGgFSfPsogKgBjd6W/MV/lfmVCkvkpW UGTFWxtPRx4DeIYYdw31K/0noq2O/7kCawMxtSqPlzrQvOtEj30wTwyYzCyVNrVbJ1z+ rG8A+Hkv3pY0k2r1viOEv7OFBJtfwDkFPZWkpJg0Auqxx8dTMywRrWhm4onKXnVeif+B hdl/zJy8SfLtb0uH9LwZTtgISCZGRc+RYsSAAEwOlokz/mTlukbmwK+/ur7O9CBl9u7j kWb6KmKgo4FBGIVCx9LyGKJN/eNRw0D8kYiiIhki/CNexTh4lDEw9aUBCSsm0brx3RQf ZJJw== ARC-Message-Signature: i=1; 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=JBL9Qlw0s9HFYXJhGaaKeiT1PrvQ2SXf3tpTJ4/9DV8=; fh=R2XPFnrlavrgjOSkuTl6NMYlm4ri6vZ0KPXW1nTHQ9U=; b=OBKt86vyz6TBGa80aznTBpIolvxJ42kij5XzFSJpVAOjaLEw63XRty/bYi7CVh07kV lYREFZcjplCP/F1M23T375rH45QuvKKclzC4lQyge5fGG8qPXk4SHSddcVo4WRwvSVt4 2GuZ9zYGQcpW0bm8/BxbU0YYiixU/6O0kVtZmzuvw19kn+00DZRB3cyC906ZayTMoRNA 3PckwqWKXIQMHA21fEnTzP2BSu60RM+is6Nf0ZYebfvb5ZdAV6G0/T2XH9LEi34jyXrq ieIrEUzPmtfC7dCuM/7iGM1RcfOf7qOXmePay6ZAaR0KKXulVGBqWm1kQXsonvejWw1G OB+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Apn/sAvO"; spf=pass (google.com: domain of linux-bluetooth+bounces-861-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-861-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o10-20020a17090a744a00b0028c68141bb6si1392588pjk.151.2024.01.03.07.55.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:55:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-861-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=@gmail.com header.s=20230601 header.b="Apn/sAvO"; spf=pass (google.com: domain of linux-bluetooth+bounces-861-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-861-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7CBE328675B for ; Wed, 3 Jan 2024 15:55:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1863B1B285; Wed, 3 Jan 2024 15:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Apn/sAvO" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 ECD4E1BDC2; Wed, 3 Jan 2024 15:55:21 +0000 (UTC) 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-f180.google.com with SMTP id 38308e7fff4ca-2cd053d5683so26877771fa.2; Wed, 03 Jan 2024 07:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704297320; x=1704902120; 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=JBL9Qlw0s9HFYXJhGaaKeiT1PrvQ2SXf3tpTJ4/9DV8=; b=Apn/sAvOwHkQEwx+qyZYiLV6CdzxiKwwwPCng8d/kV0wJ/XYP3Iv+IQaxFP2WAbj58 E7A4Zl7tYYbmfRWA7vZk77pZixFRy9J0Cf0YxyHPAhFlH7U8JHdppu5oed1TN5TIbSdp ROP3zgws6plkvSXgPh0zUcZPk47l7vgGmU9bP42mBaKqo8hkeCPw25BvOD/Ue1sgtpr6 zZdG7pZDVdBNYqyTbAGQ87lPK1iSnoNlj6lM+2hiT53RiBg5VO8yvrjIq42CmVuPKTGs np8AvRPAunGWDZVJ7gqIHhkeTaxV94vJ6oFVkID7qTHi/WQibR5yIjZuxY0jPzfEujYC ZiVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704297320; x=1704902120; 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=JBL9Qlw0s9HFYXJhGaaKeiT1PrvQ2SXf3tpTJ4/9DV8=; b=Pggj0TYCk+U8vvZX1ZdgWxpNa4Hj3c6sFSWZ0aTkESovYUbhEQxQRWLjcyIrdIBGrl xCgcKFb3220YSNvC4tyOFqusC8bvqm9fvTip3CCq3UteP44DOTTSQVYJn9HSJnBFBncg fGi5wdSggGRoRHGCTv7LpwEJ11vkFoJr4Qw/yP+/+YGuJrjC73z6o9nlNEgMiO++ccHT uPVs3tYzmDwTtUA7E6dA/zkPaJU6pkNcukWOxMPoxzDMheSaTLPl4WeJcNjFEcluFHlf A9/i5v3fTXl6ksx929Rv9T74DXkLP/c/98qeLjgXwtBo7Tkkw/TQgM58TP3nIeYaBNP6 2P3w== X-Gm-Message-State: AOJu0Ywm8Bo3HwbGplbY8iXIOMrm1gFIsq4qmwz28R+i5QEHEmICm4Jh gwkOcSg0GFRAFHRyqq1yaYoDT+8mDrlZFxpJack= X-Received: by 2002:a2e:9643:0:b0:2cc:ea26:38d1 with SMTP id z3-20020a2e9643000000b002ccea2638d1mr3842952ljh.45.1704297319902; Wed, 03 Jan 2024 07:55:19 -0800 (PST) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240103101201.1812679-1-clancy_shang@163.com> In-Reply-To: <20240103101201.1812679-1-clancy_shang@163.com> From: Luiz Augusto von Dentz Date: Wed, 3 Jan 2024 10:55:06 -0500 Message-ID: Subject: Re: [PATCH] Bluetooth: hci_sync: fix hogp device suspend bug To: clancy_shang@163.com Cc: marcel@holtmann.org, johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, zhongjun.yu@quectel.com, Clancy Shang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Clancy, On Wed, Jan 3, 2024 at 5:12=E2=80=AFAM wrote: > > From: Clancy Shang > > when Bluetooth enters suspend, and disconnects everything with the > disconnect reason code of 0x15, the hogp device could not into sleep > and continued advertising. when use the disconnect reason code of 0x13, > the hogp device going into sleep succeeded. > > Signed-off-by: Clancy Shang > --- > net/bluetooth/hci_sync.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c > index d85a7091a116..16b5420c32d0 100644 > --- a/net/bluetooth/hci_sync.c > +++ b/net/bluetooth/hci_sync.c > @@ -5927,7 +5927,7 @@ int hci_suspend_sync(struct hci_dev *hdev) > > if (hci_conn_count(hdev)) { > /* Soft disconnect everything (power off) */ > - err =3D hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_PO= WER_OFF); > + err =3D hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_US= ER_TERM); Are you actually paying attention to my responses? I did nak this change before, so we need to find some way to detect the device is handling HCI_ERROR_REMOTE_POWER_OFF as link loss, which is wrong, and only then use HCI_ERROR_REMOTE_USER_TERM, so please don't keep sending the same patch over and over until you make these changes. > if (err) { > /* Set state to BT_RUNNING so resume doesn't noti= fy */ > hdev->suspend_state =3D BT_RUNNING; > -- > 2.25.1 > --=20 Luiz Augusto von Dentz