public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] couple of megaraid fixes
@ 2003-04-09 22:58 David Mosberger
  2003-04-10  6:20 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: David Mosberger @ 2003-04-09 22:58 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

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);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] couple of megaraid fixes
  2003-04-09 22:58 [patch] couple of megaraid fixes David Mosberger
@ 2003-04-10  6:20 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2003-04-10  6:20 UTC (permalink / raw)
  To: davidm; +Cc: torvalds, linux-kernel

On Wed, Apr 09, 2003 at 03:58:02PM -0700, David Mosberger wrote:
> 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. ;-)

Looks okay, but I really wonder where the promised complete rewrite
(megaraid2) is stuck..


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-10  6:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-09 22:58 [patch] couple of megaraid fixes David Mosberger
2003-04-10  6:20 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox