Use unchecked_isa_dma in sd_revalidate_disk()
PATCH 25/28 Use unchecked_isa_dma in sd_revalidate_disk()
From: Bernhard Walle <[email protected]>
In sd_revalidate_disk(), the SCSI Disk driver needs a few bytes DMA memory, allocated by kmalloc() and __GFP_DMA. This patch uses __GFP_DMA only if the corresponding host structure has unchecked_isa_dma set.
Signed-off-by Bernhard Walle <[email protected]>
Cc James Bottomley <[email protected]>
Acked-by Jens Axboe <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/sd.c renamed from drivers/scsi/sd.c~use-unchecked_isa_dma-in-sd_revalidate_disk +2 -1
@@ -1516,7 +1516,8 @@ static int sd_revalidate_disk(struct genif (!scsi_device_online (sdp)) goto out; - buffer =kmalloc (SD_BUF_SIZE ,GFP_KERNEL | __GFP_DMA); + buffer =kmalloc (SD_BUF_SIZE ,GFP_KERNEL | + (sdp->host->unchecked_isa_dma ? __GFP_DMA :0 ));if (!buffer) {sd_printk (KERN_WARNING , sdkp,"sd_revalidate_disk: Memory " "allocation failure.\n" );
_