Merge SCSI misc branch into isci-for-3.6 tag
authorJames Bottomley <JBottomley@Parallels.com>
Tue, 2 Oct 2012 07:55:12 +0000 (08:55 +0100)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 2 Oct 2012 07:55:12 +0000 (08:55 +0100)
1  2 
MAINTAINERS
drivers/ata/libata-core.c
drivers/scsi/isci/host.c
drivers/scsi/isci/init.c
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_scan.c
include/linux/pci_ids.h

diff --combined MAINTAINERS
index fdc0119963e70f12c4f9e1eae3a613447e7d8781,58dabb0fad61965fb9a58ece929f2c02ad81642a..efffdb4c711816cd387c70ee5e3803c9dab910a1
@@@ -1645,7 -1645,6 +1645,6 @@@ F:      drivers/bcma
  F:    include/linux/bcma/
  
  BROCADE BFA FC SCSI DRIVER
- M:    Jing Huang <huangj@brocade.com>
  M:    Krishna C Gudipati <kgudipat@brocade.com>
  L:    linux-scsi@vger.kernel.org
  S:    Supported
@@@ -2217,7 -2216,7 +2216,7 @@@ S:      Maintaine
  F:    drivers/scsi/tmscsim.*
  
  DC395x SCSI driver
 -M:    Oliver Neukum <oliver@neukum.name>
 +M:    Oliver Neukum <oliver@neukum.org>
  M:    Ali Akcaagac <aliakc@web.de>
  M:    Jamie Lenehan <lenehan@twibble.org>
  W:    http://twibble.org/dist/dc395x/
@@@ -3431,6 -3430,13 +3430,13 @@@ L:    netdev@vger.kernel.or
  S:    Supported
  F:    drivers/net/ethernet/ibm/ibmveth.*
  
+ IBM Power Virtual SCSI/FC Device Drivers
+ M:    Robert Jennings <rcj@linux.vnet.ibm.com>
+ L:    linux-scsi@vger.kernel.org
+ S:    Supported
+ F:    drivers/scsi/ibmvscsi/
+ X:    drivers/scsi/ibmvscsi/ibmvstgt.c
  IBM ServeRAID RAID DRIVER
  P:    Jack Hammer
  M:    Dave Jeffery <ipslinux@adaptec.com>
@@@ -4537,7 -4543,7 +4543,7 @@@ S:      Supporte
  F:    arch/microblaze/
  
  MICROTEK X6 SCANNER
 -M:    Oliver Neukum <oliver@neukum.name>
 +M:    Oliver Neukum <oliver@neukum.org>
  S:    Maintained
  F:    drivers/usb/image/microtek.*
  
@@@ -7076,7 -7082,7 +7082,7 @@@ F:      include/linux/mtd/ubi.
  F:    include/mtd/ubi-user.h
  
  USB ACM DRIVER
 -M:    Oliver Neukum <oliver@neukum.name>
 +M:    Oliver Neukum <oliver@neukum.org>
  L:    linux-usb@vger.kernel.org
  S:    Maintained
  F:    Documentation/usb/acm.txt
@@@ -7097,7 -7103,7 +7103,7 @@@ S:      Supporte
  F:    drivers/block/ub.c
  
  USB CDC ETHERNET DRIVER
 -M:    Oliver Neukum <oliver@neukum.name>
 +M:    Oliver Neukum <oliver@neukum.org>
  L:    linux-usb@vger.kernel.org
  S:    Maintained
  F:    drivers/net/usb/cdc_*.c
@@@ -7170,7 -7176,7 +7176,7 @@@ F:      drivers/usb/host/isp116x
  F:    include/linux/usb/isp116x.h
  
  USB KAWASAKI LSI DRIVER
 -M:    Oliver Neukum <oliver@neukum.name>
 +M:    Oliver Neukum <oliver@neukum.org>
  L:    linux-usb@vger.kernel.org
  S:    Maintained
  F:    drivers/usb/serial/kl5kusb105.*
@@@ -7288,12 -7294,6 +7294,12 @@@ W:    http://www.connecttech.co
  S:    Supported
  F:    drivers/usb/serial/whiteheat*
  
 +USB SMSC75XX ETHERNET DRIVER
 +M:    Steve Glendinning <steve.glendinning@shawell.net>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    drivers/net/usb/smsc75xx.*
 +
  USB SMSC95XX ETHERNET DRIVER
  M:    Steve Glendinning <steve.glendinning@shawell.net>
  L:    netdev@vger.kernel.org
