diff options
author | Bjørn Mork <bjorn@mork.no> | 2012-04-30 09:26:11 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-31 00:43:41 +0100 |
commit | 0c68ab1b23871bbfa1bb7e792d476e9618a749c0 (patch) | |
tree | bcec4325ef6a6cd554fa9b20a2d0b88d4ad1a1c2 | |
parent | 26f15a29b18316e896973407efccebabbf8542f2 (diff) | |
download | lwn-0c68ab1b23871bbfa1bb7e792d476e9618a749c0.tar.gz lwn-0c68ab1b23871bbfa1bb7e792d476e9618a749c0.zip |
USB: cdc-wdm: add debug messages on cleanup
commit 880bca3a2a6f159d7453e0cbcbfe2f1d8204d907 upstream.
Device state cleanup is done in either wdm_disconnect or
wdm_release depending on the order they are called. Adding
a couple of debug messages to document the program flow.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 38d8c3333132..40a3f0b17d3c 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -588,10 +588,12 @@ static int wdm_release(struct inode *inode, struct file *file) if (!desc->count) { dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); kill_urbs(desc); - if (!test_bit(WDM_DISCONNECTING, &desc->flags)) + if (!test_bit(WDM_DISCONNECTING, &desc->flags)) { desc->intf->needs_remote_wakeup = 0; - else + } else { + dev_dbg(&desc->intf->dev, "%s: device gone - cleaning up\n", __func__); cleanup(desc); + } } mutex_unlock(&wdm_mutex); return 0; @@ -807,6 +809,8 @@ static void wdm_disconnect(struct usb_interface *intf) mutex_unlock(&desc->rlock); if (!desc->count) cleanup(desc); + else + dev_dbg(&intf->dev, "%s: %d open files - postponing cleanup\n", __func__, desc->count); mutex_unlock(&wdm_mutex); } |