Merge branch 'for_3.8-rc1' into v4l_for_linus
[deliverable/linux.git] / drivers / scsi / megaraid / megaraid_sas_base.c
index 0393ec478cdf41257aebbf2e7e2cee7a244583eb..e4f2baacf1e1783ec9054bae3f7013afb5af0a5f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Linux MegaRAID driver for SAS based RAID controllers
  *
- *  Copyright (c) 2009-2011  LSI Corporation.
+ *  Copyright (c) 2003-2012  LSI Corporation.
  *
  *  This program is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU General Public License
@@ -18,7 +18,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  *  FILE: megaraid_sas_base.c
- *  Version : v00.00.06.18-rc1
+ *  Version : v06.504.01.00-rc1
  *
  *  Authors: LSI Corporation
  *           Sreenivas Bagalkote
@@ -71,6 +71,10 @@ static int msix_disable;
 module_param(msix_disable, int, S_IRUGO);
 MODULE_PARM_DESC(msix_disable, "Disable MSI-X interrupt handling. Default: 0");
 
+static unsigned int msix_vectors;
+module_param(msix_vectors, int, S_IRUGO);
+MODULE_PARM_DESC(msix_vectors, "MSI-X max vector count. Default: Set by FW");
+
 static int throttlequeuedepth = MEGASAS_THROTTLE_QUEUE_DEPTH;
 module_param(throttlequeuedepth, int, S_IRUGO);
 MODULE_PARM_DESC(throttlequeuedepth,
@@ -2056,9 +2060,9 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
                } else {
                        ev->instance = instance;
                        instance->ev = ev;
-                       INIT_WORK(&ev->hotplug_work, megasas_aen_polling);
-                       schedule_delayed_work(
-                               (struct delayed_work *)&ev->hotplug_work, 0);
+                       INIT_DELAYED_WORK(&ev->hotplug_work,
+                                         megasas_aen_polling);
+                       schedule_delayed_work(&ev->hotplug_work, 0);
                }
        }
 }
@@ -3520,6 +3524,10 @@ static int megasas_init_fw(struct megasas_instance *instance)
                        instance->msix_vectors = (readl(&instance->reg_set->
                                                        outbound_scratch_pad_2
                                                          ) & 0x1F) + 1;
+                       if (msix_vectors)
+                               instance->msix_vectors =
+                                       min(msix_vectors,
+                                           instance->msix_vectors);
                } else
                        instance->msix_vectors = 1;
                /* Don't bother allocating more MSI-X vectors than cpus */
@@ -4344,8 +4352,7 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)
        /* cancel the delayed work if this work still in queue */
        if (instance->ev != NULL) {
                struct megasas_aen_event *ev = instance->ev;
-               cancel_delayed_work_sync(
-                       (struct delayed_work *)&ev->hotplug_work);
+               cancel_delayed_work_sync(&ev->hotplug_work);
                instance->ev = NULL;
        }
 
@@ -4537,8 +4544,7 @@ static void __devexit megasas_detach_one(struct pci_dev *pdev)
        /* cancel the delayed work if this work still in queue*/
        if (instance->ev != NULL) {
                struct megasas_aen_event *ev = instance->ev;
-               cancel_delayed_work_sync(
-                       (struct delayed_work *)&ev->hotplug_work);
+               cancel_delayed_work_sync(&ev->hotplug_work);
                instance->ev = NULL;
        }
 
@@ -5182,7 +5188,7 @@ static void
 megasas_aen_polling(struct work_struct *work)
 {
        struct megasas_aen_event *ev =
-               container_of(work, struct megasas_aen_event, hotplug_work);
+               container_of(work, struct megasas_aen_event, hotplug_work.work);
        struct megasas_instance *instance = ev->instance;
        union megasas_evt_class_locale class_locale;
        struct  Scsi_Host *host;
@@ -5233,7 +5239,6 @@ megasas_aen_polling(struct work_struct *work)
 
                case MR_EVT_PD_REMOVED:
                        if (megasas_get_pd_list(instance) == 0) {
-                       megasas_get_pd_list(instance);
                        for (i = 0; i < MEGASAS_MAX_PD_CHANNELS; i++) {
                                for (j = 0;
                                j < MEGASAS_MAX_DEV_PER_CHANNEL;
This page took 0.028378 seconds and 5 git commands to generate.