Re: [Linux-ia64] [PATCH] fix casting problem in megaraid driver

From: David Mosberger <>
Date: 2000-09-06 12:30:08
Hi Andrew,

>>>>> On Tue, 5 Sep 2000 10:50:38 -0700, said:

  Andrew> This patch fixes bug where mbox's pointer was cast to
  Andrew> integer, caused segfault.

The patch looks a bit suspicious to me.  I'm not familiar with the
megaraid driver, but looking at the relevant code, it's clear that
"paddr" really is a 32 bit PCI address (it gets written to the device
as a sequence of four byte writes), so changing it to u64 clearly
isn't 100% correct.

Now, looking at the code that calls the routine in question:

 mega_register_mailbox (megaCfg, virt_to_bus ((void *) &megaCfg->mailbox64));

we find that, yuck, this is another driver that hasn't been updated
for the PCI DMA interface.  Not much point in hacking around in this
driver until this gets rectified...

Note that the virt_to_bus() and bus_to_virt() macros have been
obsoleted by the PCI DMA interface and will be removed from the kernel
at some future point (I'm tempted to do this now so we'll discover
right away which drivers need cleaning up).

Can you ask the megaraid maintainers to update their driver to use the
PCI DMA interface?

Received on Tue Sep 05 18:30:14 2000

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:19:59 EST