Commit 4f6101d7 authored by Nathan Dabney's avatar Nathan Dabney Committed by Linus Torvalds

[PATCH] MegaRAID - compile fix for 2.5.9

  This fixes compile errors.  It has been tested with a weekend of Bonnie++ 8GB
runs on a RAID0 setup at the OSDL.  This was built against and tested on 2.5.8
and applies cleanly to 2.5.9.

  LSI told me they have a version 2.0 of the driver in development but
it would be really nice to have the dang thing working now ;-)
parent 9e13714a
...@@ -526,6 +526,7 @@ ...@@ -526,6 +526,7 @@
#include "sd.h" #include "sd.h"
#include "scsi.h" #include "scsi.h"
#include "hosts.h" #include "hosts.h"
#include <scsi/scsicam.h>
#include "megaraid.h" #include "megaraid.h"
...@@ -1107,10 +1108,11 @@ static void mega_cmd_done (mega_host_config * megaCfg, mega_scb * pScb, int stat ...@@ -1107,10 +1108,11 @@ static void mega_cmd_done (mega_host_config * megaCfg, mega_scb * pScb, int stat
status = 0xF0; status = 0xF0;
} }
#endif #endif
if (SCpnt->cmnd[0] == INQUIRY && !islogical) { if (SCpnt->cmnd[0] == INQUIRY && !islogical) {
if ( SCpnt->use_sg ) { if ( SCpnt->use_sg ) {
sgList = (struct scatterlist *)SCpnt->request_buffer; sgList = (struct scatterlist *)SCpnt->request_buffer;
memcpy(&c, sgList[0].address, 0x1); memcpy(&c, cpu_to_le32(sg_dma_address(&sgList[0])), 0x1);
} else { } else {
memcpy(&c, SCpnt->request_buffer, 0x1); memcpy(&c, SCpnt->request_buffer, 0x1);
} }
...@@ -4557,9 +4559,11 @@ static int megadev_ioctl (struct inode *inode, struct file *filep, ...@@ -4557,9 +4559,11 @@ static int megadev_ioctl (struct inode *inode, struct file *filep,
#endif #endif
IO_LOCK_T; IO_LOCK_T;
if (!inode || !(dev = inode->i_rdev)) if (!inode)
return -EINVAL; return -EINVAL;
dev = inode->i_rdev;
if (_IOC_TYPE (cmd) != MEGAIOC_MAGIC) if (_IOC_TYPE (cmd) != MEGAIOC_MAGIC)
return (-EINVAL); return (-EINVAL);
...@@ -5104,16 +5108,16 @@ mega_del_logdrv(mega_host_config *this_hba, int logdrv) ...@@ -5104,16 +5108,16 @@ mega_del_logdrv(mega_host_config *this_hba, int logdrv)
* Stop sending commands to the controller, queue them internally. * Stop sending commands to the controller, queue them internally.
* When deletion is complete, ISR will flush the queue. * When deletion is complete, ISR will flush the queue.
*/ */
IO_LOCK; IO_LOCK(this_hba->host);
this_hba->quiescent = 1; this_hba->quiescent = 1;
IO_UNLOCK; IO_UNLOCK(this_hba->host);
while( this_hba->qPcnt ) { while( this_hba->qPcnt ) {
sleep_on_timeout( &wq, 1*HZ ); /* sleep for 1s */ sleep_on_timeout( &wq, 1*HZ ); /* sleep for 1s */
} }
rval = mega_do_del_logdrv(this_hba, logdrv); rval = mega_do_del_logdrv(this_hba, logdrv);
IO_LOCK; IO_LOCK(this_hba->host);
/* /*
* Attach the internal queue to the pending queue * Attach the internal queue to the pending queue
*/ */
...@@ -5158,7 +5162,7 @@ mega_del_logdrv(mega_host_config *this_hba, int logdrv) ...@@ -5158,7 +5162,7 @@ mega_del_logdrv(mega_host_config *this_hba, int logdrv)
} }
this_hba->quiescent = 0; this_hba->quiescent = 0;
IO_UNLOCK; IO_UNLOCK(this_hba->host);
return rval; return rval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment