From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 C00C6C43219 for ; Thu, 16 Sep 2021 08:48:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A849E6120C for ; Thu, 16 Sep 2021 08:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235313AbhIPIuK (ORCPT ); Thu, 16 Sep 2021 04:50:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:60210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235242AbhIPIuJ (ORCPT ); Thu, 16 Sep 2021 04:50:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36874611C4; Thu, 16 Sep 2021 08:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631782129; bh=XNlHT7SsRm0aHT+xH8JBSxeM0QmbStCHOez0rQuhyXY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X9AncDACv15clITXSoMN8JlY/fHST1jd/e9N0jbnUiMkFQ1awv+Xz2BY1ebm4ROkU WtlLbobgOfRX4FhcODDSqIdImAlaK7bAoqify6yFBoJ/I3ijV4yfp3ZwLyraiLbeHb HPQBZM2OEKNtjeUBP9WROZ8co+97PxO3rKUl+Ymw= Date: Thu, 16 Sep 2021 10:48:47 +0200 From: Greg Kroah-Hartman To: Sasha Levin Cc: Guenter Roeck , Pavel Machek , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Hsin-Yi Wang , Kai-Heng Feng , Marcel Holtmann , Mattijs Korpershoek Subject: Re: [PATCH 5.10 157/236] Bluetooth: Move shutdown callback before flushing tx and rx queue Message-ID: References: <20210913131100.316353015@linuxfoundation.org> <20210913131105.720088593@linuxfoundation.org> <20210915111843.GA16198@duo.ucw.cz> <20210915143238.GA2403125@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Sep 15, 2021 at 08:56:11PM -0400, Sasha Levin wrote: > On Wed, Sep 15, 2021 at 07:32:38AM -0700, Guenter Roeck wrote: > > On Wed, Sep 15, 2021 at 01:18:43PM +0200, Pavel Machek wrote: > > > Hi! > > > > > > > [ Upstream commit 0ea53674d07fb6db2dd7a7ec2fdc85a12eb246c2 ] > > > > > > Upstream commit is okay... > > > > > > > So move the shutdown callback before flushing TX/RX queue to resolve the > > > > issue. > > > > > > ...but something went wrong in stable. This is not moving code, this > > > is duplicating it: > > > > > > > --- a/net/bluetooth/hci_core.c > > > > +++ b/net/bluetooth/hci_core.c > > > > @@ -1726,6 +1726,14 @@ int hci_dev_do_close(struct hci_dev *hdev) > > > > hci_request_cancel_all(hdev); > > > > hci_req_sync_lock(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); > > > > + } > > > > + > > > > if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { > > > > cancel_delayed_work_sync(&hdev->cmd_timer); > > > > hci_req_sync_unlock(hdev); > > > > > > And yes, we end up with 2 copies in 5.10. > > > > > > > Same problem in v5.4.y, unfortunately. > > Ugh, odd - it wasn't manually backported :/ > > I'll drop it. Also now dropped from 5.13.y. thanks, greg k-h