LKML Archive on
help / color / mirror / Atom feed
From: Marcel Holtmann <>
To: Jiri Kosina <>
Cc: Andrew Morton <>,,
Subject: Re: [PATCH] Bluetooth: postpone hci_dev unregistration
Date: Fri, 04 May 2007 08:41:53 +0200	[thread overview]
Message-ID: <1178260913.25425.27.camel@violet> (raw)
In-Reply-To: <>

Hi Jiri,

> (I sent this a week ago but it seems to have got lost in other noise, 
> resending)
> From: Jiri Kosina <>
> Bluetooth: postpone hci_dev unregistration
> Commit b40df57 substituted bh_lock_sock() in hci_sock_dev_event() for 
> lock_sock() when unregistering HCI device, in order to prevent deadlock 
> against locking in l2cap_connect_cfm() from softirq context.
> This however introduces another problem - hci_sock_dev_event() for 
> HCI_DEV_UNREG can also be triggered in atomic context, in which calling 
> lock_sock() is not safe as it could sleep. Reported by Jeremy Fitzhardinge 
> at
> This patch moves the detaching of sockets from hci_device into workqueue, 
> so that lock_sock() can be used safely. This requires movement of 
> deallocation of hci_dev - deallocating device just after 
> hci_unregister_dev() would be too soon, as it could happen before the 
> workqueue has been run.

I saw the report on LKML, but I am not really comfortable with this
approach. It feels like an ugly hack. This needs more thinking and I
think that simplifying the looking between HCI and L2CAP should be the



      reply	other threads:[~2007-05-04  6:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02  9:49 Jiri Kosina
2007-05-04  6:41 ` Marcel Holtmann [this message]

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:

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

  git send-email \
    --in-reply-to=1178260913.25425.27.camel@violet \ \ \ \ \ \
    --subject='Re: [PATCH] Bluetooth: postpone hci_dev unregistration' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).