Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created June 6, 2013 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donpdonp/5722900 to your computer and use it in GitHub Desktop.
Save donpdonp/5722900 to your computer and use it in GitHub Desktop.
update mptlinux / fusion / lsi kernel driver for kernel 3.8+
diff --git a/mptbase.c b/mptbase.c
index ab78d62..a6a93cb 100755
--- a/mptbase.c
+++ b/mptbase.c
@@ -359,7 +359,7 @@ static int mpt_remove_dead_ioc_func(void *arg)
if ((pdev == NULL))
return -1;
- pci_remove_bus_device(pdev);
+ pci_stop_and_remove_bus_device(pdev);
return 0;
}
@@ -2645,7 +2645,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
/*
* Initalize link list for inactive raid volumes.
*/
- init_MUTEX(&ioc->raid_data.inactive_list_mutex);
+ sema_init(&ioc->raid_data.inactive_list_mutex, 1);
INIT_LIST_HEAD(&ioc->raid_data.inactive_list);
switch (ioc->bus_type) {
diff --git a/mptctl.c b/mptctl.c
index 54121a9..163787e 100755
--- a/mptctl.c
+++ b/mptctl.c
@@ -55,7 +55,6 @@
#include <linux/pci.h>
#include <linux/delay.h> /* for mdelay */
#include <linux/miscdevice.h>
-#include <linux/smp_lock.h>
#include <linux/compat.h>
#include <asm/io.h>
@@ -807,9 +806,10 @@ static long
mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
long ret;
- lock_kernel();
+ DEFINE_MUTEX(nobkl);
+ mutex_lock(&nobkl);
ret = __mptctl_ioctl(file, cmd, arg);
- unlock_kernel();
+ mutex_unlock(&nobkl);;
return ret;
}
@@ -3002,7 +3002,8 @@ compat_mpt_command(struct file *filp, unsigned int cmd,
static long compat_mpctl_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
{
long ret;
- lock_kernel();
+ DEFINE_MUTEX(nobkl);
+ mutex_lock(&nobkl);
switch (cmd) {
case MPTIOCINFO:
case MPTIOCINFO1:
@@ -3052,7 +3053,7 @@ static long compat_mpctl_ioctl(struct file *f, unsigned int cmd, unsigned long a
ret = -ENOIOCTLCMD;
break;
}
- unlock_kernel();
+ mutex_unlock(&nobkl);;
return ret;
}
diff --git a/mptfc.c b/mptfc.c
index a803ec4..d32513e 100755
--- a/mptfc.c
+++ b/mptfc.c
@@ -112,7 +112,7 @@ static int mptfc_qcmd(struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *));
static void mptfc_target_destroy(struct scsi_target *starget);
static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
-static void __devexit mptfc_remove(struct pci_dev *pdev);
+static void mptfc_remove(struct pci_dev *pdev);
static int mptfc_abort(struct scsi_cmnd *SCpnt);
static int mptfc_dev_reset(struct scsi_cmnd *SCpnt);
static int mptfc_bus_reset(struct scsi_cmnd *SCpnt);
@@ -1439,7 +1439,7 @@ static struct pci_driver mptfc_driver = {
.name = "mptfc",
.id_table = mptfc_pci_table,
.probe = mptfc_probe,
- .remove = __devexit_p(mptfc_remove),
+ .remove = mptfc_remove,
.shutdown = mptscsih_shutdown,
#ifdef CONFIG_PM
.suspend = mptscsih_suspend,
@@ -1571,7 +1571,7 @@ mptfc_init(void)
* @pdev: Pointer to pci_dev structure
*
**/
-static void __devexit
+static void
mptfc_remove(struct pci_dev *pdev)
{
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
diff --git a/mptsas.c b/mptsas.c
index df8f418..77e92d5 100755
--- a/mptsas.c
+++ b/mptsas.c
@@ -6132,7 +6132,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
INIT_LIST_HEAD(&hd->target_reset_list);
INIT_LIST_HEAD(&ioc->sas_device_info_list);
- init_MUTEX(&ioc->sas_device_info_mutex);
+ sema_init(&ioc->sas_device_info_mutex, 1);
spin_unlock_irqrestore(&ioc->FreeQlock, flags);
@@ -6176,7 +6176,7 @@ mptsas_shutdown(struct pci_dev *pdev)
* @pdev:
*
**/
-static void __devexit
+static void
mptsas_remove(struct pci_dev *pdev)
{
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
@@ -6229,7 +6229,7 @@ static struct pci_driver mptsas_driver = {
.name = "mptsas",
.id_table = mptsas_pci_table,
.probe = mptsas_probe,
- .remove = __devexit_p(mptsas_remove),
+ .remove = mptsas_remove,
.shutdown = mptsas_shutdown,
#ifdef CONFIG_PM
.suspend = mptscsih_suspend,
diff --git a/mptspi.c b/mptspi.c
index 925fa8d..a4cb19f 100755
--- a/mptspi.c
+++ b/mptspi.c
@@ -1516,7 +1516,7 @@ static struct pci_driver mptspi_driver = {
.name = "mptspi",
.id_table = mptspi_pci_table,
.probe = mptspi_probe,
- .remove = __devexit_p(mptscsih_remove),
+ .remove = mptscsih_remove,
.shutdown = mptscsih_shutdown,
#ifdef CONFIG_PM
.suspend = mptscsih_suspend,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment