Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp70659pxk; Fri, 11 Sep 2020 00:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytwY+dVvoZLNPXFHSn2T0nvA1We1d+Oy4qiSLE5Kzn+rwTdF0A+N/EgBBR+nUsJwcF4PKp X-Received: by 2002:a17:906:4e82:: with SMTP id v2mr137968eju.218.1599808151831; Fri, 11 Sep 2020 00:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599808151; cv=none; d=google.com; s=arc-20160816; b=yN6MugoC7hy6cLPsBI5Hw9lImEw4BD/RfK7+p+wtPQ7IxlObzqINjghBoEBDzeyKxt NfaP32klPyA1Hloo+QyWxZtX7aOO+s9+V9us6F/p3FGo5YpAdtTR7Ms377BsJIHU3fiW GTHmvOlJSu2kK2D80LQAlkLLNNX5WcbuZSYaWkExtAROOq2HxOwqxzpQbFMxUn2KoJ3n K8xu+G6EXiQXQ+UWpV3Jh0Kh+Q7ZqE8Bmfv6hFipBKZN/7UZyhjKpTGgEFHngv9356Ym KWzHAM2V1ZKZ0k+r8xo68yWDXgCYjW9Jb9jMr3inYlXnEyECO4frSsZmxRHY0uFY8hGm hz+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=SMunUkaRD9TJNoZwfh/ABQab72nRdgpncpA6CAcc5rM=; b=gUnJ2Z8+9fSoyhnNADfHLihUPJY24dDHRmW3Vc60MjsEBSlzTsqpGOKqGkdb1DoC7M BL7xr2r72zrptNNn1LpRCoJashj4QmSSheiR/cITsud21gbMJJM+J7JY4yhvXEBsQHxX wNU9esmfafzXQACmXIWzvdFCH/bSjdXKBMpgEKqSW/PeJcCyxY/CD6xPMvJcpNiWQAcl uxKtXsP9R4Xp4qaYFl/Itkbf1o3i37r/9b+VpJjHduL2jH6aHfMSqVir1LM6IvffgBkk THUxX+kv0aSMY6ctMkmQ/TiFWpGSGz5P2C1RVF7mym0kIzz+/CVlJG2qC3w849t5wOHg XZ9w== 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 x2si703182eju.153.2020.09.11.00.08.46; Fri, 11 Sep 2020 00:09:11 -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 S1725888AbgIKHGK (ORCPT + 99 others); Fri, 11 Sep 2020 03:06:10 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:32837 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbgIKHGH (ORCPT ); Fri, 11 Sep 2020 03:06:07 -0400 Received: from marcel-macbook.fritz.box (p4ff9f430.dip0.t-ipconnect.de [79.249.244.48]) by mail.holtmann.org (Postfix) with ESMTPSA id 91787CED19; Fri, 11 Sep 2020 09:13:00 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: [PATCH] Bluetooth: Re-order clearing suspend tasks From: Marcel Holtmann In-Reply-To: <20200909165317.1.Ie55bb8dde9847e8005f24402f3f2d66ea09cd7b2@changeid> Date: Fri, 11 Sep 2020 09:06:04 +0200 Cc: linux-bluetooth , CrosBT Upstreaming , "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Transfer-Encoding: 7bit Message-Id: References: <20200909165317.1.Ie55bb8dde9847e8005f24402f3f2d66ea09cd7b2@changeid> To: Abhishek Pandit-Subedi X-Mailer: Apple Mail (2.3608.120.23.2.1) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Abhishek, > Unregister_pm_notifier is a blocking call so suspend tasks should be > cleared beforehand. Otherwise, the notifier will wait for completion > before returning (and we encounter a 2s timeout on resume). > > Fixes: 0e9952804ec9c8 (Bluetooth: Clear suspend tasks on unregister) > Signed-off-by: Abhishek Pandit-Subedi > --- > Should have caught that unregister_pm_notifier was blocking last time > but when testing the earlier patch, I got unlucky and saw that the error > message was never hit (the suspend timeout). > > When re-testing this patch on the same device, I was able to reproduce > the problem on an older build with the 0e9952804ec9c8 but not on a newer > build with the same patch. Changing the order correctly fixes it > everywhere. Confirmed this by adding debug logs in btusb_disconnect and > hci_suspend_notifier to confirm what order things were getting called. > > Sorry about the churn. Next I'm going try to do something about the palm > shaped indentation on my forehead... > > net/bluetooth/hci_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards Marcel