Merge ../linux-2.6
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 10 Jun 2006 18:47:26 +0000 (13:47 -0500)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 10 Jun 2006 18:47:26 +0000 (13:47 -0500)
1  2 
MAINTAINERS
drivers/message/fusion/mptbase.c
drivers/scsi/Kconfig
drivers/scsi/aic7xxx/aic7xxx_pci.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/megaraid.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi_devinfo.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_transport_sas.c
drivers/scsi/st.c

diff --combined MAINTAINERS
@@@ -40,11 -40,20 +40,20 @@@ trivial patch so apply some common sens
        PLEASE document known bugs. If it doesn't work for everything
        or does something very odd once a month document it.
  
+       PLEASE remember that submissions must be made under the terms
+       of the OSDL certificate of contribution
+       (http://www.osdl.org/newsroom/press_releases/2004/2004_05_24_dco.html)
+       and should include a Signed-off-by: line.
  6.    Make sure you have the right to send any changes you make. If you
        do changes at work you may find your employer owns the patch
        not you.
  
- 7.    Happy hacking.
+ 7.    When sending security related changes or reports to a maintainer
+       please Cc: security@kernel.org, especially if the maintainer
+       does not respond.
+ 8.    Happy hacking.
  
                -----------------------------------
  
@@@ -411,6 -420,7 +420,7 @@@ AX.25 NETWORK LAYE
  P:    Ralf Baechle
  M:    ralf@linux-mips.org
  L:    linux-hams@vger.kernel.org
+ W:    http://www.linux-ax25.org/
  S:    Maintained
  
  BAYCOM/HDLCDRV DRIVERS FOR AX.25
@@@ -420,6 -430,14 +430,14 @@@ L:       linux-hams@vger.kernel.or
  W:    http://www.baycom.org/~tom/ham/ham.html
  S:    Maintained
  
+ BCM43XX WIRELESS DRIVER
+ P:    Michael Buesch
+ M:    mb@bu3sch.de
+ P:    Stefano Brivio
+ M:    st3@riseup.net
+ W:    http://bcm43xx.berlios.de/
+ S:    Maintained
  BEFS FILE SYSTEM
  P:    Sergey S. Kostyliov
  M:    rathamahata@php4.ru
@@@ -547,7 -565,19 +565,19 @@@ BROADBAND PROCESSOR ARCHITECTUR
  P:    Arnd Bergmann
  M:    arnd@arndb.de
  L:    linuxppc-dev@ozlabs.org
- W:    http://linuxppc64.org
+ W:    http://www.penguinppc.org/ppc64/
+ S:    Supported
+ BROADCOM BNX2 GIGABIT ETHERNET DRIVER
+ P:    Michael Chan
+ M:    mchan@broadcom.com
+ L:    netdev@vger.kernel.org
+ S:    Supported
+ BROADCOM TG3 GIGABIT ETHERNET DRIVER
+ P:    Michael Chan
+ M:    mchan@broadcom.com
+ L:    netdev@vger.kernel.org
  S:    Supported
  
  BTTV VIDEO4LINUX DRIVER
@@@ -960,7 -990,7 +990,7 @@@ S: Maintaine
  EXT3 FILE SYSTEM
  P:    Stephen Tweedie, Andrew Morton
  M:    sct@redhat.com, akpm@osdl.org, adilger@clusterfs.com
- L:    ext3-users@redhat.com
+ L:    ext2-devel@lists.sourceforge.net
  S:    Maintained
  
  F71805F HARDWARE MONITORING DRIVER
@@@ -1117,12 -1147,6 +1147,12 @@@ L:    linux-hams@vger.kernel.or
  W:    http://www.nt.tuwien.ac.at/~kkudielk/Linux/
  S:    Maintained
  
 +HIGHPOINT ROCKETRAID 3xxx RAID DRIVER
 +P:    HighPoint Linux Team
 +M:    linux@highpoint-tech.com
 +W:    http://www.highpoint-tech.com
 +S:    Supported
 +
  HIPPI
  P:    Jes Sorensen
  M:    jes@trained-monkey.org
@@@ -1463,6 -1487,13 +1493,13 @@@ M:    support@pathscale.co
  L:    openib-general@openib.org
  S:    Supported
  
+ IPMI SUBSYSTEM
+ P:    Corey Minyard
+ M:    minyard@acm.org
+ L:    openipmi-developer@lists.sourceforge.net
+ W:    http://openipmi.sourceforge.net/
+ S:    Supported
  IPX NETWORK LAYER
  P:    Arnaldo Carvalho de Melo
  M:    acme@conectiva.com.br
@@@ -1470,10 -1501,11 +1507,11 @@@ L:   netdev@vger.kernel.or
  S:    Maintained
  
  IRDA SUBSYSTEM
- P:    Jean Tourrilhes
+ P:    Samuel Ortiz
+ M:    samuel@sortiz.org
  L:    irda-users@lists.sourceforge.net (subscribers-only)
  W:    http://irda.sourceforge.net/
- S:    Odd Fixes
+ S:    Maintained
  
  ISAPNP
  P:    Jaroslav Kysela
@@@ -1519,12 -1551,28 +1557,28 @@@ W:   http://jfs.sourceforge.net
  T:    git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
  S:    Supported
  
+ JOURNALLING LAYER FOR BLOCK DEVICS (JBD)
+ P:    Stephen Tweedie, Andrew Morton
+ M:    sct@redhat.com, akpm@osdl.org
+ L:    ext2-devel@lists.sourceforge.net
+ S:    Maintained
  KCONFIG
  P:    Roman Zippel
  M:    zippel@linux-m68k.org
  L:    kbuild-devel@lists.sourceforge.net
  S:    Maintained
  
+ KDUMP
+ P:    Vivek Goyal
+ M:    vgoyal@in.ibm.com
+ P:    Haren Myneni
+ M:    hbabu@us.ibm.com
+ L:    fastboot@lists.osdl.org
+ L:    linux-kernel@vger.kernel.org
+ W:    http://lse.sourceforge.net/kdump/
+ S:    Maintained
  KERNEL AUTOMOUNTER (AUTOFS)
  P:    H. Peter Anvin
  M:    hpa@zytor.com
@@@ -1592,6 -1640,11 +1646,11 @@@ M:    James.Bottomley@HansenPartnership.co
  L:    linux-scsi@vger.kernel.org
  S:    Maintained
  
+ LED SUBSYSTEM
+ P:    Richard Purdie
+ M:    rpurdie@rpsys.net
+ S:    Maintained
  LEGO USB Tower driver
  P:    Juergen Stuber
  M:    starblue@users.sourceforge.net
@@@ -1651,7 -1704,7 +1710,7 @@@ S:      Maintaine
  
  LINUX FOR POWERPC EMBEDDED PPC8XX
  P:    Marcelo Tosatti
- M:    marcelo.tosatti@cyclades.com
+ M:    marcelo@kvack.org
  W:    http://www.penguinppc.org/
  L:    linuxppc-embedded@ozlabs.org
  S:    Maintained
@@@ -1675,7 -1728,7 +1734,7 @@@ M:      paulus@au.ibm.co
  P:    Anton Blanchard
  M:    anton@samba.org
  M:    anton@au.ibm.com
- W:    http://linuxppc64.org
+ W:    http://www.penguinppc.org/ppc64/
  L:    linuxppc-dev@ozlabs.org
  S:    Supported
  
@@@ -1836,6 -1889,11 +1895,11 @@@ L:    linux-kernel@vger.kernel.or
  W:    http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html
  S:    Maintained
  
+ MULTIMEDIA CARD SUBSYSTEM
+ P:    Russell King
+ M:    rmk+mmc@arm.linux.org.uk
+ S:    Maintained
  MULTISOUND SOUND DRIVER
  P:    Andrew Veliath
  M:    andrewtv@usa.net
@@@ -1858,6 -1916,12 +1922,12 @@@ M:    James.Bottomley@HansenPartnership.co
  L:    linux-scsi@vger.kernel.org
  S:    Maintained
  
+ NETEM NETWORK EMULATOR
+ P:    Stephen Hemminger
+ M:    shemminger@osdl.org
+ L:    netem@osdl.org
+ S:    Maintained
  NETFILTER/IPTABLES/IPCHAINS
  P:    Rusty Russell
  P:    Marc Boucher
@@@ -1875,6 -1939,7 +1945,7 @@@ NETROM NETWORK LAYE
  P:    Ralf Baechle
  M:    ralf@linux-mips.org
  L:    linux-hams@vger.kernel.org
+ W:    http://www.linux-ax25.org/
  S:    Maintained
  
  NETWORK BLOCK DEVICE
@@@ -2062,8 -2127,12 +2133,12 @@@ P:    Matthew Wilco
  M:    matthew@wil.cx
  P:    Grant Grundler
  M:    grundler@parisc-linux.org
+ P:    Kyle McMartin
+ M:    kyle@parisc-linux.org
  L:    parisc-linux@parisc-linux.org
  W:    http://www.parisc-linux.org/
+ T:    git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
+ T:    cvs cvs.parisc-linux.org:/var/cvs/linux-2.6
  S:    Maintained
  
  PCI ERROR RECOVERY
@@@ -2266,6 -2335,7 +2341,7 @@@ ROSE NETWORK LAYE
  P:    Ralf Baechle
  M:    ralf@linux-mips.org
  L:    linux-hams@vger.kernel.org
+ W:    http://www.linux-ax25.org/
  S:    Maintained
  
  RISCOM8 DRIVER
@@@ -2496,6 -2566,12 +2572,12 @@@ M:    perex@suse.c
  L:    alsa-devel@alsa-project.org
  S:    Maintained
  
+ SPI SUBSYSTEM
+ P:    David Brownell
+ M:    dbrownell@users.sourceforge.net
+ L:    spi-devel-general@lists.sourceforge.net
+ S:    Maintained
  TPM DEVICE DRIVER
  P:    Kylene Hall
  M:    kjhall@us.ibm.com
@@@ -1189,7 -1189,6 +1189,6 @@@ mpt_attach(struct pci_dev *pdev, const 
        ioc->diagPending = 0;
        spin_lock_init(&ioc->diagLock);
        spin_lock_init(&ioc->fc_rescan_work_lock);
-       spin_lock_init(&ioc->fc_rport_lock);
        spin_lock_init(&ioc->initializing_hba_lock);
  
        /* Initialize the event logging.
        /* Set lookup ptr. */
        list_add_tail(&ioc->list, &ioc_list);
  
 -      ioc->pci_irq = -1;
 -      if (pdev->irq) {
 -              if (mpt_msi_enable && !pci_enable_msi(pdev))
 -                      printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", ioc->name);
 -
 -              r = request_irq(pdev->irq, mpt_interrupt, SA_SHIRQ, ioc->name, ioc);
 -
 -              if (r < 0) {
 -#ifndef __sparc__
 -                      printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %d!\n",
 -                                      ioc->name, pdev->irq);
 -#else
 -                      printk(MYIOC_s_ERR_FMT "Unable to allocate interrupt %s!\n",
 -                                      ioc->name, __irq_itoa(pdev->irq));
 -#endif
 -                      list_del(&ioc->list);
 -                      iounmap(mem);
 -                      kfree(ioc);
 -                      return -EBUSY;
 -              }
 -
 -              ioc->pci_irq = pdev->irq;
 -
 -              pci_set_master(pdev);                   /* ?? */
 -              pci_set_drvdata(pdev, ioc);
 -
 -#ifndef __sparc__
 -              dprintk((KERN_INFO MYNAM ": %s installed at interrupt %d\n", ioc->name, pdev->irq));
 -#else
 -              dprintk((KERN_INFO MYNAM ": %s installed at interrupt %s\n", ioc->name, __irq_itoa(pdev->irq)));
 -#endif
 -      }
 -
        /* Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
         */
        mpt_detect_bound_ports(ioc, pdev);
                printk(KERN_WARNING MYNAM
                  ": WARNING - %s did not initialize properly! (%d)\n",
                  ioc->name, r);
 -
                list_del(&ioc->list);
 -              free_irq(ioc->pci_irq, ioc);
 -              if (mpt_msi_enable)
 -                      pci_disable_msi(pdev);
                if (ioc->alt_ioc)
                        ioc->alt_ioc->alt_ioc = NULL;
                iounmap(mem);
@@@ -1569,6 -1605,21 +1568,21 @@@ mpt_resume(struct pci_dev *pdev
  }
  #endif
  
+ static int
+ mpt_signal_reset(int index, MPT_ADAPTER *ioc, int reset_phase)
+ {
+       if ((MptDriverClass[index] == MPTSPI_DRIVER &&
+            ioc->bus_type != SPI) ||
+           (MptDriverClass[index] == MPTFC_DRIVER &&
+            ioc->bus_type != FC) ||
+           (MptDriverClass[index] == MPTSAS_DRIVER &&
+            ioc->bus_type != SAS))
+               /* make sure we only call the relevant reset handler
+                * for the bus */
+               return 0;
+       return (MptResetHandlers[index])(ioc, reset_phase);
+ }
  /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  /*
   *    mpt_do_ioc_recovery - Initialize or recover MPT adapter.
@@@ -1600,7 -1651,6 +1614,7 @@@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u
        int      handlers;
        int      ret = 0;
        int      reset_alt_ioc_active = 0;
 +      int      irq_allocated = 0;
  
        printk(KERN_INFO MYNAM ": Initiating %s %s\n",
                        ioc->name, reason==MPT_HOSTEVENT_IOC_BRINGUP ? "bringup" : "recovery");
                }
        }
  
 +      /*
 +       * Device is reset now. It must have de-asserted the interrupt line
 +       * (if it was asserted) and it should be safe to register for the
 +       * interrupt now.
 +       */
 +      if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) {
 +              ioc->pci_irq = -1;
 +              if (ioc->pcidev->irq) {
 +                      if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev))
 +                              printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
 +                                      ioc->name);
 +                      rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
 +                                      SA_SHIRQ, ioc->name, ioc);
 +                      if (rc < 0) {
 +#ifndef __sparc__
 +                              printk(MYIOC_s_ERR_FMT "Unable to allocate "
 +                                      "interrupt %d!\n", ioc->name,
 +                                      ioc->pcidev->irq);
 +#else
 +                              printk(MYIOC_s_ERR_FMT "Unable to allocate "
 +                                      "interrupt %s!\n", ioc->name,
 +                                      __irq_itoa(ioc->pcidev->irq));
 +#endif
 +                              if (mpt_msi_enable)
 +                                      pci_disable_msi(ioc->pcidev);
 +                              return -EBUSY;
 +                      }
 +                      irq_allocated = 1;
 +                      ioc->pci_irq = ioc->pcidev->irq;
 +                      pci_set_master(ioc->pcidev);            /* ?? */
 +                      pci_set_drvdata(ioc->pcidev, ioc);
 +#ifndef __sparc__
 +                      dprintk((KERN_INFO MYNAM ": %s installed at interrupt "
 +                              "%d\n", ioc->name, ioc->pcidev->irq));
 +#else
 +                      dprintk((KERN_INFO MYNAM ": %s installed at interrupt "
 +                              "%s\n", ioc->name,
 +                              __irq_itoa(ioc->pcidev->irq)));
 +#endif
 +              }
 +      }
 +
        /* Prime reply & request queues!
         * (mucho alloc's) Must be done prior to
         * init as upper addresses are needed for init.
                                ret = mptbase_sas_persist_operation(ioc,
                                    MPI_SAS_OP_CLEAR_NOT_PRESENT);
                                if(ret != 0)
 -                                      return -1;
 +                                      goto out;
                        }
  
                        /* Find IM volumes
                        if ((ret == 0) && MptResetHandlers[ii]) {
                                dprintk((MYIOC_s_INFO_FMT "Calling IOC post_reset handler #%d\n",
                                                ioc->name, ii));
-                               rc += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_POST_RESET);
+                               rc += mpt_signal_reset(ii, ioc, MPT_IOC_POST_RESET);
                                handlers++;
                        }
  
                        if (alt_ioc_ready && MptResetHandlers[ii]) {
                                drsprintk((MYIOC_s_INFO_FMT "Calling alt-%s post_reset handler #%d\n",
                                                ioc->name, ioc->alt_ioc->name, ii));
-                               rc += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_POST_RESET);
+                               rc += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_POST_RESET);
                                handlers++;
                        }
                }
                /* FIXME?  Examine results here? */
        }
  
 +out:
 +      if ((ret != 0) && irq_allocated) {
 +              free_irq(ioc->pci_irq, ioc);
 +              if (mpt_msi_enable)
 +                      pci_disable_msi(ioc->pcidev);
 +      }
        return ret;
  }
  
