Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp493914pxx; Wed, 28 Oct 2020 09:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJTLpNIbjPyuafRR0eLd659GZKRDhzGxPTEnqzy9scZBM5Z5dhPeVP42bgFFPchylagiOD X-Received: by 2002:a17:906:5e44:: with SMTP id b4mr8585235eju.211.1603902889563; Wed, 28 Oct 2020 09:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603902889; cv=none; d=google.com; s=arc-20160816; b=BlIEByrTidK69+HenWdVpOHVjMWGGarKhc3CdOCYryYe9R3qMz/YiUOouasGJnaZTL tMI8HX3NG3jdCrOJeSt8bTV1nz2SCQ4COAV0u+u9YQ5DG24w2J01szjJ4V+wrvaFLKba BsPH7DOcUpCIPUdndVqfHiItBaBkDfbonvQp6m26TSUd5W+rv8q1qK4QyXCcpBhxxKFp A8OkoJiGZ5XxSilTpxlHgIayf8VJL6LSuBGiBvwkYx0HepOExAK4RVZMwTkKOeRjYHRw 3VVEyj+hQwwokzDWGaUjyxQiiP7NY2e7MqYFGKoQohG3tUo3NlWRrR+ycZxUAu2CM0Xi OKzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pA9ivOJ35pOx7Lo1Uubfzj9znLv+nNAFmU/qRrkI5uk=; b=sEciU6iSmgihisJiN0UlyzYEvCWOQ7vFlzatvFe7iiZi9cqz/z+/BYiLSLTBW8tPCy 4lIyUhdfzwiYqz2acATLc67zvRuFVHBuaRLyCTR5mZ6PDrglIMvRSFsI5WA1pP4KNUYN GPgMbUcxRju0uOLEYqno2O7cG9t+ax7DTT5hfDKX+xMELl0ktO+wdrPYRR6RD77fNVua ECzL805fXR629UFr1+t7IIEy1vyb5cP8+nLgrlqfAYQ2thfjmDanEv8BTHB/rVCq6xPP dfi1jw6OTGWP3voPuQtmk7zC64csbPQYxhC72JA8d/1O6SrBH7oRGTPSdo8aVV8L4Llg BEwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QI4Z6hmw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si3580693ejz.318.2020.10.28.09.34.25; Wed, 28 Oct 2020 09:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QI4Z6hmw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1817200AbgJ0RO3 (ORCPT + 99 others); Tue, 27 Oct 2020 13:14:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:60126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1783824AbgJ0O6j (ORCPT ); Tue, 27 Oct 2020 10:58:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C6A521527; Tue, 27 Oct 2020 14:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810719; bh=/fTN4egQOHhfQLo3Y6MKkOZa4k2zt9TRNnDAkoS2sBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QI4Z6hmwuqK2uLp/bqK6ZtaW5hiEu+XxohXuNU92ZdwyvxVdN7PPq4I3Q/JimEKrg nqMg6QsV2ij9keTDFX0Ut4mnKR/WCL22bh9vHtLqMWgdfAclpTdrBylxwAwpGxSM6e mCDc+4hvucb25f5AmhTDjb4Fu45lWYwH4j3p8mfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhishek Pandit-Subedi , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.8 212/633] Bluetooth: Re-order clearing suspend tasks Date: Tue, 27 Oct 2020 14:49:15 +0100 Message-Id: <20201027135532.626926027@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Abhishek Pandit-Subedi [ Upstream commit 3eec158d5eca7dd455118d9e00568aad2371219f ] 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 Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/hci_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 0f4e5a31f983c..131d29e902a30 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3618,8 +3618,8 @@ void hci_unregister_dev(struct hci_dev *hdev) cancel_work_sync(&hdev->power_on); - unregister_pm_notifier(&hdev->suspend_notifier); hci_suspend_clear_tasks(hdev); + unregister_pm_notifier(&hdev->suspend_notifier); cancel_work_sync(&hdev->suspend_prepare); hci_dev_do_close(hdev); -- 2.25.1