Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29331
b: refs/heads/master
c: 91b8b31
h: refs/heads/master
i:
  29329: fa8dd80
  29327: 9cdeb45
v: v3
  • Loading branch information
Albert Lee authored and Jeff Garzik committed Oct 9, 2005
1 parent 20f5233 commit e233e4c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 083958d313f886dc7d00522f2972f90f55c40041
refs/heads/master: 91b8b3132e1870bfe3c4d3a999f13f20fc4e9726
40 changes: 26 additions & 14 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,6 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
struct page *page;
unsigned int offset;
unsigned char *buf;
unsigned long flags;

if (qc->cursect == (qc->nsect - 1))
ap->hsm_task_state = HSM_ST_LAST;
Expand All @@ -2762,14 +2761,21 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)

DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");

local_irq_save(flags);
buf = kmap_atomic(page, KM_IRQ0);
if (PageHighMem(page)) {
unsigned long flags;

local_irq_save(flags);
buf = kmap_atomic(page, KM_IRQ0);

/* do the actual data transfer */
ata_data_xfer(ap, buf + offset, ATA_SECT_SIZE, do_write);
/* do the actual data transfer */
ata_data_xfer(ap, buf + offset, ATA_SECT_SIZE, do_write);

kunmap_atomic(buf, KM_IRQ0);
local_irq_restore(flags);
kunmap_atomic(buf, KM_IRQ0);
local_irq_restore(flags);
} else {
buf = page_address(page);
ata_data_xfer(ap, buf + offset, ATA_SECT_SIZE, do_write);
}

qc->cursect++;
qc->cursg_ofs++;
Expand Down Expand Up @@ -2908,7 +2914,6 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
struct page *page;
unsigned char *buf;
unsigned int offset, count;
unsigned long flags;

if (qc->curbytes + bytes >= qc->nbytes)
ap->hsm_task_state = HSM_ST_LAST;
Expand Down Expand Up @@ -2954,14 +2959,21 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)

DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");

local_irq_save(flags);
buf = kmap_atomic(page, KM_IRQ0);
if (PageHighMem(page)) {
unsigned long flags;

local_irq_save(flags);
buf = kmap_atomic(page, KM_IRQ0);

/* do the actual data transfer */
ata_data_xfer(ap, buf + offset, count, do_write);
/* do the actual data transfer */
ata_data_xfer(ap, buf + offset, count, do_write);

kunmap_atomic(buf, KM_IRQ0);
local_irq_restore(flags);
kunmap_atomic(buf, KM_IRQ0);
local_irq_restore(flags);
} else {
buf = page_address(page);
ata_data_xfer(ap, buf + offset, count, do_write);
}

bytes -= count;
qc->curbytes += count;
Expand Down

0 comments on commit e233e4c

Please sign in to comment.