aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 239557f8920e..accb53b85ba7 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1164,13 +1164,12 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
1164 if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) { 1164 if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) {
1165 struct request_queue *q = drive->queue; 1165 struct request_queue *q = drive->queue;
1166 unsigned int alignment; 1166 unsigned int alignment;
1167 unsigned long addr; 1167 char *buf;
1168 unsigned long stack_mask = ~(THREAD_SIZE - 1);
1169 1168
1170 if (rq->bio) 1169 if (rq->bio)
1171 addr = (unsigned long)bio_data(rq->bio); 1170 buf = bio_data(rq->bio);
1172 else 1171 else
1173 addr = (unsigned long)rq->data; 1172 buf = rq->data;
1174 1173
1175 info->dma = drive->using_dma; 1174 info->dma = drive->using_dma;
1176 1175
@@ -1181,11 +1180,8 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
1181 * separate masks. 1180 * separate masks.
1182 */ 1181 */
1183 alignment = queue_dma_alignment(q) | q->dma_pad_mask; 1182 alignment = queue_dma_alignment(q) | q->dma_pad_mask;
1184 if (addr & alignment || rq->data_len & alignment) 1183 if ((unsigned long)buf & alignment || rq->data_len & alignment
1185 info->dma = 0; 1184 || object_is_on_stack(buf))
1186
1187 if (!((addr & stack_mask) ^
1188 ((unsigned long)current->stack & stack_mask)))
1189 info->dma = 0; 1185 info->dma = 0;
1190 } 1186 }
1191} 1187}