info->dma = 0;
/* sg request */
- if (rq->bio) {
- int mask = drive->queue->dma_alignment;
- unsigned long addr =
- (unsigned long)page_address(bio_page(rq->bio));
+ if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) {
+ struct request_queue *q = drive->queue;
+ unsigned int alignment;
+ unsigned long addr;
unsigned long stack_mask = ~(THREAD_SIZE - 1);
+ if (rq->bio)
+ addr = (unsigned long)bio_data(rq->bio);
+ else
+ addr = (unsigned long)rq->data;
+
info->dma = drive->using_dma;
/*
* NOTE! The "len" and "addr" checks should possibly have
* separate masks.
*/
- if ((rq->data_len & 15) || (addr & mask))
+ alignment = queue_dma_alignment(q) | q->dma_pad_mask;
+ if (addr & alignment || rq->data_len & alignment)
info->dma = 0;
if (!((addr & stack_mask) ^
blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
blk_queue_dma_alignment(drive->queue, 31);
+ blk_queue_update_dma_pad(drive->queue, 15);
drive->queue->unplug_delay = (1 * HZ) / 1000;
if (!drive->queue->unplug_delay)
drive->queue->unplug_delay = 1;