diff options
author | Jan Beulich <jbeulich@novell.com> | 2007-10-17 02:27:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:55 -0400 |
commit | 2e9c47cd4d451c57868c898672802eec9867ae1e (patch) | |
tree | ac2d7169107c579086bcaa8731ca3d9812776e59 | |
parent | e98c3202916d30f0e6f59735801baa69bc3348ac (diff) |
floppy: tolerate DMA channel unavailability
The floppy driver is already written to be able to operate in virtual DMA
mode. Thus it can easily be adjusted to tolerate failure from
fd_request_dma() as long as virtual DMA mode is not disallowed.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/block/floppy.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 80483aac4cc9..72803a3585ff 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4388,11 +4388,15 @@ static int floppy_grab_irq_and_dma(void) | |||
4388 | if (fd_request_dma()) { | 4388 | if (fd_request_dma()) { |
4389 | DPRINT("Unable to grab DMA%d for the floppy driver\n", | 4389 | DPRINT("Unable to grab DMA%d for the floppy driver\n", |
4390 | FLOPPY_DMA); | 4390 | FLOPPY_DMA); |
4391 | fd_free_irq(); | 4391 | if (can_use_virtual_dma & 2) |
4392 | spin_lock_irqsave(&floppy_usage_lock, flags); | 4392 | use_virtual_dma = can_use_virtual_dma = 1; |
4393 | usage_count--; | 4393 | if (!(can_use_virtual_dma & 1)) { |
4394 | spin_unlock_irqrestore(&floppy_usage_lock, flags); | 4394 | fd_free_irq(); |
4395 | return -1; | 4395 | spin_lock_irqsave(&floppy_usage_lock, flags); |
4396 | usage_count--; | ||
4397 | spin_unlock_irqrestore(&floppy_usage_lock, flags); | ||
4398 | return -1; | ||
4399 | } | ||
4396 | } | 4400 | } |
4397 | 4401 | ||
4398 | for (fdc = 0; fdc < N_FDC; fdc++) { | 4402 | for (fdc = 0; fdc < N_FDC; fdc++) { |