linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: David Herrmann <dh.herrmann@googlemail.com>
Cc: linux-bluetooth@vger.kernel.org, padovan@profusion.mobi
Subject: Re: [PATCH 00/18] Cleanup HCI reference counts
Date: Sun, 08 Jan 2012 23:54:11 -0800	[thread overview]
Message-ID: <1326095651.6454.140.camel@aeonflux> (raw)
In-Reply-To: <1325947644-11736-1-git-send-email-dh.herrmann@googlemail.com>

Hi David,

> This is the same as my previous patchset but split into sequential patches. The
> first patch makes the destruct-cb optional so the patches 2-7 can remove the
> empty callbacks.
> Patches 8-14 make the remaining drivers drop the destruct-callback and directly
> free the driver data.
> Patches 15-18 then remove the (now unused!) destruct callback and then properly
> fixes the reference counts (same patches as already posted).
> 
> I hope the first 14 patches make clear that half of our drivers already work
> without the destruct callback and the other half can be safely converted into
> not using it. In fact, the drivers that use it introduce some memleaks which are
> fixed by simply dropping the callback and freeing everything right away.
> 
> I've added detailed commit messages to each driver. If a single step is unclear,
> please point me to it.
> 
> 
> By the way, this fixes several bugs we currently have, including some mem-leaks
> as described in the commits and the fact that hci_free_dev() currently
> *directly* destroys the hci object regardless of any previous calls to
> hci_hold_dev/hci_put_dev(). This is because the hci->refcnt counter is in no way
> linked to the lifetime of the hci object. See hci_sysfs the release_host
> callback which actually frees the hci object. It is in no way triggered by
> hci->refcnt.
> This patchset fixes all this and introduces proper reference counting.

I went through the patches again and after thinking about it for a bit,
this all looks good.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Johan, feel free to include this patchset into your tree.

Regards

Marcel



  parent reply	other threads:[~2012-01-09  7:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07 14:47 [PATCH 00/18] Cleanup HCI reference counts David Herrmann
2012-01-07 14:47 ` [PATCH 01/18] Bluetooth: Make hci-destruct callback optional David Herrmann
2012-01-07 14:47 ` [PATCH 02/18] Bluetooth: bluecard-cs: Remove empty destruct cb David Herrmann
2012-01-07 14:47 ` [PATCH 03/18] Bluetooth: bt3c-cs: " David Herrmann
2012-01-07 14:47 ` [PATCH 04/18] Bluetooth: btmrvl: " David Herrmann
2012-01-07 14:47 ` [PATCH 05/18] Bluetooth: btuart-cs: " David Herrmann
2012-01-07 14:47 ` [PATCH 06/18] Bluetooth: btwilink: " David Herrmann
2012-01-07 14:47 ` [PATCH 07/18] Bluetooth: dtl1-cs: " David Herrmann
2012-01-07 14:47 ` [PATCH 08/18] Bluetooth: vhci: Free driver_data on file release David Herrmann
2012-01-07 14:47 ` [PATCH 09/18] Bluetooth: bfusb: Free driver_data on USB shutdown David Herrmann
2012-01-07 14:47 ` [PATCH 10/18] Bluetooth: btusb: Free driver data " David Herrmann
2012-01-07 14:47 ` [PATCH 11/18] Bluetooth: bpa10x: Free private driver data on usb shutdown David Herrmann
2012-01-07 14:47 ` [PATCH 12/18] Bluetooth: btsdio: Free driver data on SDIO shutdown David Herrmann
2012-01-07 14:47 ` [PATCH 13/18] Bluetooth: uart-ldisc: Fix memory leak and remove destruct cb David Herrmann
2012-01-07 14:47 ` [PATCH 14/18] Bluetooth: Remove unused hci-destruct cb David Herrmann
2012-01-07 14:47 ` [PATCH 15/18] Bluetooth: Correctly acquire module ref David Herrmann
2012-01-07 14:47 ` [PATCH 16/18] Bluetooth: Remove HCI-owner field David Herrmann
2012-01-07 14:47 ` [PATCH 17/18] Bluetooth: Correctly take hci_dev->dev refcount David Herrmann
2012-01-07 14:47 ` [PATCH 18/18] Bluetooth: Remove __hci_dev_put/hold David Herrmann
2012-01-09  7:54 ` Marcel Holtmann [this message]
2012-01-09 11:44 ` [PATCH 00/18] Cleanup HCI reference counts Johan Hedberg

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=1326095651.6454.140.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=dh.herrmann@googlemail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=padovan@profusion.mobi \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).