Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp438869pxt; Fri, 6 Aug 2021 05:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyua2yHNto7LV68JLNTGXcpBC8Su9i4f1X56ZAGzDLhD38LZc7OP+TLd96LHMiHLFJxS/qS X-Received: by 2002:a05:6e02:12e3:: with SMTP id l3mr22375iln.160.1628254253434; Fri, 06 Aug 2021 05:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628254253; cv=none; d=google.com; s=arc-20160816; b=d9QwZh8PDjctIaafrLNSNCcs6O+lSGSVBWakzfiJk5vLw4gVoecceLoL4BtbNq9aqF ZnCSrHTWuPss73PGaUI1RH62gRM+rTTDU3RQ6dOXQll2JQQBjPQnkrQAG7Mh+npeL+Uf 2u9OCQgEEXHDyLzdC+kgrQfnUTfE0cQNWJun2DTXHHERqSSKWVCr+3Iti1mCS1dyy4py sMQ3nrHREFYJ6jWoQndextLnt2BsZaHFdGF1z4VHQSivoQ8F583nC9NQawV3y+A1PX44 wbty/oJkHWQ3uL4Qqxm1e0oSYhCyknBcqAHmE6bFBZb43djNQj4ZM//8xvY7FY41cetP mOgQ== 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=qq8wwkYBXRdB1OxPL3NGT5oUyRJpQUoS2wGS5q7+0o0=; b=dPGhOPfjVKzV42ktLPLqHgd8JKuRKf7KhxbHN3n7F7EmRUv4jixM5pk66eoIq1Ljdr 8cbfvM84sLh2rb8r9BIWZDV5Pa6oNQjXTzms7FQKL4HPM6R0sLBDOAjbdhqKpCbu9JQY Z/wLfFOXyKFlopOz52SDLhnDyVSg8DBVlKo1R3501wE86jp0FGsOaEJSxHfZ6WsnAskb R3ZiOmA+eQtsd3uoNoAV6hOKMLxdcTJalXp4LES46k9nD6eV4/hr1z6JqZbGBY/u3+1n r98bYtWaQ2We3UbRlcvUClI2TXGeX9KLNfc7gvLoQppnWHrjTRasop3NcEymDReF7Yl0 2zqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YuP3g08c; 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 h14si9178522jaj.58.2021.08.06.05.50.40; Fri, 06 Aug 2021 05:50:53 -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=YuP3g08c; 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 S229604AbhHFIPY (ORCPT + 99 others); Fri, 6 Aug 2021 04:15:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:44652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243763AbhHFIPJ (ORCPT ); Fri, 6 Aug 2021 04:15:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE90B611CE; Fri, 6 Aug 2021 08:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237694; bh=/bT9lnLsRgo1oLJYpz2EtkO4AcjDzcA2znDE/Lz4PUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YuP3g08cyFySdYLfEpxy+val1NjZxOoEco8BY9dH/R5/h4El3GsQ5ugCowpUola/y dFMWJuwNNUjwrchdsy+j4M5477hRQ8GFV5zIz9On8gZBQukTKDJvBf5ZoWUZhNmKAF n5+GsN2h/KH7HsgYbEVfBUDZ0sjMuFp9HIAz3fjc= 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.4 5/6] Revert "Bluetooth: Shutdown controller after workqueues are flushed or cancelled" Date: Fri, 6 Aug 2021 10:14:37 +0200 Message-Id: <20210806081109.110744766@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081108.939164003@linuxfoundation.org> References: <20210806081108.939164003@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 5d16a8280078701fc03d6a0367c3251809743274 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 @@ -1666,6 +1666,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_req_cancel(hdev, ENODEV); @@ -1738,14 +1746,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);