From: Jan Beulich Date: Wed, 17 Oct 2007 06:27:32 +0000 (-0700) Subject: floppy: tolerate DMA channel unavailability X-Git-Tag: v2.6.24-rc1~660 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2e9c47cd4d451c57868c898672802eec9867ae1e;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 80483aac4cc..72803a3585f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4388,11 +4388,15 @@ static int floppy_grab_irq_and_dma(void) if (fd_request_dma()) { DPRINT("Unable to grab DMA%d for the floppy driver\n", FLOPPY_DMA); - fd_free_irq(); - spin_lock_irqsave(&floppy_usage_lock, flags); - usage_count--; - spin_unlock_irqrestore(&floppy_usage_lock, flags); - return -1; + if (can_use_virtual_dma & 2) + use_virtual_dma = can_use_virtual_dma = 1; + if (!(can_use_virtual_dma & 1)) { + fd_free_irq(); + 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++) {