@@@ -7676,28 -7676,23 +7682,28 @@@ S:   Supporte
  F:    Documentation/hwmon/wm83??
  F:    arch/arm/mach-s3c64xx/mach-crag6410*
  F:    drivers/clk/clk-wm83*.c
 +F:    drivers/extcon/extcon-arizona.c
  F:    drivers/leds/leds-wm83*.c
  F:    drivers/gpio/gpio-*wm*.c
 +F:    drivers/gpio/gpio-arizona.c
  F:    drivers/hwmon/wm83??-hwmon.c
  F:    drivers/input/misc/wm831x-on.c
  F:    drivers/input/touchscreen/wm831x-ts.c
  F:    drivers/input/touchscreen/wm97*.c
 -F:    drivers/mfd/wm8*.c
 +F:    drivers/mfd/arizona*
 +F:    drivers/mfd/wm*.c
  F:    drivers/power/wm83*.c
  F:    drivers/rtc/rtc-wm83*.c
  F:    drivers/regulator/wm8*.c
  F:    drivers/video/backlight/wm83*_bl.c
  F:    drivers/watchdog/wm83*_wdt.c
 +F:    include/linux/mfd/arizona/
  F:    include/linux/mfd/wm831x/
  F:    include/linux/mfd/wm8350/
  F:    include/linux/mfd/wm8400*
  F:    include/linux/wm97xx.h
  F:    include/sound/wm????.h
 +F:    sound/soc/codecs/arizona.?
  F:    sound/soc/codecs/wm*
  
  WORKQUEUE
index 8e1039c8e15975aced4e6a359dc4a0451a58bc4b,2d479b67d0b43c80c80fc826aa4649956159fc64..abd729fc094ad2985a319c90551a936ff98756b0
@@@ -4062,7 -4062,7 +4062,7 @@@ static const struct ata_blacklist_entr
        { "_NEC DV5800A",       NULL,           ATA_HORKAGE_NODMA },
        { "SAMSUNG CD-ROM SN-124", "N001",      ATA_HORKAGE_NODMA },
        { "Seagate STT20000A", NULL,            ATA_HORKAGE_NODMA },
 -      { "2GB ATA Flash Disk", "ADMA428M",     ATA_HORKAGE_NODMA },
 +      { " 2GB ATA Flash Disk", "ADMA428M",    ATA_HORKAGE_NODMA },
        /* Odd clown on sil3726/4726 PMPs */
        { "Config  Disk",       NULL,           ATA_HORKAGE_DISABLE },
  
  
        /* Devices that do not need bridging limits applied */
        { "MTRON MSP-SATA*",            NULL,   ATA_HORKAGE_BRIDGE_OK, },
 +      { "BUFFALO HD-QSU2/R5",         NULL,   ATA_HORKAGE_BRIDGE_OK, },
  
        /* Devices which aren't very happy with higher link speeds */
        { "WD My Book",                 NULL,   ATA_HORKAGE_1_5_GBPS, },
@@@ -5253,16 -5252,20 +5253,20 @@@ bool ata_link_offline(struct ata_link *
  #ifdef CONFIG_PM
  static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg,
                               unsigned int action, unsigned int ehi_flags,
-                              int wait)
+                              int *async)
  {
        struct ata_link *link;
        unsigned long flags;
-       int rc;
+       int rc = 0;
  
        /* Previous resume operation might still be in
         * progress.  Wait for PM_PENDING to clear.
         */
        if (ap->pflags & ATA_PFLAG_PM_PENDING) {
+               if (async) {
+                       *async = -EAGAIN;
+                       return 0;
+               }
                ata_port_wait_eh(ap);
                WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING);
        }
        spin_lock_irqsave(ap->lock, flags);
  
        ap->pm_mesg = mesg;
-       if (wait) {
-               rc = 0;
+       if (async)
+               ap->pm_result = async;
+       else
                ap->pm_result = &rc;
-       }
  
        ap->pflags |= ATA_PFLAG_PM_PENDING;
        ata_for_each_link(link, ap, HOST_FIRST) {
        spin_unlock_irqrestore(ap->lock, flags);
  
        /* wait and check result */
-       if (wait) {
+       if (!async) {
                ata_port_wait_eh(ap);
                WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING);
        }
        return rc;
  }
  
