From: Al Viro Date: Thu, 12 Jan 2006 09:06:40 +0000 (-0800) Subject: [PATCH] m68k: fix PIO case in esp X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~55148 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3c9757b7c28161e073e7f408978b7ed01925924c;p=mirror_ubuntu-focal-kernel.git [PATCH] m68k: fix PIO case in esp 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 Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c index 640590bd014a..c7dd0154d012 100644 --- a/drivers/scsi/NCR53C9x.c +++ b/drivers/scsi/NCR53C9x.c @@ -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; @@ -1860,7 +1861,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs) /* read fifo */ for(j=0;jSCp.ptr[i++] = esp_read(eregs->esp_fdata); + p[i++] = esp_read(eregs->esp_fdata); ESPDATA(("(%d) ", i)); @@ -1882,7 +1883,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs) /* fill fifo */ for(j=0;jesp_fdata, SCptr->SCp.ptr[i++]); + esp_write(eregs->esp_fdata, p[i++]); /* how many left if this goes out ?? */ hmuch -= this_count;