All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Miao-chen Chou <mcchou@chromium.org>
Cc: Bluetooth Kernel Mailing List <linux-bluetooth@vger.kernel.org>,
	Alain Michaud <alainm@chromium.org>,
	Archie Pusaka <apusaka@chromium.org>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
	"David S. Miller" <davem@davemloft.net>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v3] Bluetooth: Keep MSFT ext info throughout ahci_dev's life cycle
Date: Mon, 25 Jan 2021 16:13:02 +0100	[thread overview]
Message-ID: <070E7413-A3E3-4FEB-80BC-D3DD922DA19B@holtmann.org> (raw)
In-Reply-To: <20210121163801.v3.1.Id9bc5434114de07512661f002cdc0ada8b3d6d02@changeid>

Hi Miao-chen,

> This moves msft_do_close() from hci_dev_do_close() to
> hci_unregister_dev() to avoid clearing MSFT extension info. This also
> avoids retrieving MSFT info upon every msft_do_open() if MSFT extension
> has been initialized.
> 
> The following test steps were performed.
> (1) boot the test device and verify the MSFT support debug log in syslog
> (2) restart bluetoothd and verify msft_do_close() doesn't get invoked
> 
> Signed-off-by: Miao-chen Chou <mcchou@chromium.org>
> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> Reviewed-by: Archie Pusaka <apusaka@chromium.org>
> ---
> Hi Maintainers,
> 
> This patch fixes the life cycle of MSFT HCI extension. The current
> symmetric calls to msft_do{open,close} in hci_dev_do_{open,close} cause
> incorrect MSFT features during bluetoothd start-up. After the kernel
> powers on the controller to register the hci_dev, it performs
> hci_dev_do_close() which call msft_do_close() and MSFT data gets wiped
> out. And then during the startup of bluetoothd, Adv Monitor Manager
> relies on reading the MSFT features from the kernel to present the
> feature set of the controller to D-Bus clients. However, the power state
> of the controller is off during the init of D-Bus interfaces. As a
> result, invalid MSFT features are returned by the kernel, since it was
> previously wiped out due to hci_dev_do_close().

then just keep the values around and not wipe them. However I prefer still to keep the symmetry and re-read the value every time we init. We can make sure to release the msft_data on unregister.

Regards

Marcel


  parent reply	other threads:[~2021-01-26  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  0:38 [PATCH v3] Bluetooth: Keep MSFT ext info throughout ahci_dev's life cycle Miao-chen Chou
2021-01-22  2:43 ` [v3] " bluez.test.bot
2021-01-25 15:13 ` Marcel Holtmann [this message]
2021-01-25 22:18   ` [PATCH v3] " Miao-chen Chou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=070E7413-A3E3-4FEB-80BC-D3DD922DA19B@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=abhishekpandit@chromium.org \
    --cc=alainm@chromium.org \
    --cc=apusaka@chromium.org \
    --cc=davem@davemloft.net \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=mcchou@chromium.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.