Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1196455pxb; Thu, 16 Sep 2021 01:51:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvmEBZMvjhw4G9M26/1XV/TWhiA8dFFxpmITmvqBFT0Gug9c5snLcQ6cdPffGrJOM+9Lmc X-Received: by 2002:aa7:df92:: with SMTP id b18mr5126801edy.47.1631782271480; Thu, 16 Sep 2021 01:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631782271; cv=none; d=google.com; s=arc-20160816; b=D8CqunKnZgaN/C6Lp7eXxukHYQ4N5DFwOL2feIfwW1QNpAi8Tf+zGlVA0dNenDYgjQ R7PoQ3sK4Sd3JGik74h01hxwNkge9r7xm2xqgEFXt5GVSlJKQHXpvv81oTJDWj9wZ5bo q4Y6xiKHXWLx6qkUKk06pcilQz71L48hW8IvJ90/LH4NoAc0vYF+m9kEy0ywF62wLeqC +I06PKU7rQZJsjEbZsPWF4dZxuNmPP1K67rxXp0Gun1zZYEG+mt3r+WAH2PGMYMVaDHK WssHD04byAaQx5cZGstP9K7VV/4WMFQnvcAA/QW5ufJQs0VJ9rKxAtOXhz0O26m6YAo9 h3UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dpi9sZlkMXkSSFIchxpEQolXTdGhLKLQZtfAm+HB4MI=; b=IuNgSAstmJF1WSofazZV2ZUjzhO93z2r7cYicUma93y5fC9jwoOWIIfsfgmRd2XYeE GfTRdLexKozG5lvPqTgpBlpbJlEwOWlnybIzyg3b66MJ4r2P+ZNf9hLu4hJWiKNbl7qr P1wvsgTt6/u3g1HIWpInNOH6BUkjr5b0r+CRyMjGLLdWps5ufGLAce58uGq42HNTML1K cslYGTSbG+F2+xgiNOAyNNPprWtsmhzyVM0cYbX9tasl4aT1Dkjx6f45zS4Mxc7SVLFp Cd1eCZRYHohW59aVbqQXzwX+prU1YCiikO5YcpRmlfsEAbCtNtuD5KXUr0jJEv2hvpJC 8xow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X9AncDAC; 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 k7si2930896ejk.77.2021.09.16.01.50.47; Thu, 16 Sep 2021 01:51:11 -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=X9AncDAC; 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 S235372AbhIPIuO (ORCPT + 99 others); Thu, 16 Sep 2021 04:50:14 -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: linux-kernel@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