Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1378840pxb; Fri, 24 Sep 2021 03:16:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqzz/1+usT+H0u+s4vWe23FTwOUD0nrPejhr10J79OJezzCWydQO36C2EL7zAvWMMNKSd5 X-Received: by 2002:a50:be8f:: with SMTP id b15mr4057748edk.200.1632478576019; Fri, 24 Sep 2021 03:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632478576; cv=none; d=google.com; s=arc-20160816; b=kKS962IWadsr6bpIPTc99wovDJIvW2Fdc/mRcL1VN1A6Qq/OFXQ76SQHpV9p0s1VUa kvkmlfbOnYjtdvxjOdjgE4tMMBG4L8jW+o0HRo7RJ5p7mg173bFYYgTM4cDK8euRpH0S udy5WwrotSRNhYbPZYMDzgdLV89324/wswMu6Hl9F07xRKa2wEa1jlvP/Rq59nlcLeph HMtQnpcqhN0ts/ibVisGgHrpb7bTqR1dBKjJOua00Cz0C9isBQgfMwC1DKzM6Cf3GlD3 zPr7O26/TcoFQEZDcwQJc7zoBNj9u1cWUUNd5fXpFnkqboNQN+lJL9PDp/3F/60HjU5R GDEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=zcomzPyObsacDIcyWucS7VWXKDgyAQnTYs29Uj18hCM=; b=d+z9oLRgKJOdSMW03boZQUWtH9PNBp3y8qj0LwsBVyuIRbqACb8juiVVl41ZRhFIsp vX0IJqbCx19Y6LIJ1UxcrY21mH1sSlTanjP0bomKBJjmo2N73OAdWV5TeSah9gL55/VF nAdTQa48wxwrAMDNUPnj4RSi6hV5mxwxsW1wTIidwRZhHgT7gGZK0vu/VbIM7ng4XOXd VMFOLamSy4jfonSGQCURgxZO6zAIUpkJ20RSXassTsoC65YV1sh4+3FSNmqaS4COw+CK v3ZzyS4smrZCJi4ux2lcPjrvkCwAKhHynCM0j94xffW4TPzHyNPQlSW426pS9GvU9Zqr LDkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si6688193edl.138.2021.09.24.03.15.51; Fri, 24 Sep 2021 03:16:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245422AbhIXKP6 (ORCPT + 99 others); Fri, 24 Sep 2021 06:15:58 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:54405 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245423AbhIXKP5 (ORCPT ); Fri, 24 Sep 2021 06:15:57 -0400 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 24611CECF2; Fri, 24 Sep 2021 12:14:23 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH v3] bluetooth: Fix Advertisement Monitor Suspend/Resume From: Marcel Holtmann In-Reply-To: <20210921144640.v3.1.Ib31940aba2253e3f25cbca09a2d977d27170e163@changeid> Date: Fri, 24 Sep 2021 12:14:22 +0200 Cc: Luiz Augusto von Dentz , CrosBT Upstreaming , linux-bluetooth , Archie Pusaka , Miao-chen Chou , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <9D93B868-B8DE-4C0E-B055-A2BB3B93528F@holtmann.org> References: <20210921144640.v3.1.Ib31940aba2253e3f25cbca09a2d977d27170e163@changeid> To: Manish Mandlik X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Manish, > During system suspend, advertisement monitoring is disabled by setting > the HCI_VS_MSFT_LE_Set_Advertisement_Filter_Enable to False. This > disables the monitoring during suspend, however, if the controller is > monitoring a device, it sends HCI_VS_MSFT_LE_Monitor_Device_Event to > indicate that the monitoring has been stopped for that particular > device. This event may occur after suspend depending on the > low_threshold_timeout and peer device advertisement frequency, which > causes early wake up. > > Right way to disable the monitoring for suspend is by removing all the > monitors before suspend and re-monitor after resume to ensure no events > are received during suspend. This patch fixes this suspend/resume issue. > > Following tests are performed: > - Add monitors before suspend and make sure DeviceFound gets triggered > - Suspend the system and verify that all monitors are removed by kernel > but not Released by bluetoothd > - Wake up and verify that all monitors are added again and DeviceFound > gets triggered > > Signed-off-by: Manish Mandlik > Reviewed-by: Archie Pusaka > Reviewed-by: Miao-chen Chou > --- > > Changes in v3: > - Updated the msft_{suspend/resume} function names > > Changes in v2: > - Updated the Reviewd-by names > > net/bluetooth/hci_request.c | 15 +++-- > net/bluetooth/msft.c | 117 +++++++++++++++++++++++++++++++----- > net/bluetooth/msft.h | 5 ++ > 3 files changed, 116 insertions(+), 21 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel