diff options
-rw-r--r-- | drivers/scsi/ide-scsi.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index d80c4c9d5a63..83f062ed9082 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -179,8 +179,18 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne | |||
179 | return; | 179 | return; |
180 | } | 180 | } |
181 | count = min(pc->sg->length - pc->b_count, bcount); | 181 | count = min(pc->sg->length - pc->b_count, bcount); |
182 | buf = page_address(pc->sg->page) + pc->sg->offset; | 182 | if (PageHighMem(pc->sg->page)) { |
183 | drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); | 183 | unsigned long flags; |
184 | |||
185 | local_irq_save(flags); | ||
186 | buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset; | ||
187 | drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); | ||
188 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | ||
189 | local_irq_restore(flags); | ||
190 | } else { | ||
191 | buf = page_address(pc->sg->page) + pc->sg->offset; | ||
192 | drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); | ||
193 | } | ||
184 | bcount -= count; pc->b_count += count; | 194 | bcount -= count; pc->b_count += count; |
185 | if (pc->b_count == pc->sg->length) { | 195 | if (pc->b_count == pc->sg->length) { |
186 | pc->sg++; | 196 | pc->sg++; |
@@ -201,8 +211,18 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign | |||
201 | return; | 211 | return; |
202 | } | 212 | } |
203 | count = min(pc->sg->length - pc->b_count, bcount); | 213 | count = min(pc->sg->length - pc->b_count, bcount); |
204 | buf = page_address(pc->sg->page) + pc->sg->offset; | 214 | if (PageHighMem(pc->sg->page)) { |
205 | drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); | 215 | unsigned long flags; |
216 | |||
217 | local_irq_save(flags); | ||
218 | buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset; | ||
219 | drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); | ||
220 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | ||
221 | local_irq_restore(flags); | ||
222 | } else { | ||
223 | buf = page_address(pc->sg->page) + pc->sg->offset; | ||
224 | drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); | ||
225 | } | ||
206 | bcount -= count; pc->b_count += count; | 226 | bcount -= count; pc->b_count += count; |
207 | if (pc->b_count == pc->sg->length) { | 227 | if (pc->b_count == pc->sg->length) { |
208 | pc->sg++; | 228 | pc->sg++; |