From patchwork Tue Oct 27 13:49:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64083C388F9 for ; Tue, 27 Oct 2020 17:14:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 067DC22202 for ; Tue, 27 Oct 2020 17:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603818874; bh=/fTN4egQOHhfQLo3Y6MKkOZa4k2zt9TRNnDAkoS2sBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=eLRIs5KdFunWvLAtkqO/+zMncq4NxmgGB8EAfhgd3IYxn8LWHhWAOoIa9utwvKmJ+ iFBmiqzUyagA+UiFErRbkzm+kjmNuw66G1oJinRHfUDEVSutzvmR7HP9x0gM7tw+ZZ djaJozBiKHTUszJ5vuYijpuOx15rFBw4SZaSXzgY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1810143AbgJ0RO3 (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: stable@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);