@@@ -3280,11 -3282,11 +3294,11 @@@ mpt_diag_reset(MPT_ADAPTER *ioc, int ig
                                if (MptResetHandlers[ii]) {
                                        dprintk((MYIOC_s_INFO_FMT "Calling IOC pre_reset handler #%d\n",
                                                        ioc->name, ii));
-                                       r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_PRE_RESET);
+                                       r += mpt_signal_reset(ii, ioc, MPT_IOC_PRE_RESET);
                                        if (ioc->alt_ioc) {
                                                dprintk((MYIOC_s_INFO_FMT "Calling alt-%s pre_reset handler #%d\n",
                                                                ioc->name, ioc->alt_ioc->name, ii));
-                                               r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_PRE_RESET);
+                                               r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_PRE_RESET);
                                        }
                                }
                        }
@@@ -5719,11 -5721,11 +5733,11 @@@ mpt_HardResetHandler(MPT_ADAPTER *ioc, 
                        if (MptResetHandlers[ii]) {
                                dtmprintk((MYIOC_s_INFO_FMT "Calling IOC reset_setup handler #%d\n",
                                                ioc->name, ii));
-                               r += (*(MptResetHandlers[ii]))(ioc, MPT_IOC_SETUP_RESET);
+                               r += mpt_signal_reset(ii, ioc, MPT_IOC_SETUP_RESET);
                                if (ioc->alt_ioc) {
                                        dtmprintk((MYIOC_s_INFO_FMT "Calling alt-%s setup reset handler #%d\n",
                                                        ioc->name, ioc->alt_ioc->name, ii));
-                                       r += (*(MptResetHandlers[ii]))(ioc->alt_ioc, MPT_IOC_SETUP_RESET);
+                                       r += mpt_signal_reset(ii, ioc->alt_ioc, MPT_IOC_SETUP_RESET);
                                }
                        }
                }
        return rc;
  }
  