- static int ata_port_suspend_common(struct device *dev, pm_message_t mesg)
+ static int __ata_port_suspend_common(struct ata_port *ap, pm_message_t mesg, int *async)
  {
-       struct ata_port *ap = to_ata_port(dev);
        unsigned int ehi_flags = ATA_EHI_QUIET;
        int rc;
  
        if (mesg.event == PM_EVENT_SUSPEND)
                ehi_flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_NO_RECOVERY;
  
-       rc = ata_port_request_pm(ap, mesg, 0, ehi_flags, 1);
+       rc = ata_port_request_pm(ap, mesg, 0, ehi_flags, async);
        return rc;
  }
  
+ static int ata_port_suspend_common(struct device *dev, pm_message_t mesg)
+ {
+       struct ata_port *ap = to_ata_port(dev);
+       return __ata_port_suspend_common(ap, mesg, NULL);
+ }
  static int ata_port_suspend(struct device *dev)
  {
        if (pm_runtime_suspended(dev))
@@@ -5340,16 -5349,22 +5350,22 @@@ static int ata_port_poweroff(struct dev
        return ata_port_suspend_common(dev, PMSG_HIBERNATE);
  }
  
- static int ata_port_resume_common(struct device *dev)
+ static int __ata_port_resume_common(struct ata_port *ap, int *async)
  {
-       struct ata_port *ap = to_ata_port(dev);
        int rc;
  
        rc = ata_port_request_pm(ap, PMSG_ON, ATA_EH_RESET,
-               ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 1);
+               ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, async);
        return rc;
  }
  
+ static int ata_port_resume_common(struct device *dev)
+ {
+       struct ata_port *ap = to_ata_port(dev);
+       return __ata_port_resume_common(ap, NULL);
+ }
  static int ata_port_resume(struct device *dev)
  {
        int rc;
@@@ -5382,6 -5397,24 +5398,24 @@@ static const struct dev_pm_ops ata_port
        .runtime_idle = ata_port_runtime_idle,
  };
  
+ /* sas ports don't participate in pm runtime management of ata_ports,
+  * and need to resume ata devices at the domain level, not the per-port
+  * level. sas suspend/resume is async to allow parallel port recovery
+  * since sas has multiple ata_port instances per Scsi_Host.
+  */
+ int ata_sas_port_async_suspend(struct ata_port *ap, int *async)
+ {
+       return __ata_port_suspend_common(ap, PMSG_SUSPEND, async);
+ }
+ EXPORT_SYMBOL_GPL(ata_sas_port_async_suspend);
+ int ata_sas_port_async_resume(struct ata_port *ap, int *async)
+ {
+       return __ata_port_resume_common(ap, async);
+ }
+ EXPORT_SYMBOL_GPL(ata_sas_port_async_resume);
  /**
   *    ata_host_suspend - suspend host
   *    @host: host to suspend
@@@ -5927,24 -5960,18 +5961,18 @@@ int ata_host_start(struct ata_host *hos
  }
  
  /**
-  *    ata_sas_host_init - Initialize a host struct
+  *    ata_sas_host_init - Initialize a host struct for sas (ipr, libsas)
   *    @host:  host to initialize
   *    @dev:   device host is attached to
-  *    @flags: host flags
   *    @ops:   port_ops
   *
-  *    LOCKING:
-  *    PCI/etc. bus probe sem.
-  *
   */
- /* KILLME - the only user left is ipr */
  void ata_host_init(struct ata_host *host, struct device *dev,
-                  unsigned long flags, struct ata_port_operations *ops)
+                  struct ata_port_operations *ops)
  {
        spin_lock_init(&host->lock);
        mutex_init(&host->eh_mutex);
        host->dev = dev;
-       host->flags = flags;
        host->ops = ops;
  }
  
@@@ -6388,6 -6415,7 +6416,7 @@@ static int __init ata_parse_force_one(c
                { "nohrst",     .lflags         = ATA_LFLAG_NO_HRST },
                { "nosrst",     .lflags         = ATA_LFLAG_NO_SRST },
                { "norst",      .lflags         = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
+               { "rstonce",    .lflags         = ATA_LFLAG_RST_ONCE },
        };
        char *start = *cur, *p = *cur;
        char *id, *val, *endp;
diff --combined drivers/scsi/isci/host.c
index b425ed523ccc1b43384d97218875defe8c64ac1e,ab026a50ace3ed93c92779c4b076f502c4f44785..b0afa4486158f7f37537c486853791427c7102f7
@@@ -1044,7 -1044,7 +1044,7 @@@ static enum sci_status sci_controller_s
        return SCI_SUCCESS;
  }
  
