Commit 2e9c47cd authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

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: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e98c3202
...@@ -4388,11 +4388,15 @@ static int floppy_grab_irq_and_dma(void) ...@@ -4388,11 +4388,15 @@ static int floppy_grab_irq_and_dma(void)
if (fd_request_dma()) { if (fd_request_dma()) {
DPRINT("Unable to grab DMA%d for the floppy driver\n", DPRINT("Unable to grab DMA%d for the floppy driver\n",
FLOPPY_DMA); FLOPPY_DMA);
fd_free_irq(); if (can_use_virtual_dma & 2)
spin_lock_irqsave(&floppy_usage_lock, flags); use_virtual_dma = can_use_virtual_dma = 1;
usage_count--; if (!(can_use_virtual_dma & 1)) {
spin_unlock_irqrestore(&floppy_usage_lock, flags); fd_free_irq();
return -1; spin_lock_irqsave(&floppy_usage_lock, flags);
usage_count--;
spin_unlock_irqrestore(&floppy_usage_lock, flags);
return -1;
}
} }
for (fdc = 0; fdc < N_FDC; fdc++) { for (fdc = 0; fdc < N_FDC; fdc++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment