Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp439644pxt; Fri, 6 Aug 2021 05:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMDOYl5hFIgZKC8PmZbCPoSr1yQvVItXAxtgjqz8Usp9N5wobbd9vTIG81W6dJQU2AD1AS X-Received: by 2002:a5d:80d1:: with SMTP id h17mr301230ior.71.1628254324935; Fri, 06 Aug 2021 05:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628254324; cv=none; d=google.com; s=arc-20160816; b=Eexc4Kj1ogJFyKYKLqOmbbDL7eZo8BROGkvFebTCneG/8+VyXSjYsgwV5DFDXs2IFI uuEyBZ/cC5NG8VhUPhwqL3+DIkHcTWo8kpAnwcZA6vV3AFRjGtT9roEzXZbG8LVb4oG6 p036eiBSQ86+E4g9no5Kyyj/F7BJtrw3C5en3j01cPFazKb6fSXTDAgIAo4rbvvnoaqi A/vD6T6CvTTHliyJyJABbLxw8taYQn5unimKqaeoMaT9BwmpS4u4vNH7La/fDvi5nWXY q0IPuHXmJFW8rQwpGf8ic3Zj8p1ez53wI0Wlh/wM+pg9RptVF6mueFsymIqxxnA/Zri/ 3bqA== 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=pU5aOXSGYEh/eYsFkv0YPqsT1qs4AGZkRspfZReSuZQ=; b=kJZ6ciIU/xFbDpvFN4OntGNF3TYysypJx0nBLRLMl6Fg7YNIxRBJAEP/1xegqGomFN KAJjBxb1EpPzduqf+dfB/Gvi2dPZ6z+pNCkMTnJH8PjzZfJsDTwmP2yj0nOadwjMPwXw vpaBiiHZY3ig4ZA7VSfqK8nyrP24ctTHNaCdkNmjqPc11eiCoMTsfgTWUDeKNY8N1Na2 jUlMqgmKK38hjCRG0GukP86U9kdjKdg/i8VHgDn8tMGVdapnw8AcvSMvB3QfRIIc5+Ol EfGXs5yTQ2+TUgHn6d8d9s2fTsTwE8RIoWnvuwPKQPBCfvipXRnPYVMpeUmRRDpgLpsk nW6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yKaCjVb0; 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=pass (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 w3si8931677ilg.140.2021.08.06.05.51.52; Fri, 06 Aug 2021 05:52:04 -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=@linuxfoundation.org header.s=korg header.b=yKaCjVb0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243972AbhHFISn (ORCPT + 99 others); Fri, 6 Aug 2021 04:18:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:46554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243917AbhHFIQT (ORCPT ); Fri, 6 Aug 2021 04:16:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63F86611C6; Fri, 6 Aug 2021 08:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237763; bh=+XodaBP0slD3ZyQP7K912W6mjXByAd2j667BExXjVFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yKaCjVb0BmlxCU1zNnRuTNK35lXVBaz6GYI2nE1L2aIfT58jZvNhDjv/kflzB1Z6I xkVMNdaSPjBE2n5ioNx45157C17A+JU93aTmwCeWoKKWuUp7FGLxaZnsqx84+UkaRm 8TJouUjnkXXDboIeV30BONFPH3l7R9gmvJ3X6u1E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , Kai-Heng Feng , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.19 11/16] Revert "Bluetooth: Shutdown controller after workqueues are flushed or cancelled" Date: Fri, 6 Aug 2021 10:15:02 +0200 Message-Id: <20210806081111.506794407@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081111.144943357@linuxfoundation.org> References: <20210806081111.144943357@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: Greg Kroah-Hartman This reverts commit 78b03389d2773255ceaf051f2dca134b816d96f2 which is commit 0ea9fd001a14ebc294f112b0361a4e601551d508 upstream. It has been reported to have problems: https://lore.kernel.org/linux-bluetooth/8735ryk0o7.fsf@baylibre.com/ Reported-by: Guenter Roeck Cc: Kai-Heng Feng Cc: Marcel Holtmann Cc: Sasha Levin Link: https://lore.kernel.org/r/efee3a58-a4d2-af22-0931-e81b877ab539@roeck-us.net Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/hci_core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -1609,6 +1609,14 @@ int hci_dev_do_close(struct hci_dev *hde BT_DBG("%s %p", hdev->name, hdev); + if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) && + !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && + test_bit(HCI_UP, &hdev->flags)) { + /* Execute vendor specific shutdown routine */ + if (hdev->shutdown) + hdev->shutdown(hdev); + } + cancel_delayed_work(&hdev->power_off); hci_request_cancel_all(hdev); @@ -1682,14 +1690,6 @@ int hci_dev_do_close(struct hci_dev *hde clear_bit(HCI_INIT, &hdev->flags); } - if (!hci_dev_test_flag(hdev, HCI_UNREGISTER) && - !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) && - test_bit(HCI_UP, &hdev->flags)) { - /* Execute vendor specific shutdown routine */ - if (hdev->shutdown) - hdev->shutdown(hdev); - } - /* flush cmd work */ flush_work(&hdev->cmd_work);