- void isci_host_scan_start(struct Scsi_Host *shost)
+ void isci_host_start(struct Scsi_Host *shost)
  {
        struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha;
        unsigned long tmo = sci_controller_get_suggested_start_timeout(ihost);
@@@ -1079,7 -1079,6 +1079,6 @@@ static void sci_controller_completion_h
  
  void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task)
  {
-       task->lldd_task = NULL;
        if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags) &&
            !(task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
                if (test_bit(IREQ_COMPLETE_IN_TARGET, &ireq->flags)) {
                        dev_dbg(&ihost->pdev->dev,
                                "%s: Normal - ireq/task = %p/%p\n",
                                __func__, ireq, task);
+                       task->lldd_task = NULL;
                        task->task_done(task);
                } else {
                        dev_dbg(&ihost->pdev->dev,
                                "%s: Error - ireq/task = %p/%p\n",
                                __func__, ireq, task);
+                       if (sas_protocol_ata(task->task_proto))
+                               task->lldd_task = NULL;
                        sas_task_abort(task);
                }
-       }
+       } else
+               task->lldd_task = NULL;
        if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags))
                wake_up_all(&ihost->eventq);
  
@@@ -1120,10 -1122,16 +1122,16 @@@ void isci_host_completion_routine(unsig
        sci_controller_completion_handler(ihost);
        spin_unlock_irq(&ihost->scic_lock);
  
-       /* the coalesence timeout doubles at each encoding step, so
+       /*
+        * we subtract SCI_MAX_PORTS to account for the number of dummy TCs
+        * issued for hardware issue workaround
+        */
+       active = isci_tci_active(ihost) - SCI_MAX_PORTS;
+       /*
+        * the coalesence timeout doubles at each encoding step, so
         * update it based on the ilog2 value of the outstanding requests
         */
-       active = isci_tci_active(ihost);
        writel(SMU_ICC_GEN_VAL(NUMBER, active) |
               SMU_ICC_GEN_VAL(TIMER, ISCI_COALESCE_BASE + ilog2(active)),
               &ihost->smu_registers->interrupt_coalesce_control);
@@@ -1973,7 -1981,7 +1981,7 @@@ static void sci_controller_afe_initiali
        }
  
        for (phy_id = 0; phy_id < SCI_MAX_PHYS; phy_id++) {
 -              struct scu_afe_transceiver *xcvr = &afe->scu_afe_xcvr[phy_id];
 +              struct scu_afe_transceiver __iomem *xcvr = &afe->scu_afe_xcvr[phy_id];
                const struct sci_phy_oem_params *oem_phy = &oem->phys[phy_id];
                int cable_length_long =
                        is_long_cable(phy_id, cable_selection_mask);
diff --combined drivers/scsi/isci/init.c
index 1286a8a787e2bcf39a82387b3b723d33a5544d6c,da142a8726dc0c76c062bf89d9e2159aec924d0f..5ed4e608f20001091bcda1adec983a3e6b9cb999
@@@ -156,7 -156,7 +156,7 @@@ static struct scsi_host_template isci_s
        .target_alloc                   = sas_target_alloc,
        .slave_configure                = sas_slave_configure,
        .scan_finished                  = isci_host_scan_finished,
-       .scan_start                     = isci_host_scan_start,
+       .scan_start                     = isci_host_start,
        .change_queue_depth             = sas_change_queue_depth,
        .change_queue_type              = sas_change_queue_type,
        .bios_param                     = sas_bios_param,
@@@ -644,6 -644,7 +644,6 @@@ static int __devinit isci_pci_probe(str
                                                orom->hdr.version)) {
                        dev_warn(&pdev->dev,
                                 "[%d]: invalid oem parameters detected, falling back to firmware\n", i);
 -                      devm_kfree(&pdev->dev, orom);
                        orom = NULL;
                        break;
                }
@@@ -721,11 -722,67 +721,67 @@@ static void __devexit isci_pci_remove(s
        }
  }
  
+ #ifdef CONFIG_PM
+ static int isci_suspend(struct device *dev)
+ {
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct isci_host *ihost;
+       int i;
+       for_each_isci_host(i, ihost, pdev) {
+               sas_suspend_ha(&ihost->sas_ha);
+               isci_host_deinit(ihost);
+       }
+       pci_save_state(pdev);
+       pci_disable_device(pdev);
+       pci_set_power_state(pdev, PCI_D3hot);
+       return 0;
+ }
+ static int isci_resume(struct device *dev)
+ {
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct isci_host *ihost;
+       int rc, i;
+       pci_set_power_state(pdev, PCI_D0);
+       pci_restore_state(pdev);
+       rc = pcim_enable_device(pdev);
+       if (rc) {
+               dev_err(&pdev->dev,
+                       "enabling device failure after resume(%d)\n", rc);
+               return rc;
+       }
+       pci_set_master(pdev);
+       for_each_isci_host(i, ihost, pdev) {
+               sas_prep_resume_ha(&ihost->sas_ha);
+               isci_host_init(ihost);
+               isci_host_start(ihost->sas_ha.core.shost);
+               wait_for_start(ihost);
+               sas_resume_ha(&ihost->sas_ha);
+       }
+       return 0;
+ }
+ static SIMPLE_DEV_PM_OPS(isci_pm_ops, isci_suspend, isci_resume);
+ #endif
  static struct pci_driver isci_pci_driver = {
        .name           = DRV_NAME,
        .id_table       = isci_id_table,
        .probe          = isci_pci_probe,
        .remove         = __devexit_p(isci_pci_remove),
+ #ifdef CONFIG_PM
+       .driver.pm      = &isci_pm_ops,
+ #endif
  };
  
  static __init int isci_init(void)
index ed38454228c626bdabbea4d4265b22dfbc637864,7cd70e8c4bd1f875e933c32b861f204c3bf6c377..0393ec478cdf41257aebbf2e7e2cee7a244583eb
@@@ -18,7 -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.15-rc1
+  *  Version : v00.00.06.18-rc1
   *
   *  Authors: LSI Corporation
   *           Sreenivas Bagalkote
@@@ -71,6 -71,16 +71,16 @@@ static int msix_disable
  module_param(msix_disable, int, S_IRUGO);
  MODULE_PARM_DESC(msix_disable, "Disable MSI-X interrupt handling. Default: 0");
  
+ static int throttlequeuedepth = MEGASAS_THROTTLE_QUEUE_DEPTH;
+ module_param(throttlequeuedepth, int, S_IRUGO);
+ MODULE_PARM_DESC(throttlequeuedepth,
+       "Adapter queue depth when throttled due to I/O timeout. Default: 16");
+ int resetwaittime = MEGASAS_RESET_WAIT_TIME;
+ module_param(resetwaittime, int, S_IRUGO);
+ MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout "
+                "before resetting adapter. Default: 180");
  MODULE_LICENSE("GPL");
  MODULE_VERSION(MEGASAS_VERSION);
  MODULE_AUTHOR("megaraidlinux@lsi.com");
