Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24023
b: refs/heads/master
c: 6dc659d
h: refs/heads/master
i:
  24021: a43652e
  24019: 0d664c0
  24015: ac1c602
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Mar 26, 2006
1 parent d1cbd04 commit fdcf750
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 36ddf5bbdea7ba4582abc62f106f0f0e9f0b6b91
refs/heads/master: 6dc659d813fdd1789e605d69d0b8762d284e8c60
23 changes: 22 additions & 1 deletion trunk/drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ static int irqdma_allocated;
#include <linux/cdrom.h> /* for the compatibility eject ioctl */
#include <linux/completion.h>

/*
* Interrupt freeing also means /proc VFS work - dont do it
* from interrupt context. We push this work into keventd:
*/
static void fd_free_irq_fn(void *data)
{
fd_free_irq();
}

static DECLARE_WORK(fd_free_irq_work, fd_free_irq_fn, NULL);


static struct request *current_req;
static struct request_queue *floppy_queue;
static void do_fd_request(request_queue_t * q);
Expand Down Expand Up @@ -4433,6 +4445,13 @@ static int floppy_grab_irq_and_dma(void)
return 0;
}
spin_unlock_irqrestore(&floppy_usage_lock, flags);

/*
* We might have scheduled a free_irq(), wait it to
* drain first:
*/
flush_scheduled_work();

if (fd_request_irq()) {
DPRINT("Unable to grab IRQ%d for the floppy driver\n",
FLOPPY_IRQ);
Expand Down Expand Up @@ -4522,7 +4541,7 @@ static void floppy_release_irq_and_dma(void)
if (irqdma_allocated) {
fd_disable_dma();
fd_free_dma();
fd_free_irq();
schedule_work(&fd_free_irq_work);
irqdma_allocated = 0;
}
set_dor(0, ~0, 8);
Expand Down Expand Up @@ -4633,6 +4652,8 @@ void cleanup_module(void)
/* eject disk, if any */
fd_eject(0);

flush_scheduled_work(); /* fd_free_irq() might be pending */

wait_for_completion(&device_release);
}

Expand Down

0 comments on commit fdcf750

Please sign in to comment.