Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp955315pxb; Wed, 15 Sep 2021 17:57:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuV3lElssD7qXgduJrd9rw5ubGaO65OXqmTOoByxqgD/w22NzOv2Q2rsilNoeFIA0HbUvu X-Received: by 2002:a6b:5c17:: with SMTP id z23mr2231919ioh.3.1631753845592; Wed, 15 Sep 2021 17:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631753845; cv=none; d=google.com; s=arc-20160816; b=o1rd9Qkv/fNySXzoRXw4ZnwJO002Svjm+S0P0QAd/dG1LujgjVjGdY7nqYgMcifJu5 hYg3BVczPBy0ZjsLkqVgdqW0nJtqaaHDv3iLFTxnDDVLn3baPUDdRclIur+qX4PB6wBe WCRtNwNOlggJL+tt5/VAQEUelutvpA2Wb8f+DBGYRXy9nVPFYm+qCn2BqPOB1QeMUqEt EyaSBttvp9DBwBKgixuj+Os01uymeAxoTMgNHwCtDRHkjh2eZ5kiVOfQ4BzOe6r7X3DE MbHLYgC2d64XIJR4JF1OIqccoGW95HBZ7DRp+I2eWNAQakVeQMUgR7zbf9NV/7Go3sdB 8CIw== 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=9Y5SDpsXjo5lnxQ7T+Jy6kXXjGWV75MgGJOwtcE7MeY=; b=SHg3f1t0IaUldOc0BJZviW5+jwyw2GDo2YqzkziZYA65lIXUMy3HxFNitFqBi9FF5F dERKi2nJCKFqvIAVnEmxwpvVsLtcbBHGsMAOpAO0CXgl7iAPodo9G6hhEtXlLyc70tal Xu6yuJLDHUmgfywLUfYLkVSyXsm55GgEp7IngyYUUPtcyPGFj64o/JDS96M0wgz1lqWD pLABVTt+jfB7PRL5AHDu8RdWpEyLggCKtwmmldrfHmSOEU/hbU105gaIna6HrfHj7Oc/ RG5oAMqSkY09cFvjICObRvFBpUhTRf0Wpupfsr9u5QYuQPaflwWylBxSTzSHME9Qv/EC Mi1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u4MqB+Ol; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h33si1419186jav.17.2021.09.15.17.56.59; Wed, 15 Sep 2021 17:57:25 -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=@kernel.org header.s=k20201202 header.b=u4MqB+Ol; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233554AbhIPA5d (ORCPT + 99 others); Wed, 15 Sep 2021 20:57:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:52572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbhIPA5c (ORCPT ); Wed, 15 Sep 2021 20:57:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0811610D1; Thu, 16 Sep 2021 00:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631753773; bh=pgnKBG0IkPmD5mHwnJGP4MO9grHBDDzdzGVxl2qC78U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u4MqB+Ol2Pu2+kDVyTXIumMPFx3phXhiXNm1EUAkGf7H0szTpY3eW4bWlBRbHUFkW ErHNFPq6capQGoryArp9v1M7R3E6T6fKCBoKCVrpHrosYUZ7fksMHMGjpXBrO4C5/I gMHis44MCQ/bG/nJd3Qldt9rVHXILfn1fxCP8fdNpupS5VPX4P20wLYzNkBZzj1P6+ 21uX+nHtHkKhXayodDGiAa4yhBN0Y1TW5EFS35eeIhzrpvSL+D8AhkoFUHkQjZZbA1 Ex86rQKD7wvp4IIDeeFBKJbsvF8rOZ6GlnwPZrf+Ng0SB4TOv9y4OqcTvJ5LsLkL1B Wa9IgE2aSDNyg== Date: Wed, 15 Sep 2021 20:56:11 -0400 From: Sasha Levin To: Guenter Roeck Cc: Pavel Machek , Greg Kroah-Hartman , 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; format=flowed Content-Disposition: inline In-Reply-To: <20210915143238.GA2403125@roeck-us.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Thanks, Sasha