+ # define EVENT_DESCR_STR_SZ           100
  /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  static void
  EventDescriptionStr(u8 event, u32 evData0, char *evStr)
  {
-       char *ds;
+       char *ds = NULL;
  
        switch(event) {
        case MPI_EVENT_NONE:
                if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP)
                        ds = "Loop State(LIP) Change";
                else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE)
-                       ds = "Loop State(LPE) Change";                  /* ??? */
+                       ds = "Loop State(LPE) Change";          /* ??? */
                else
-                       ds = "Loop State(LPB) Change";                  /* ??? */
+                       ds = "Loop State(LPB) Change";          /* ??? */
                break;
        case MPI_EVENT_LOGOUT:
                ds = "Logout";
                break;
        case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE:
        {
-               char buf[50];
                u8 id = (u8)(evData0);
                u8 ReasonCode = (u8)(evData0 >> 16);
                switch (ReasonCode) {
                case MPI_EVENT_SAS_DEV_STAT_RC_ADDED:
-                       sprintf(buf,"SAS Device Status Change: Added: id=%d", id);
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                           "SAS Device Status Change: Added: id=%d", id);
                        break;
                case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING:
-                       sprintf(buf,"SAS Device Status Change: Deleted: id=%d", id);
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                           "SAS Device Status Change: Deleted: id=%d", id);
                        break;
                case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA:
-                       sprintf(buf,"SAS Device Status Change: SMART Data: id=%d", id);
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                           "SAS Device Status Change: SMART Data: id=%d",
+                           id);
                        break;
                case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED:
-                       sprintf(buf,"SAS Device Status Change: No Persistancy Added: id=%d", id);
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                           "SAS Device Status Change: No Persistancy "
+                           "Added: id=%d", id);
                        break;
                default:
-                       sprintf(buf,"SAS Device Status Change: Unknown: id=%d", id);
-               break;
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                           "SAS Device Status Change: Unknown: id=%d", id);
+                       break;
                }
-               ds = buf;
                break;
        }
        case MPI_EVENT_ON_BUS_TIMER_EXPIRED:
                break;
        case MPI_EVENT_SAS_PHY_LINK_STATUS:
        {
-               char buf[50];
                u8 LinkRates = (u8)(evData0 >> 8);
                u8 PhyNumber = (u8)(evData0);
                LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >>
                        MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT;
                switch (LinkRates) {
                case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d:"
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d:"
                           " Rate Unknown",PhyNumber);
                        break;
                case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d:"
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d:"
                           " Phy Disabled",PhyNumber);
                        break;
                case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d:"
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d:"
                           " Failed Speed Nego",PhyNumber);
                        break;
                case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d:"
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d:"
                           " Sata OOB Completed",PhyNumber);
                        break;
                case MPI_EVENT_SAS_PLS_LR_RATE_1_5:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d:"
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d:"
                           " Rate 1.5 Gbps",PhyNumber);
                        break;
                case MPI_EVENT_SAS_PLS_LR_RATE_3_0:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d:"
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d:"
                           " Rate 3.0 Gpbs",PhyNumber);
                        break;
                default:
-                       sprintf(buf,"SAS PHY Link Status: Phy=%d", PhyNumber);
+                       snprintf(evStr, EVENT_DESCR_STR_SZ,
+                          "SAS PHY Link Status: Phy=%d", PhyNumber);
                        break;
                }
-               ds = buf;
                break;
        }
        case MPI_EVENT_SAS_DISCOVERY_ERROR:
        case MPI_EVENT_IR_RESYNC_UPDATE:
        {
                u8 resync_complete = (u8)(evData0 >> 16);
-               char buf[40];
-               sprintf(buf,"IR Resync Update: Complete = %d:",resync_complete);
-               ds = buf;
+               snprintf(evStr, EVENT_DESCR_STR_SZ,
+                   "IR Resync Update: Complete = %d:",resync_complete);
                break;
        }
        case MPI_EVENT_IR2:
                ds = "Unknown";
                break;
        }
