[patch] couple of megaraid fixes

David Mosberger (davidm@napali.hpl.hp.com)
Wed, 9 Apr 2003 15:58:02 -0700


The attached patch has been in my tree for some time. IIRC, Grant
Grundler sent it to me. The old code is clearly broken: it still uses
virt_to_bus() and SCpnt->pid is declared as "unsigned long", so I'm
pretty sure this is an improvement. ;-)

--david

diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c Wed Apr 9 14:49:48 2003
+++ b/drivers/scsi/megaraid.c Wed Apr 9 14:49:48 2003
@@ -2045,7 +2045,7 @@
return;

mbox = (mega_mailbox *) pScb->mboxData;
- printk ("%u cmd:%x id:%x #scts:%x lba:%x addr:%x logdrv:%x #sg:%x\n",
+ printk ("%lu cmd:%x id:%x #scts:%x lba:%x addr:%x logdrv:%x #sg:%x\n",
pScb->SCpnt->pid,
mbox->cmd, mbox->cmdid, mbox->numsectors,
mbox->lba, mbox->xferaddr, mbox->logdrv, mbox->numsgelements);
@@ -3351,9 +3351,13 @@
mbox[0] = IS_BIOS_ENABLED;
mbox[2] = GET_BIOS;

- mboxpnt->xferaddr = virt_to_bus ((void *) megacfg->mega_buffer);
+ mboxpnt->xferaddr = pci_map_single(megacfg->dev,
+ (void *) megacfg->mega_buffer, (2 * 1024L),
+ PCI_DMA_FROMDEVICE);

ret = megaIssueCmd (megacfg, mbox, NULL, 0);
+
+ pci_unmap_single(megacfg->dev, mboxpnt->xferaddr, 2 * 1024L, PCI_DMA_FROMDEVICE);

return (*(char *) megacfg->mega_buffer);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/