All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 5/7] Bluetooth: Add timer for automatically disabling the service cache
Date: Thu, 15 Dec 2011 00:12:20 +0100	[thread overview]
Message-ID: <1323904340.1965.72.camel@aeonflux> (raw)
In-Reply-To: <20111214222537.GA14468@x220.Elisa>

Hi Johan,

> > > -	if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->flags))
> > > +	if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->flags)) {
> > > +		hci_dev_unlock_bh(hdev);
> > > +		cancel_delayed_work_sync(&hdev->service_cache);
> > > +		hci_dev_lock_bh(hdev);
> > >  		update_eir(hdev);
> > > +	}
> > 
> > We have to be a bit careful here since essentially the service cache
> > (actually UUID cache to be precise) is a per mgmt socket feature and not
> > a per hdev feature.
> > 
> > I have nothing against merging this first, but keep in mind that this
> > needs to be updated since we can have two concurrent applications
> > opening a mgmt socket.
> 
> I understand. It does get a bit tricky though since the UUID list is per
> HCI device. I.e. do we keep our own list for each socket and hide it
> from struct hci_dev until the (per-socket) cache gets disabled?

that might be a good idea. Every mgmt socket should keep its list of
added UUIDs and then maybe just call an update function that runs over
all mgmt sockets and picks the union of it. If a socket closes, the list
gets flushed and we update again. That way we do not have to play global
reference counting tricks.

Regards

Marcel



  reply	other threads:[~2011-12-14 23:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 21:51 [PATCH 0/7] Update mgmt interface to latest specification johan.hedberg
2011-12-14 21:51 ` [PATCH 1/7] Bluetooth: Update mgmt_read_info and related mgmt messages johan.hedberg
2011-12-14 22:04   ` Marcel Holtmann
2011-12-15  9:02   ` Andrei Emeltchenko
2011-12-15  9:31     ` Johan Hedberg
2011-12-14 21:51 ` [PATCH 2/7] Bluetooth: Move mgmt_set_fast_connectable to the right location johan.hedberg
2011-12-14 22:06   ` Marcel Holtmann
2011-12-16  6:26   ` Hemant Gupta
2011-12-14 21:52 ` [PATCH 3/7] Bluetooth: Remove mgmt_set_service_cache johan.hedberg
2011-12-14 22:08   ` Marcel Holtmann
2011-12-14 21:52 ` [PATCH 4/7] Bluetooth: Move EIR and CoD update functions to a better position johan.hedberg
2011-12-14 22:09   ` Marcel Holtmann
2011-12-14 21:52 ` [PATCH 5/7] Bluetooth: Add timer for automatically disabling the service cache johan.hedberg
2011-12-14 22:16   ` Marcel Holtmann
2011-12-14 22:25     ` Johan Hedberg
2011-12-14 23:12       ` Marcel Holtmann [this message]
2011-12-14 21:52 ` [PATCH 6/7] Bluetooth: Update ordering and opcodes of mgmt messages johan.hedberg
2011-12-14 22:16   ` Marcel Holtmann
2011-12-14 21:52 ` [PATCH 7/7] Bluetooth: Use correct struct for user_confirm_neg_reply johan.hedberg
2011-12-14 22:17   ` Marcel Holtmann

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=1323904340.1965.72.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@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.