summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorDwight Engen <dwight.engen@oracle.com>2014-12-11 18:25:42 +0100
committerDavid S. Miller <davem@davemloft.net>2014-12-12 03:51:57 +0100
commit31f4888f51afb038f7f8e7e4b3f0a80587c92c9b (patch)
tree148df67a71243bdb6be59ea14a504da3617d9efb /drivers/block
parentsparc32, leon: Align ccall_info to prevent unaligned traps on crosscall (diff)
downloadlinux-31f4888f51afb038f7f8e7e4b3f0a80587c92c9b.tar.xz
linux-31f4888f51afb038f7f8e7e4b3f0a80587c92c9b.zip
sunvdc: fix module unload/reload
Free resources allocated during port/disk probing so that the module may be successfully reloaded after unloading. Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/sunvdc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 0ebadf93b6c5..089ff9035de6 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -896,8 +896,19 @@ static int vdc_port_remove(struct vio_dev *vdev)
struct vdc_port *port = dev_get_drvdata(&vdev->dev);
if (port) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&port->vio.lock, flags);
+ blk_stop_queue(port->disk->queue);
+ spin_unlock_irqrestore(&port->vio.lock, flags);
+
del_timer_sync(&port->vio.timer);
+ del_gendisk(port->disk);
+ blk_cleanup_queue(port->disk->queue);
+ put_disk(port->disk);
+ port->disk = NULL;
+
vdc_free_tx_ring(port);
vio_ldc_free(&port->vio);