@@@ -1595,8 -1605,9 +1605,9 @@@ megasas_check_and_restore_queue_depth(s
  {
        unsigned long flags;
        if (instance->flag & MEGASAS_FW_BUSY
-               && time_after(jiffies, instance->last_time + 5 * HZ)
-               && atomic_read(&instance->fw_outstanding) < 17) {
+           && time_after(jiffies, instance->last_time + 5 * HZ)
+           && atomic_read(&instance->fw_outstanding) <
+           instance->throttlequeuedepth + 1) {
  
                spin_lock_irqsave(instance->host->host_lock, flags);
                instance->flag &= ~MEGASAS_FW_BUSY;
@@@ -1772,7 -1783,7 +1783,7 @@@ static int megasas_wait_for_outstanding
                return SUCCESS;
        }
  
-       for (i = 0; i < wait_time; i++) {
+       for (i = 0; i < resetwaittime; i++) {
  
                int outstanding = atomic_read(&instance->fw_outstanding);
  
@@@ -1914,7 -1925,7 +1925,7 @@@ blk_eh_timer_return megasas_reset_timer
                /* FW is busy, throttle IO */
                spin_lock_irqsave(instance->host->host_lock, flags);
  
-               instance->host->can_queue = 16;
+               instance->host->can_queue = instance->throttlequeuedepth;
                instance->last_time = jiffies;
                instance->flag |= MEGASAS_FW_BUSY;
  
@@@ -3577,6 -3588,24 +3588,24 @@@ static int megasas_init_fw(struct megas
  
        kfree(ctrl_info);
  
+       /* Check for valid throttlequeuedepth module parameter */
+       if (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY ||
+           instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) {
+               if (throttlequeuedepth > (instance->max_fw_cmds -
+                                         MEGASAS_SKINNY_INT_CMDS))
+                       instance->throttlequeuedepth =
+                               MEGASAS_THROTTLE_QUEUE_DEPTH;
+               else
+                       instance->throttlequeuedepth = throttlequeuedepth;
+       } else {
+               if (throttlequeuedepth > (instance->max_fw_cmds -
+                                         MEGASAS_INT_CMDS))
+                       instance->throttlequeuedepth =
+                               MEGASAS_THROTTLE_QUEUE_DEPTH;
+               else
+                       instance->throttlequeuedepth = throttlequeuedepth;
+       }
          /*
        * Setup tasklet for cmd completion
        */
@@@ -4066,6 -4095,7 +4095,6 @@@ megasas_probe_one(struct pci_dev *pdev
        spin_lock_init(&instance->cmd_pool_lock);
        spin_lock_init(&instance->hba_lock);
        spin_lock_init(&instance->completion_lock);
 -      spin_lock_init(&poll_aen_lock);
  
        mutex_init(&instance->aen_mutex);
        mutex_init(&instance->reset_mutex);
@@@ -5391,8 -5421,6 +5420,8 @@@ static int __init megasas_init(void
        printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
               MEGASAS_EXT_VERSION);
  
 +      spin_lock_init(&poll_aen_lock);
 +
        support_poll_for_event = 2;
        support_device_change = 1;
  
index b25757d1e91b5ee8ebf2964d3ee424105939d56b,0d795af9b6238cf66a6ae9f8c73754e5ecf69e4f..db5960855cdf0da88550d81c574819b564039ce5
@@@ -3,7 -3,7 +3,7 @@@
   * for access to MPT (Message Passing Technology) firmware.
   *
   * This code is based on drivers/scsi/mpt2sas/mpt2_base.c
-  * Copyright (C) 2007-2010  LSI Corporation
+  * Copyright (C) 2007-2012  LSI Corporation
   *  (mailto:DL-MPTFusionLinux@lsi.com)
   *
   * This program is free software; you can redistribute it and/or
@@@ -1971,9 -1971,9 +1971,9 @@@ _base_display_intel_branding(struct MPT
                        printk(MPT2SAS_INFO_FMT "%s\n", ioc->name,
                            MPT2SAS_INTEL_RMS2LL040_BRANDING);
                        break;
-               case MPT2SAS_INTEL_RAMSDALE_SSDID:
+               case MPT2SAS_INTEL_SSD910_SSDID:
                        printk(MPT2SAS_INFO_FMT "%s\n", ioc->name,
-                           MPT2SAS_INTEL_RAMSDALE_BRANDING);
+                           MPT2SAS_INTEL_SSD910_BRANDING);
                        break;
                default:
                        break;
@@@ -2424,13 -2424,10 +2424,13 @@@ _base_allocate_memory_pools(struct MPT2
        }
  
        /* command line tunables  for max controller queue depth */
 -      if (max_queue_depth != -1)
 -              max_request_credit = (max_queue_depth < facts->RequestCredit)
 -                  ? max_queue_depth : facts->RequestCredit;
 -      else
 +      if (max_queue_depth != -1 && max_queue_depth != 0) {
 +              max_request_credit = min_t(u16, max_queue_depth +
 +                      ioc->hi_priority_depth + ioc->internal_depth,
 +                      facts->RequestCredit);
 +              if (max_request_credit > MAX_HBA_QUEUE_DEPTH)
 +                      max_request_credit =  MAX_HBA_QUEUE_DEPTH;
 +      } else
                max_request_credit = min_t(u16, facts->RequestCredit,
                    MAX_HBA_QUEUE_DEPTH);
  
        /* set the scsi host can_queue depth
         * with some internal commands that could be outstanding
         */
 -      ioc->shost->can_queue = ioc->scsiio_depth - (2);
 +      ioc->shost->can_queue = ioc->scsiio_depth;
        dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scsi host: "
            "can_queue depth (%d)\n", ioc->name, ioc->shost->can_queue));
  
diff --combined drivers/scsi/scsi_lib.c
index faa790fba1347fc61b0869015e2a28bad4f113f2,4ba37198e069856c2b6b061e681d1c54955e2eb4..da36a3a81a9ee2206f753a04d4fbbe91b883e00a
@@@ -776,6 -776,7 +776,6 @@@ void scsi_io_completion(struct scsi_cmn
        }
  
        if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */
 -              req->errors = result;
                if (result) {
                        if (sense_valid && req->sense) {
                                /*
                        if (!sense_deferred)
                                error = __scsi_error_from_host_byte(cmd, result);
                }
 +              /*
 +               * __scsi_error_from_host_byte may have reset the host_byte
 +               */
 +              req->errors = cmd->result;
  
                req->resid_len = scsi_get_resid(cmd);
  
@@@ -2473,7 -2470,8 +2473,8 @@@ scsi_internal_device_unblock(struct scs
         * Try to transition the scsi device to SDEV_RUNNING or one of the
         * offlined states and goose the device queue if successful.
         */
-       if (sdev->sdev_state == SDEV_BLOCK)
+       if ((sdev->sdev_state == SDEV_BLOCK) ||
+           (sdev->sdev_state == SDEV_TRANSPORT_OFFLINE))
                sdev->sdev_state = new_state;
        else if (sdev->sdev_state == SDEV_CREATED_BLOCK) {
                if (new_state == SDEV_TRANSPORT_OFFLINE ||
diff --combined drivers/scsi/scsi_scan.c
index d947ffc20ceba301eaaf45973fee97dfba7fb7f7,0a224e29c3f1c6d14f6676ab526198d860590b99..3e58b2245f1fe2526aba4f55aef2a789ce74700d
@@@ -764,16 -764,6 +764,16 @@@ static int scsi_add_lun(struct scsi_dev
        sdev->model = (char *) (sdev->inquiry + 16);
        sdev->rev = (char *) (sdev->inquiry + 32);
  
 +      if (strncmp(sdev->vendor, "ATA     ", 8) == 0) {
 +              /*
 +               * sata emulation layer device.  This is a hack to work around
 +               * the SATL power management specifications which state that
 +               * when the SATL detects the device has gone into standby
 +               * mode, it shall respond with NOT READY.
 +               */
 +              sdev->allow_restart = 1;
 +      }
 +
        if (*bflags & BLIST_ISROM) {
                sdev->type = TYPE_ROM;
                sdev->removable = 1;
        if (*bflags & BLIST_RETRY_HWERROR)
                sdev->retry_hwerror = 1;
  
+       if (*bflags & BLIST_NO_DIF)
+               sdev->no_dif = 1;
        transport_configure_device(&sdev->sdev_gendev);
  
        if (sdev->host->hostt->slave_configure) {
diff --combined include/linux/pci_ids.h
index 6b4565c440c8795eecf21044e9a8dc76b630687d,b38f7371fd1af561962bc93a8341f27b780ba704..416db39d484b6228c2a8864994ef866e948bcdd3
  #define PCI_DEVICE_ID_HP_CISSD                0x3238
  #define PCI_DEVICE_ID_HP_CISSE                0x323a
  #define PCI_DEVICE_ID_HP_CISSF                0x323b
+ #define PCI_DEVICE_ID_HP_CISSH                0x323c
  #define PCI_DEVICE_ID_HP_ZX2_IOC      0x4031
  
  #define PCI_VENDOR_ID_PCTECH          0x1042
  #define PCI_DEVICE_ID_TIGON3_5704S    0x16a8
  #define PCI_DEVICE_ID_NX2_57800_VF    0x16a9
  #define PCI_DEVICE_ID_NX2_5706S               0x16aa
 -#define PCI_DEVICE_ID_NX2_57840_MF    0x16ab
 +#define PCI_DEVICE_ID_NX2_57840_MF    0x16a4
  #define PCI_DEVICE_ID_NX2_5708S               0x16ac
  #define PCI_DEVICE_ID_NX2_57840_VF    0x16ad
  #define PCI_DEVICE_ID_NX2_57810_MF    0x16ae