Skip to content

Commit

Permalink
[PATCH] m68k: fix PIO case in esp
Browse files Browse the repository at this point in the history
we always set ->SCp.ptr to physical address of buffer; for DMA that's
just what we need, but we end up using it as virtual address in PIO
case of esp_do_data(), with obvious breakage as soon as memory mapping
becomes non-trivial.  The fix is obvious.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jan 12, 2006
1 parent ed1705a commit 3c9757b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/scsi/NCR53C9x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs)
*/
int oldphase, i = 0; /* or where we left off last time ?? esp->current_data ?? */
int fifocnt = 0;
unsigned char *p = phys_to_virt((unsigned long)SCptr->SCp.ptr);

oldphase = esp_read(eregs->esp_status) & ESP_STAT_PMASK;

Expand Down Expand Up @@ -1860,7 +1861,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs)

/* read fifo */
for(j=0;j<fifocnt;j++)
SCptr->SCp.ptr[i++] = esp_read(eregs->esp_fdata);
p[i++] = esp_read(eregs->esp_fdata);

ESPDATA(("(%d) ", i));

Expand All @@ -1882,7 +1883,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs)

/* fill fifo */
for(j=0;j<this_count;j++)
esp_write(eregs->esp_fdata, SCptr->SCp.ptr[i++]);
esp_write(eregs->esp_fdata, p[i++]);

/* how many left if this goes out ?? */
hmuch -= this_count;
Expand Down

0 comments on commit 3c9757b

Please sign in to comment.