Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp451363pxt; Fri, 6 Aug 2021 06:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEwvzj2KT2L5IgRshC7S7JDVTU6NcLpxPmW0O0ZF1dD4/L/PCTJjELTJVqn7J0nXtfgSRX X-Received: by 2002:a05:6638:2590:: with SMTP id s16mr5957424jat.121.1628255165913; Fri, 06 Aug 2021 06:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628255165; cv=none; d=google.com; s=arc-20160816; b=ti320aEgrAJiUF6TvyvHhp/cVUsn32ym1l/KYDdi9K8oxMsmxwV9eBe0We9aE0iWtf I4rr5FhHb6yRavcGETd0EZSwEYNQ/h3pC3iDz6WS+MDoiAIrKmFfE562d9Jtkf50tp+/ MB6SXYp0TvXh69L0b5xRbD1H+65zWvrt1LKwLHlIENSXgRrW8P21oUgz3M0jcNyndKvh i8+Y1QwS6ODh3wbdGqj+dTdgw+L2r8tFvdzzKC8aRofp7NdxT+cZ7uDy23yPNxzfO6vQ bZBLcf0YITzR7dnUbFX8UvUZLc2A7wz8ruqYQ5kX1R6sjE+/D2v5D2VziLypsVYe/SYD 3+nQ== 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=DgCo7vbtPvc50+lYahuB+AAg58tXvrQ9Vmcjni/rIgc=; b=wOF9XNKGTdXJJ82MZz8b+bhydUCgqRwsV+MFT+V8lpRWu8fmdmEFDycINX4LD9Hdzp FUz5PktFv40xuMX7E14ozvkGSkBmZPeN8wugam0NhFH1ybiGojs/HU7vzw7Z74gs/265 VnQOrHGXcQfLTO8GRyvRnogLAOyIT27eiSWUtWa0jx8sCGw1Jc+JU0yOsPeX6MwmZc25 LZOF6GN9aEXky0QizpZZurTe25mRFI9eaz0/2rWYkOAK5gjaVPE+suRvFYwVPGYWKwls mUz816PhEl515Bi5u4A1ReF+SmsNHnvrK3mmshLl5gFODo9diqrY+UQGgzBzuLVhUz/z 27rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U5Jz5qCg; 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 m6si9178862iol.83.2021.08.06.06.05.51; Fri, 06 Aug 2021 06:06:05 -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=U5Jz5qCg; 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 S243582AbhHFISA (ORCPT + 99 others); Fri, 6 Aug 2021 04:18:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:46112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243782AbhHFIQC (ORCPT ); Fri, 6 Aug 2021 04:16:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3CE8760238; Fri, 6 Aug 2021 08:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237746; bh=XOJsaRYVYTuMJJmgcRZaIbiBoeuFOeJ3eghoL6PTJUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5Jz5qCgk4CiIKMGTk77uMo2YflI492HSMz7Ndc3FzYk++3HV65xdj1RYdljJZ1hc ENnfDPWKzWLGJEFZycJSeSiWbAwGe4m/7/3sypeLM+7QPe2nOJ7kqbQic7adRuqyQn GMYSvTe27RWGc2xUD7VWD/ODftfc+ROpBlW5Qc74= 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.14 07/11] Revert "Bluetooth: Shutdown controller after workqueues are flushed or cancelled" Date: Fri, 6 Aug 2021 10:14:50 +0200 Message-Id: <20210806081110.754296437@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081110.511221879@linuxfoundation.org> References: <20210806081110.511221879@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 854e6d767a33bd53b00902d65dced7d1e7abfe1a 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 @@ -1569,6 +1569,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); @@ -1636,14 +1644,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);