-       strcpy(evStr,ds);
+       if (ds)
+               strncpy(evStr, ds, EVENT_DESCR_STR_SZ);
  }
  
  /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@@ -6010,7 -6024,7 +6036,7 @@@ ProcessEventNotification(MPT_ADAPTER *i
        int ii;
        int r = 0;
        int handlers = 0;
-       char evStr[100];
+       char evStr[EVENT_DESCR_STR_SZ];
        u8 event;
  
        /*
diff --combined drivers/scsi/Kconfig
@@@ -446,7 -446,9 +446,9 @@@ config SCSI_DPT_I2
  
  config SCSI_ADVANSYS
        tristate "AdvanSys SCSI support"
-       depends on (ISA || EISA || PCI) && SCSI && BROKEN
+       depends on SCSI
+       depends on ISA || EISA || PCI
+       depends on BROKEN || X86_32
        help
          This is a driver for all SCSI host adapters manufactured by
          AdvanSys. It is documented in the kernel source in
@@@ -529,16 -531,6 +531,16 @@@ config SCSI_PDC_ADM
          This option enables support for Pacific Digital ADMA controllers
  
          If unsure, say N.
 +
 +config SCSI_HPTIOP
 +      tristate "HighPoint RocketRAID 3xxx Controller support"
 +      depends on SCSI && PCI
 +      help
 +        This option enables support for HighPoint RocketRAID 3xxx
 +        controllers.
 +
 +        To compile this driver as a module, choose M here; the module
 +        will be called hptiop. If unsure, say N.
  
  config SCSI_SATA_QSTOR
        tristate "Pacific Digital SATA QStor support"
@@@ -144,22 -144,16 +144,22 @@@ static ahc_device_setup_t ahc_aic785X_s
  static ahc_device_setup_t ahc_aic7860_setup;
  static ahc_device_setup_t ahc_apa1480_setup;
  static ahc_device_setup_t ahc_aic7870_setup;
 +static ahc_device_setup_t ahc_aic7870h_setup;
  static ahc_device_setup_t ahc_aha394X_setup;
 +static ahc_device_setup_t ahc_aha394Xh_setup;
  static ahc_device_setup_t ahc_aha494X_setup;
 +static ahc_device_setup_t ahc_aha494Xh_setup;
  static ahc_device_setup_t ahc_aha398X_setup;
  static ahc_device_setup_t ahc_aic7880_setup;
 +static ahc_device_setup_t ahc_aic7880h_setup;
  static ahc_device_setup_t ahc_aha2940Pro_setup;
  static ahc_device_setup_t ahc_aha394XU_setup;
 +static ahc_device_setup_t ahc_aha394XUh_setup;
  static ahc_device_setup_t ahc_aha398XU_setup;
  static ahc_device_setup_t ahc_aic7890_setup;
  static ahc_device_setup_t ahc_aic7892_setup;
  static ahc_device_setup_t ahc_aic7895_setup;
 +static ahc_device_setup_t ahc_aic7895h_setup;
  static ahc_device_setup_t ahc_aic7896_setup;
  static ahc_device_setup_t ahc_aic7899_setup;
  static ahc_device_setup_t ahc_aha29160C_setup;
@@@ -231,19 -225,19 +231,19 @@@ struct ahc_pci_identity ahc_pci_ident_t
                ID_AHA_2944,
                ID_ALL_MASK,
                "Adaptec 2944 SCSI adapter",
 -              ahc_aic7870_setup
 +              ahc_aic7870h_setup
        },
        {
                ID_AHA_3944,
                ID_ALL_MASK,
                "Adaptec 3944 SCSI adapter",
 -              ahc_aha394X_setup
 +              ahc_aha394Xh_setup
        },
        {
                ID_AHA_4944,
                ID_ALL_MASK,
                "Adaptec 4944 SCSI adapter",
 -              ahc_aha494X_setup
 +              ahc_aha494Xh_setup
        },
        /* aic7880 based controllers */
        {
                ID_AHA_2944U & ID_DEV_VENDOR_MASK,
                ID_DEV_VENDOR_MASK,
                "Adaptec 2944 Ultra SCSI adapter",
 -              ahc_aic7880_setup
 +              ahc_aic7880h_setup
        },
        {
                ID_AHA_3944U & ID_DEV_VENDOR_MASK,
                ID_DEV_VENDOR_MASK,
                "Adaptec 3944 Ultra SCSI adapter",
 -              ahc_aha394XU_setup
 +              ahc_aha394XUh_setup
        },
        {
                ID_AHA_398XU & ID_DEV_VENDOR_MASK,
                ID_AHA_4944U & ID_DEV_VENDOR_MASK,
                ID_DEV_VENDOR_MASK,
                "Adaptec 4944 Ultra SCSI adapter",
 -              ahc_aic7880_setup
 +              ahc_aic7880h_setup
        },
        {
                ID_AHA_2930U & ID_DEV_VENDOR_MASK,
                ID_AHA_3944AU,
                ID_ALL_MASK,
                "Adaptec 3944A Ultra SCSI adapter",
 -              ahc_aic7895_setup
 +              ahc_aic7895h_setup
        },
        {
                ID_AIC7895_ARO,
        }
  };
  
 -const u_int ahc_num_pci_devs = NUM_ELEMENTS(ahc_pci_ident_table);
 +const u_int ahc_num_pci_devs = ARRAY_SIZE(ahc_pci_ident_table);
                
  #define AHC_394X_SLOT_CHANNEL_A       4
  #define AHC_394X_SLOT_CHANNEL_B       5
@@@ -2042,12 -2036,12 +2042,12 @@@ ahc_pci_resume(struct ahc_softc *ahc
         * that the OS doesn't know about and rely on our chip
         * reset handler to handle the rest.
         */
-       ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4,
-                            ahc->bus_softc.pci_softc.devconfig);
-       ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1,
-                            ahc->bus_softc.pci_softc.command);
-       ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1,
-                            ahc->bus_softc.pci_softc.csize_lattime);
+       ahc_pci_write_config(ahc->dev_softc, DEVCONFIG,
+                            ahc->bus_softc.pci_softc.devconfig, /*bytes*/4);
+       ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
+                            ahc->bus_softc.pci_softc.command, /*bytes*/1);
+       ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
+                            ahc->bus_softc.pci_softc.csize_lattime, /*bytes*/1);
        if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) {
                struct  seeprom_descriptor sd;
                u_int   sxfrctl1;
@@@ -2126,16 -2120,6 +2126,16 @@@ ahc_aic7870_setup(struct ahc_softc *ahc
        return (0);
  }
  
 +static int
 +ahc_aic7870h_setup(struct ahc_softc *ahc)
 +{
 +      int error = ahc_aic7870_setup(ahc);
 +
 +      ahc->features |= AHC_HVD;
 +
 +      return error;
 +}
 +
  static int
  ahc_aha394X_setup(struct ahc_softc *ahc)
  {
        return (error);
  }
  
 +static int
 +ahc_aha394Xh_setup(struct ahc_softc *ahc)
 +{
 +      int error = ahc_aha394X_setup(ahc);
 +
 +      ahc->features |= AHC_HVD;
 +
 +      return error;
 +}
 +
  static int
  ahc_aha398X_setup(struct ahc_softc *ahc)
  {
@@@ -2179,16 -2153,6 +2179,16 @@@ ahc_aha494X_setup(struct ahc_softc *ahc
        return (error);
  }
  
 +static int
 +ahc_aha494Xh_setup(struct ahc_softc *ahc)
 +{
 +      int error = ahc_aha494X_setup(ahc);
 +
 +      ahc->features |= AHC_HVD;
 +
 +      return error;
 +}
 +
  static int
  ahc_aic7880_setup(struct ahc_softc *ahc)
  {
        return (0);
  }
  
 +static int
 +ahc_aic7880h_setup(struct ahc_softc *ahc)
 +{
 +      int error = ahc_aic7880_setup(ahc);
 +
 +      ahc->features |= AHC_HVD;
 +
 +      return error;
 +}
 +
 +
  static int
  ahc_aha2940Pro_setup(struct ahc_softc *ahc)
  {
@@@ -2240,16 -2193,6 +2240,16 @@@ ahc_aha394XU_setup(struct ahc_softc *ah
        return (error);
  }
  
 +static int
 +ahc_aha394XUh_setup(struct ahc_softc *ahc)
 +{
 +      int error = ahc_aha394XU_setup(ahc);
 +
 +      ahc->features |= AHC_HVD;
 +
 +      return error;
 +}
 +
  static int
  ahc_aha398XU_setup(struct ahc_softc *ahc)
  {
@@@ -2348,16 -2291,6 +2348,16 @@@ ahc_aic7895_setup(struct ahc_softc *ahc
        return (0);
  }
  
 +static int
 +ahc_aic7895h_setup(struct ahc_softc *ahc)
 +{
 +      int error = ahc_aic7895_setup(ahc);
 +
 +      ahc->features |= AHC_HVD;
 +
 +      return error;
 +}
 +
  static int
  ahc_aic7896_setup(struct ahc_softc *ahc)
  {
@@@ -121,9 -121,10 +121,9 @@@ static int initialize_event_pool(struc
  
        pool->size = size;
        pool->next = 0;
 -      pool->events = kmalloc(pool->size * sizeof(*pool->events), GFP_KERNEL);
 +      pool->events = kcalloc(pool->size, sizeof(*pool->events), GFP_KERNEL);
        if (!pool->events)
                return -ENOMEM;
 -      memset(pool->events, 0x00, pool->size * sizeof(*pool->events));
  
        pool->iu_storage =
            dma_alloc_coherent(hostdata->dev,
@@@ -738,7 -739,8 +738,8 @@@ static void send_mad_adapter_info(struc
  {
        struct viosrp_adapter_info *req;
        struct srp_event_struct *evt_struct;
-       
+       dma_addr_t addr;
        evt_struct = get_event_struct(&hostdata->pool);
        if (!evt_struct) {
                printk(KERN_ERR "ibmvscsi: couldn't allocate an event "
        
        req->common.type = VIOSRP_ADAPTER_INFO_TYPE;
        req->common.length = sizeof(hostdata->madapter_info);
-       req->buffer = dma_map_single(hostdata->dev,
-                                    &hostdata->madapter_info,
-                                    sizeof(hostdata->madapter_info),
-                                    DMA_BIDIRECTIONAL);
+       req->buffer = addr = dma_map_single(hostdata->dev,
+                                           &hostdata->madapter_info,
+                                           sizeof(hostdata->madapter_info),
+                                           DMA_BIDIRECTIONAL);
  
        if (dma_mapping_error(req->buffer)) {
                printk(KERN_ERR
                return;
        }
        
-       if (ibmvscsi_send_srp_event(evt_struct, hostdata))
+       if (ibmvscsi_send_srp_event(evt_struct, hostdata)) {
                printk(KERN_ERR "ibmvscsi: couldn't send ADAPTER_INFO_REQ!\n");
+               dma_unmap_single(hostdata->dev,
+                                addr,
+                                sizeof(hostdata->madapter_info),
+                                DMA_BIDIRECTIONAL);
+       }
  };
  
  /**
@@@ -1258,6 -1265,7 +1264,7 @@@ static int ibmvscsi_do_host_config(stru
  {
        struct viosrp_host_config *host_config;
        struct srp_event_struct *evt_struct;
+       dma_addr_t addr;
        int rc;
  
        evt_struct = get_event_struct(&hostdata->pool);
        memset(host_config, 0x00, sizeof(*host_config));
        host_config->common.type = VIOSRP_HOST_CONFIG_TYPE;
        host_config->common.length = length;
-       host_config->buffer = dma_map_single(hostdata->dev, buffer, length,
-                                           DMA_BIDIRECTIONAL);
+       host_config->buffer = addr = dma_map_single(hostdata->dev, buffer,
+                                                   length,
+                                                   DMA_BIDIRECTIONAL);
  
        if (dma_mapping_error(host_config->buffer)) {
                printk(KERN_ERR
  
        init_completion(&evt_struct->comp);
        rc = ibmvscsi_send_srp_event(evt_struct, hostdata);
-       if (rc == 0) {
+       if (rc == 0)
                wait_for_completion(&evt_struct->comp);
-               dma_unmap_single(hostdata->dev, host_config->buffer,
-                                length, DMA_BIDIRECTIONAL);
-       }
+       dma_unmap_single(hostdata->dev, addr, length, DMA_BIDIRECTIONAL);
  
        return rc;
  }
diff --combined drivers/scsi/megaraid.c
@@@ -524,7 -524,7 +524,7 @@@ mega_build_cmd(adapter_t *adapter, Scsi
         * filter the internal and ioctl commands
         */
        if((cmd->cmnd[0] == MEGA_INTERNAL_CMD)) {
 -              return cmd->buffer;
 +              return cmd->request_buffer;
        }
  
  
@@@ -4471,7 -4471,6 +4471,6 @@@ mega_internal_command(adapter_t *adapte
  {
        Scsi_Cmnd       *scmd;
        struct  scsi_device *sdev;
-       unsigned long   flags = 0;
        scb_t   *scb;
        int     rval;
  
        scmd->device = sdev;
  
        scmd->device->host = adapter->host;
 -      scmd->buffer = (void *)scb;
 +      scmd->request_buffer = (void *)scb;
        scmd->cmnd[0] = MEGA_INTERNAL_CMD;
  
        scb->state |= SCB_ACTIVE;
@@@ -54,6 -54,13 +54,6 @@@ module_param(ql2xloginretrycount, int, 
  MODULE_PARM_DESC(ql2xloginretrycount,
                "Specify an alternate value for the NVRAM login retry count.");
  
 -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
 -int ql2xfwloadflash;
 -module_param(ql2xfwloadflash, int, S_IRUGO|S_IRUSR);
 -MODULE_PARM_DESC(ql2xfwloadflash,
 -              "Load ISP24xx firmware image from FLASH (onboard memory).");
 -#endif
 -
  static void qla2x00_free_device(scsi_qla_host_t *);
  
  static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@@ -64,6 -71,12 +64,6 @@@ MODULE_PARM_DESC(ql2xfdmienable
                "Enables FDMI registratons "
                "Default is 0 - no FDMI. 1 - perfom FDMI.");
  
 -int ql2xprocessrscn;
 -module_param(ql2xprocessrscn, int, S_IRUGO|S_IRUSR);
 -MODULE_PARM_DESC(ql2xprocessrscn,
 -              "Option to enable port RSCN handling via a series of less"
 -              "fabric intrusive ADISCs and PLOGIs.");
 -
  /*
   * SCSI host template entry points
   */
@@@ -86,7 -99,7 +86,7 @@@ static int qla2x00_change_queue_type(st
  
  static struct scsi_host_template qla2x00_driver_template = {
        .module                 = THIS_MODULE,
 -      .name                   = "qla2xxx",
 +      .name                   = QLA2XXX_DRIVER_NAME,
        .queuecommand           = qla2x00_queuecommand,
  
        .eh_abort_handler       = qla2xxx_eh_abort,
  
  static struct scsi_host_template qla24xx_driver_template = {
        .module                 = THIS_MODULE,
 -      .name                   = "qla2xxx",
 +      .name                   = QLA2XXX_DRIVER_NAME,
        .queuecommand           = qla24xx_queuecommand,
  
        .eh_abort_handler       = qla2xxx_eh_abort,
@@@ -327,6 -340,7 +327,6 @@@ qla2x00_get_new_sp(scsi_qla_host_t *ha
        if (!sp)
                return sp;
  
 -      atomic_set(&sp->ref_count, 1);
        sp->ha = ha;
        sp->fcport = fcport;
        sp->cmd = cmd;
@@@ -563,10 -577,6 +563,10 @@@ qla2x00_wait_for_loop_ready(scsi_qla_ho
        while ((!atomic_read(&ha->loop_down_timer) &&
            atomic_read(&ha->loop_state) == LOOP_DOWN) ||
            atomic_read(&ha->loop_state) != LOOP_READY) {
 +              if (atomic_read(&ha->loop_state) == LOOP_DEAD) {
 +                      return_status = QLA_FUNCTION_FAILED;
 +                      break;
 +              }
                msleep(1000);
                if (time_after_eq(jiffies, loop_timeout)) {
                        return_status = QLA_FUNCTION_FAILED;
  *    Either SUCCESS or FAILED.
  *
  * Note:
+ *    Only return FAILED if command not returned by firmware.
  **************************************************************************/
  int
  qla2xxx_eh_abort(struct scsi_cmnd *cmd)
        unsigned int id, lun;
        unsigned long serial;
        unsigned long flags;
+       int wait = 0;
  
        if (!CMD_SP(cmd))
-               return FAILED;
+               return SUCCESS;
  
-       ret = FAILED;
+       ret = SUCCESS;
  
        id = cmd->device->id;
        lun = cmd->device->lun;
                if (sp->cmd != cmd)
                        continue;
  
 -              DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld "
 -                  "sp->state=%x\n", __func__, ha->host_no, sp, serial,
 -                  sp->state));
 +              DEBUG2(printk("%s(%ld): aborting sp %p from RISC. pid=%ld.\n",
 +                  __func__, ha->host_no, sp, serial));
                DEBUG3(qla2x00_print_scsi_cmd(cmd);)
  
                spin_unlock_irqrestore(&ha->hardware_lock, flags);
                } else {
                        DEBUG3(printk("%s(%ld): abort_command "
                            "mbx success.\n", __func__, ha->host_no));
-                       ret = SUCCESS;
+                       wait = 1;
                }
                spin_lock_irqsave(&ha->hardware_lock, flags);
  
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
  
        /* Wait for the command to be returned. */
-       if (ret == SUCCESS) {
+       if (wait) {
                if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
                        qla_printk(KERN_ERR, ha,
                            "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
                            "%x.\n", ha->host_no, id, lun, serial, ret);
+                       ret = FAILED;
                }
        }
  
        qla_printk(KERN_INFO, ha,
-           "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no,
-           id, lun, serial, ret);
+           "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n",
+           ha->host_no, id, lun, wait, serial, ret);
  
        return ret;
  }
@@@ -1143,22 -1157,18 +1146,22 @@@ qla2x00_set_isp_flags(scsi_qla_host_t *
        case PCI_DEVICE_ID_QLOGIC_ISP2100:
                ha->device_type |= DT_ISP2100;
                ha->device_type &= ~DT_EXTENDED_IDS;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2100;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP2200:
                ha->device_type |= DT_ISP2200;
                ha->device_type &= ~DT_EXTENDED_IDS;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2100;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP2300:
                ha->device_type |= DT_ISP2300;
                ha->device_type |= DT_ZIO_SUPPORTED;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2300;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP2312:
                ha->device_type |= DT_ISP2312;
                ha->device_type |= DT_ZIO_SUPPORTED;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2300;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP2322:
                ha->device_type |= DT_ISP2322;
                if (ha->pdev->subsystem_vendor == 0x1028 &&
                    ha->pdev->subsystem_device == 0x0170)
                        ha->device_type |= DT_OEM_001;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2300;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP6312:
                ha->device_type |= DT_ISP6312;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2300;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP6322:
                ha->device_type |= DT_ISP6322;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2300;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP2422:
                ha->device_type |= DT_ISP2422;
                ha->device_type |= DT_ZIO_SUPPORTED;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2400;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP2432:
                ha->device_type |= DT_ISP2432;
                ha->device_type |= DT_ZIO_SUPPORTED;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2400;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP5422:
                ha->device_type |= DT_ISP5422;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2400;
                break;
        case PCI_DEVICE_ID_QLOGIC_ISP5432:
                ha->device_type |= DT_ISP5432;
 +              ha->fw_srisc_address = RISC_START_ADDRESS_2400;
                break;
        }
  }
@@@ -1239,7 -1242,7 +1242,7 @@@ qla2x00_iospace_config(scsi_qla_host_t 
                goto iospace_error_exit;
        }
  
 -      if (pci_request_regions(ha->pdev, ha->brd_info->drv_name)) {
 +      if (pci_request_regions(ha->pdev, QLA2XXX_DRIVER_NAME)) {
                qla_printk(KERN_WARNING, ha,
                    "Failed to reserve PIO/MMIO regions (%s)\n",
                    pci_name(ha->pdev));
@@@ -1321,7 -1324,7 +1324,7 @@@ qla24xx_disable_intrs(scsi_qla_host_t *
  /*
   * PCI driver interface
   */
 -int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
 +static int qla2x00_probe_one(struct pci_dev *pdev)
  {
        int     ret = -ENODEV;
        device_reg_t __iomem *reg;
        ha->pdev = pdev;
        ha->host = host;
        ha->host_no = host->host_no;
 -      ha->brd_info = brd_info;
 -      sprintf(ha->host_str, "%s_%ld", ha->brd_info->drv_name, ha->host_no);
 +      sprintf(ha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, ha->host_no);
  
        /* Set ISP-type information. */
        qla2x00_set_isp_flags(ha);
        spin_lock_init(&ha->hardware_lock);
  
        ha->prev_topology = 0;
 -      ha->ports = MAX_BUSES;
        ha->init_cb_size = sizeof(init_cb_t);
        ha->mgmt_svr_loop_id = MANAGEMENT_SERVER;
        ha->link_data_rate = LDR_UNKNOWN;
                ha->isp_ops.nvram_config = qla24xx_nvram_config;
                ha->isp_ops.update_fw_options = qla24xx_update_fw_options;
                ha->isp_ops.load_risc = qla24xx_load_risc;
 -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
 -              if (ql2xfwloadflash)
 -                      ha->isp_ops.load_risc = qla24xx_load_risc_flash;
 -#endif
                ha->isp_ops.pci_info_str = qla24xx_pci_info_str;
                ha->isp_ops.fw_version_str = qla24xx_fw_version_str;
                ha->isp_ops.intr_handler = qla24xx_intr_handler;
  
        INIT_LIST_HEAD(&ha->list);
        INIT_LIST_HEAD(&ha->fcports);
 -      INIT_LIST_HEAD(&ha->rscn_fcports);
  
        /*
         * These locks are used to prevent more than one CPU
        host->cmd_per_lun = 3;
        host->unique_id = ha->instance;
        host->max_cmd_len = MAX_CMDSZ;
 -      host->max_channel = ha->ports - 1;
 +      host->max_channel = MAX_BUSES - 1;
        host->max_lun = MAX_LUNS;
        host->transportt = qla2xxx_transport_template;
  
        ret = request_irq(pdev->irq, ha->isp_ops.intr_handler,
 -          SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
 +          SA_INTERRUPT|SA_SHIRQ, QLA2XXX_DRIVER_NAME, ha);
        if (ret) {
                qla_printk(KERN_WARNING, ha,
                    "Failed to reserve interrupt %d already in use.\n",
@@@ -1636,8 -1646,9 +1639,8 @@@ probe_disable_device
  probe_out:
        return ret;
  }
 -EXPORT_SYMBOL_GPL(qla2x00_probe_one);
  
 -void qla2x00_remove_one(struct pci_dev *pdev)
 +static void qla2x00_remove_one(struct pci_dev *pdev)
  {
        scsi_qla_host_t *ha;
  
  
        pci_set_drvdata(pdev, NULL);
  }
 -EXPORT_SYMBOL_GPL(qla2x00_remove_one);
  
  static void
  qla2x00_free_device(scsi_qla_host_t *ha)
  {
 -      /* Abort any outstanding IO descriptors. */
 -      if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
 -              qla2x00_cancel_io_descriptors(ha);
 -
        /* Disable timer */
        if (ha->timer_active)
                qla2x00_stop_timer(ha);
        ha->flags.online = 0;
  
        /* Detach interrupts */
-       if (ha->pdev->irq)
-               free_irq(ha->pdev->irq, ha);
+       if (ha->host->irq)
+               free_irq(ha->host->irq, ha);
  
        /* release io space registers  */
        if (ha->iobase)
@@@ -1868,8 -1884,19 +1871,8 @@@ qla2x00_mem_alloc(scsi_qla_host_t *ha
                        continue;
                }
  
 -              ha->rlc_rsp = dma_alloc_coherent(&ha->pdev->dev,
 -                  sizeof(rpt_lun_cmd_rsp_t), &ha->rlc_rsp_dma, GFP_KERNEL);
 -              if (ha->rlc_rsp == NULL) {
 -                      qla_printk(KERN_WARNING, ha,
 -                              "Memory Allocation failed - rlc");
 -
 -                      qla2x00_mem_free(ha);
 -                      msleep(100);
 -
 -                      continue;
 -              }
 -
 -              snprintf(name, sizeof(name), "qla2xxx_%ld", ha->host_no);
 +              snprintf(name, sizeof(name), "%s_%ld", QLA2XXX_DRIVER_NAME,
 +                  ha->host_no);
                ha->s_dma_pool = dma_pool_create(name, &ha->pdev->dev,
                    DMA_POOL_SIZE, 8, 0);
                if (ha->s_dma_pool == NULL) {
                }
                memset(ha->init_cb, 0, ha->init_cb_size);
  
 -              /* Get consistent memory allocated for Get Port Database cmd */
 -              ha->iodesc_pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL,
 -                  &ha->iodesc_pd_dma);
 -              if (ha->iodesc_pd == NULL) {
 -                      /* error */
 -                      qla_printk(KERN_WARNING, ha,
 -                          "Memory Allocation failed - iodesc_pd\n");
 -
 -                      qla2x00_mem_free(ha);
 -                      msleep(100);
 -
 -                      continue;
 -              }
 -              memset(ha->iodesc_pd, 0, PORT_DATABASE_SIZE);
 -
                /* Allocate ioctl related memory. */
                if (qla2x00_alloc_ioctl_mem(ha)) {
                        qla_printk(KERN_WARNING, ha,
@@@ -2020,12 -2062,20 +2023,12 @@@ qla2x00_mem_free(scsi_qla_host_t *ha
        if (ha->ms_iocb)
                dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma);
  
 -      if (ha->iodesc_pd)
 -              dma_pool_free(ha->s_dma_pool, ha->iodesc_pd, ha->iodesc_pd_dma);
 -
        if (ha->init_cb)
                dma_pool_free(ha->s_dma_pool, ha->init_cb, ha->init_cb_dma);
  
        if (ha->s_dma_pool)
                dma_pool_destroy(ha->s_dma_pool);
  
 -      if (ha->rlc_rsp)
 -              dma_free_coherent(&ha->pdev->dev,
 -                  sizeof(rpt_lun_cmd_rsp_t), ha->rlc_rsp,
 -                  ha->rlc_rsp_dma);
 -
        if (ha->gid_list)
                dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list,
                    ha->gid_list_dma);
        ha->ct_sns_dma = 0;
        ha->ms_iocb = NULL;
        ha->ms_iocb_dma = 0;
 -      ha->iodesc_pd = NULL;
 -      ha->iodesc_pd_dma = 0;
        ha->init_cb = NULL;
        ha->init_cb_dma = 0;
  
        ha->s_dma_pool = NULL;
  
 -      ha->rlc_rsp = NULL;
 -      ha->rlc_rsp_dma = 0;
        ha->gid_list = NULL;
        ha->gid_list_dma = 0;
  
        }
        INIT_LIST_HEAD(&ha->fcports);
  
 -      if (ha->fw_dump)
 -              free_pages((unsigned long)ha->fw_dump, ha->fw_dump_order);
 -
 -      vfree(ha->fw_dump24);
 -
 +      vfree(ha->fw_dump);
        vfree(ha->fw_dump_buffer);
  
        ha->fw_dump = NULL;
 -      ha->fw_dump24 = NULL;
        ha->fw_dumped = 0;
        ha->fw_dump_reading = 0;
        ha->fw_dump_buffer = NULL;
   *
   * Context:
   *      Kernel context.
 - *
 - * Note: Sets the ref_count for non Null sp to one.
   */
  static int
  qla2x00_allocate_sp_pool(scsi_qla_host_t *ha)
@@@ -2532,6 -2593,14 +2535,6 @@@ qla2x00_down_timeout(struct semaphore *
        return -ETIMEDOUT;
  }
  
 -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
 -
 -#define qla2x00_release_firmware()    do { } while (0)
 -#define qla2x00_pci_module_init()     (0)
 -#define qla2x00_pci_module_exit()     do { } while (0)
 -
 -#else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */
 -
  /* Firmware interface routines. */
  
  #define FW_BLOBS      5
@@@ -2598,18 -2667,33 +2601,18 @@@ qla2x00_release_firmware(void
        up(&qla_fw_lock);
  }
  
 -static struct qla_board_info qla_board_tbl = {
 -      .drv_name       = "qla2xxx",
 -};
 -
  static struct pci_device_id qla2xxx_pci_tbl[] = {
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2300,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2312,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2322,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6312,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2300) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2312) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2322) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6312) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP6322) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2422) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) },
        { 0 },
  };
  MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);
  static int __devinit
  qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
  {
 -      return qla2x00_probe_one(pdev, &qla_board_tbl);
 +      return qla2x00_probe_one(pdev);
  }
  
  static void __devexit
@@@ -2627,7 -2711,7 +2630,7 @@@ qla2xxx_remove_one(struct pci_dev *pdev
  }
  
  static struct pci_driver qla2xxx_pci_driver = {
 -      .name           = "qla2xxx",
 +      .name           = QLA2XXX_DRIVER_NAME,
        .driver         = {
                .owner          = THIS_MODULE,
        },
@@@ -2648,6 -2732,8 +2651,6 @@@ qla2x00_pci_module_exit(void
        pci_unregister_driver(&qla2xxx_pci_driver);
  }
  
 -#endif
 -
  /**
   * qla2x00_module_init - Module initialization.
   **/
@@@ -2667,6 -2753,9 +2670,6 @@@ qla2x00_module_init(void
  
        /* Derive version string. */
        strcpy(qla2x00_version_str, QLA2XXX_VERSION);
 -#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
 -      strcat(qla2x00_version_str, "-fw");
 -#endif
  #if DEBUG_QLA2100
        strcat(qla2x00_version_str, "-debug");
  #endif
@@@ -56,6 -56,8 +56,8 @@@ static struct 
        {"DENON", "DRD-25X", "V", BLIST_NOLUN},                 /* locks up */
        {"HITACHI", "DK312C", "CM81", BLIST_NOLUN},     /* responds to all lun */
        {"HITACHI", "DK314C", "CR21", BLIST_NOLUN},     /* responds to all lun */
+       {"IBM", "2104-DU3", NULL, BLIST_NOLUN},         /* locks up */
+       {"IBM", "2104-TU3", NULL, BLIST_NOLUN},         /* locks up */
        {"IMS", "CDD521/10", "2.06", BLIST_NOLUN},      /* locks up */
        {"MAXTOR", "XT-3280", "PR02", BLIST_NOLUN},     /* locks up */
        {"MAXTOR", "XT-4380S", "B3C", BLIST_NOLUN},     /* locks up */
        {"HITACHI", "DF400", "*", BLIST_SPARSELUN},
        {"HITACHI", "DF500", "*", BLIST_SPARSELUN},
        {"HITACHI", "DF600", "*", BLIST_SPARSELUN},
 +      {"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
 +      {"HITACHI", "OPEN-E", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
        {"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN},       /* HP VA7400 */
        {"HP", "OPEN-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP XP Arrays */
        {"HP", "NetRAID-4M", NULL, BLIST_FORCELUN},
        {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
        {"HP", "C1557A", NULL, BLIST_FORCELUN},
        {"HP", "C3323-300", "4269", BLIST_NOTQ},
+       {"HP", "C5713A", NULL, BLIST_NOREPORTLUN},
        {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
        {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
        {"IBM", "2105", NULL, BLIST_RETRY_HWERROR},
diff --combined drivers/scsi/scsi_lib.c
@@@ -30,7 -30,7 +30,7 @@@
  #include "scsi_logging.h"
  
  
 -#define SG_MEMPOOL_NR         (sizeof(scsi_sg_pools)/sizeof(struct scsi_host_sg_pool))
 +#define SG_MEMPOOL_NR         ARRAY_SIZE(scsi_sg_pools)
  #define SG_MEMPOOL_SIZE               32
  
  struct scsi_host_sg_pool {
@@@ -367,7 -367,7 +367,7 @@@ static int scsi_req_map_sg(struct reque
                           int nsegs, unsigned bufflen, gfp_t gfp)
  {
        struct request_queue *q = rq->q;
-       int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT;
+       int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
        unsigned int data_len = 0, len, bytes, off;
        struct page *page;
        struct bio *bio = NULL;
@@@ -1067,16 -1067,29 +1067,29 @@@ void scsi_io_completion(struct scsi_cmn
                        break;
                case NOT_READY:
                        /*
-                        * If the device is in the process of becoming ready,
-                        * retry.
+                        * If the device is in the process of becoming
+                        * ready, or has a temporary blockage, retry.
                         */
-                       if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) {
-                               scsi_requeue_command(q, cmd);
-                               return;
+                       if (sshdr.asc == 0x04) {
+                               switch (sshdr.ascq) {
+                               case 0x01: /* becoming ready */
+                               case 0x04: /* format in progress */
+                               case 0x05: /* rebuild in progress */
+                               case 0x06: /* recalculation in progress */
+                               case 0x07: /* operation in progress */
+                               case 0x08: /* Long write in progress */
+                               case 0x09: /* self test in progress */
+                                       scsi_requeue_command(q, cmd);
+                                       return;
+                               default:
+                                       break;
+                               }
                        }
-                       if (!(req->flags & REQ_QUIET))
+                       if (!(req->flags & REQ_QUIET)) {
                                scmd_printk(KERN_INFO, cmd,
-                                          "Device not ready.\n");
+                                          "Device not ready: ");
+                               scsi_print_sense_hdr("", &sshdr);
+                       }
                        scsi_end_request(cmd, 0, this_count, 1);
                        return;
                case VOLUME_OVERFLOW:
@@@ -2350,61 -2363,3 +2363,61 @@@ scsi_target_unblock(struct device *dev
                device_for_each_child(dev, NULL, target_unblock);
  }
  EXPORT_SYMBOL_GPL(scsi_target_unblock);
 +
 +/**
 + * scsi_kmap_atomic_sg - find and atomically map an sg-elemnt
 + * @sg:               scatter-gather list
 + * @sg_count: number of segments in sg
 + * @offset:   offset in bytes into sg, on return offset into the mapped area
 + * @len:      bytes to map, on return number of bytes mapped
 + *
 + * Returns virtual address of the start of the mapped page
 + */
 +void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
 +                        size_t *offset, size_t *len)
 +{
 +      int i;
 +      size_t sg_len = 0, len_complete = 0;
 +      struct page *page;
 +
 +      for (i = 0; i < sg_count; i++) {
 +              len_complete = sg_len; /* Complete sg-entries */
 +              sg_len += sg[i].length;
 +              if (sg_len > *offset)
 +                      break;
 +      }
 +
 +      if (unlikely(i == sg_count)) {
 +              printk(KERN_ERR "%s: Bytes in sg: %zu, requested offset %zu, "
 +                      "elements %d\n",
 +                     __FUNCTION__, sg_len, *offset, sg_count);
 +              WARN_ON(1);
 +              return NULL;
 +      }
 +
 +      /* Offset starting from the beginning of first page in this sg-entry */
 +      *offset = *offset - len_complete + sg[i].offset;
 +
 +      /* Assumption: contiguous pages can be accessed as "page + i" */
 +      page = nth_page(sg[i].page, (*offset >> PAGE_SHIFT));
 +      *offset &= ~PAGE_MASK;
 +
 +      /* Bytes in this sg-entry from *offset to the end of the page */
 +      sg_len = PAGE_SIZE - *offset;
 +      if (*len > sg_len)
 +              *len = sg_len;
 +
 +      return kmap_atomic(page, KM_BIO_SRC_IRQ);
 +}
 +EXPORT_SYMBOL(scsi_kmap_atomic_sg);
 +
 +/**
 + * scsi_kunmap_atomic_sg - atomically unmap a virtual address, previously
 + *                       mapped with scsi_kmap_atomic_sg
 + * @virt:     virtual address to be unmapped
 + */
 +void scsi_kunmap_atomic_sg(void *virt)
 +{
 +      kunmap_atomic(virt, KM_BIO_SRC_IRQ);
 +}
 +EXPORT_SYMBOL(scsi_kunmap_atomic_sg);
@@@ -65,7 -65,7 +65,7 @@@ get_sas_##title##_names(u32 table_key, 
        ssize_t len = 0;                                        \
        int i;                                                  \
                                                                \
 -      for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) {  \
 +      for (i = 0; i < ARRAY_SIZE(table); i++) {               \
                if (table[i].value & table_key) {               \
                        len += sprintf(buf + len, "%s%s",       \
                                prefix, table[i].name);         \
@@@ -83,7 -83,7 +83,7 @@@ get_sas_##title##_names(u32 table_key, 
        ssize_t len = 0;                                        \
        int i;                                                  \
                                                                \
 -      for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) {  \
 +      for (i = 0; i < ARRAY_SIZE(table); i++) {               \
                if (table[i].value == table_key) {              \
                        len += sprintf(buf + len, "%s",         \
                                table[i].name);                 \
@@@ -955,7 -955,8 +955,8 @@@ static int sas_user_scan(struct Scsi_Ho
        list_for_each_entry(rphy, &sas_host->rphy_list, list) {
                struct sas_phy *parent = dev_to_phy(rphy->dev.parent);
  
-               if (rphy->scsi_target_id == -1)
+               if (rphy->identify.device_type != SAS_END_DEVICE ||
+                   rphy->scsi_target_id == -1)
                        continue;
  
                if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) &&
  #define SETUP_TEMPLATE(attrb, field, perm, test)                              \
        i->private_##attrb[count] = class_device_attr_##field;          \
        i->private_##attrb[count].attr.mode = perm;                     \
-       i->private_##attrb[count].store = NULL;                         \
        i->attrb[count] = &i->private_##attrb[count];                   \
        if (test)                                                       \
                count++
diff --combined drivers/scsi/st.c
@@@ -3839,7 -3839,7 +3839,7 @@@ static int __init st_setup(char *str
                                        break;
                                }
                        }
 -                      if (i >= sizeof(parms) / sizeof(struct st_dev_parm))
 +                      if (i >= ARRAY_SIZE(parms))
                                 printk(KERN_WARNING "st: invalid parameter in '%s'\n",
                                        stp);
                        stp = strchr(stp, ',');
@@@ -4054,7 -4054,7 +4054,7 @@@ static int st_probe(struct device *dev
        }
  
        sdev_printk(KERN_WARNING, SDp,
-                   "Attached scsi tape %s", tape_name(tpnt));
+                   "Attached scsi tape %s\n", tape_name(tpnt));
        printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n",
               tape_name(tpnt), tpnt->try_dio ? "yes" : "no",
               queue_dma_alignment(SDp->request_queue) + 1);