]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Jun 2015 21:08:54 +0000 (14:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 23 Jun 2015 21:08:54 +0000 (14:08 -0700)
Pull trivial tree updates from Jiri Kosina:
 "As usual, mostly comment, kerneldoc and printk() fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
  lpfc: Grammar s/an negative/a negative/
  ARM: lib/lib1funcs.S: fix typo s/substractions/subtractions/
  cx25821: cx25821-medusa-reg.h: fix 0x0x prefix
  lib: crc-itu-t.[ch] fix 0x0x prefix in integer constants
  rapidio: Fix kerneldoc and comment
  qla4xxx: Fix printk() in qla4_83xx_read_reset_template() and qla4_83xx_pre_loopback_config()
  treewide: Kconfig: fix wording / spelling
  usb/serial: fix grammar in Kconfig help text for FTDI_SIO
  megaraid_sas: fix kerneldoc
  netfilter: ebtables: fix comment grammar
  drm/radeon: fix comment
  isdn: fix grammar in comment
  ARM: KVM: fix comment

13 files changed:
1  2 
arch/arm/include/asm/kvm_asm.h
arch/arm64/include/asm/kvm_asm.h
arch/xtensa/Kconfig
drivers/isdn/i4l/isdn_net.c
drivers/platform/x86/Kconfig
drivers/scsi/Kconfig
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fusion.c
drivers/usb/serial/Kconfig
include/linux/netfilter_bridge/ebtables.h
include/uapi/linux/netfilter_bridge/ebtables.h
net/bridge/netfilter/ebtables.c

index 25410b2d8bc1046ccf08749fca4d5ea29a6ec1c7,6b9e5a27ab2d9ca19c38afd859a51a41c7758640..194c91b610ffecfd4071da89d16b923c614bf68d
@@@ -23,7 -23,7 +23,7 @@@
  #define c0_MPIDR      1       /* MultiProcessor ID Register */
  #define c0_CSSELR     2       /* Cache Size Selection Register */
  #define c1_SCTLR      3       /* System Control Register */
- #define c1_ACTLR      4       /* Auxilliary Control Register */
+ #define c1_ACTLR      4       /* Auxiliary Control Register */
  #define c1_CPACR      5       /* Coprocessor Access Control */
  #define c2_TTBR0      6       /* Translation Table Base Register 0 */
  #define c2_TTBR0_high 7       /* TTBR0 top 32 bits */
@@@ -96,7 -96,6 +96,7 @@@ extern char __kvm_hyp_code_end[]
  
  extern void __kvm_flush_vm_context(void);
  extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
 +extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
  
  extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
  #endif
index 4f7310fa77f01acd8084b16e52f9df3fce8c4091,7e04f6ab3d5ec14453071f504532c2cfedb19da4..c4c11d20ca172cf77da555fbdf87f452db2cb640
@@@ -27,7 -27,7 +27,7 @@@
  #define       MPIDR_EL1       1       /* MultiProcessor Affinity Register */
  #define       CSSELR_EL1      2       /* Cache Size Selection Register */
  #define       SCTLR_EL1       3       /* System Control Register */
- #define       ACTLR_EL1       4       /* Auxilliary Control Register */
+ #define       ACTLR_EL1       4       /* Auxiliary Control Register */
  #define       CPACR_EL1       5       /* Coprocessor Access Control */
  #define       TTBR0_EL1       6       /* Translation Table Base Register 0 */
  #define       TTBR1_EL1       7       /* Translation Table Base Register 1 */
@@@ -126,7 -126,6 +126,7 @@@ extern char __kvm_hyp_vector[]
  
  extern void __kvm_flush_vm_context(void);
  extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
 +extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
  
  extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
  
diff --combined arch/xtensa/Kconfig
index 87be10e8b57aa00830172c33fc4eb8acacb65233,7d5d9fd291fd9adb15e63c24c63d90a1ffb6ec68..e5b872ba24843ee84ee65346dd87ab79abb6141b
@@@ -98,6 -98,12 +98,6 @@@ config XTENSA_VARIANT_DC233
        help
          This variant refers to Tensilica's Diamond 233L Standard core Rev.C (LE).
  
 -config XTENSA_VARIANT_S6000
 -      bool "s6000 - Stretch software configurable processor"
 -      select VARIANT_IRQ_SWITCH
 -      select ARCH_REQUIRE_GPIOLIB
 -      select XTENSA_CALIBRATE_CCOUNT
 -
  config XTENSA_VARIANT_CUSTOM
        bool "Custom Xtensa processor configuration"
        select MAY_HAVE_SMP
@@@ -120,6 -126,7 +120,6 @@@ config XTENSA_VARIANT_NAM
        default "dc232b"                        if XTENSA_VARIANT_DC232B
        default "dc233c"                        if XTENSA_VARIANT_DC233C
        default "fsf"                           if XTENSA_VARIANT_FSF
 -      default "s6000"                         if XTENSA_VARIANT_S6000
        default XTENSA_VARIANT_CUSTOM_NAME      if XTENSA_VARIANT_CUSTOM
  
  config XTENSA_VARIANT_MMU
@@@ -151,7 -158,7 +151,7 @@@ config HAVE_SM
          the CPU core definition and currently needs to be selected manually.
  
          Multiprocessor support in implemented with external cache and
-         interrupt controlers.
+         interrupt controllers.
  
          The MX interrupt distributer adds Interprocessor Interrupts
          and causes the IRQ numbers to be increased by 4 for devices
@@@ -184,6 -191,7 +184,6 @@@ config HOTPLUG_CP
  
  config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
        bool "Initialize Xtensa MMU inside the Linux kernel code"
 -      depends on MMU
        default y
        help
          Earlier version initialized the MMU in the exception vector
@@@ -303,10 -311,15 +303,10 @@@ config XTENSA_PLATFORM_XT200
          XT2000 is the name of Tensilica's feature-rich emulation platform.
          This hardware is capable of running a full Linux distribution.
  
 -config XTENSA_PLATFORM_S6105
 -      bool "S6105"
 -      select HAVE_IDE
 -      select SERIAL_CONSOLE
 -      select NO_IOPORT_MAP
 -
  config XTENSA_PLATFORM_XTFPGA
        bool "XTFPGA"
        select ETHOC if ETHERNET
 +      select PLATFORM_WANT_DEFAULT_MEM
        select SERIAL_CONSOLE
        select XTENSA_CALIBRATE_CCOUNT
        help
@@@ -393,71 -406,6 +393,71 @@@ source "drivers/pcmcia/Kconfig
  
  source "drivers/pci/hotplug/Kconfig"
  
 +config PLATFORM_WANT_DEFAULT_MEM
 +      def_bool n
 +
 +config DEFAULT_MEM_START
 +      hex "Physical address of the default memory area start"
 +      depends on PLATFORM_WANT_DEFAULT_MEM
 +      default 0x00000000 if MMU
 +      default 0x40000000 if !MMU
 +      help
 +        This is a fallback start address of the default memory area, it is
 +        used when no physical memory size is passed through DTB or through
 +        boot parameter from bootloader.
 +
 +        In noMMU configuration the following parameters are derived from it:
 +        - kernel load address;
 +        - kernel entry point address;
 +        - relocatable vectors base address;
 +        - uBoot load address;
 +        - TASK_SIZE.
 +
 +        If unsure, leave the default value here.
 +
 +config DEFAULT_MEM_SIZE
 +      hex "Maximal size of the default memory area"
 +      depends on PLATFORM_WANT_DEFAULT_MEM
 +      default 0x04000000
 +      help
 +        This is a fallback size of the default memory area, it is used when
 +        no physical memory size is passed through DTB or through boot
 +        parameter from bootloader.
 +
 +        It's also used for TASK_SIZE calculation in noMMU configuration.
 +
 +        If unsure, leave the default value here.
 +
 +config XTFPGA_LCD
 +      bool "Enable XTFPGA LCD driver"
 +      depends on XTENSA_PLATFORM_XTFPGA
 +      default n
 +      help
 +        There's a 2x16 LCD on most of XTFPGA boards, kernel may output
 +        progress messages there during bootup/shutdown. It may be useful
 +        during board bringup.
 +
 +        If unsure, say N.
 +
 +config XTFPGA_LCD_BASE_ADDR
 +      hex "XTFPGA LCD base address"
 +      depends on XTFPGA_LCD
 +      default "0x0d0c0000"
 +      help
 +        Base address of the LCD controller inside KIO region.
 +        Different boards from XTFPGA family have LCD controller at different
 +        addresses. Please consult prototyping user guide for your board for
 +        the correct address. Wrong address here may lead to hardware lockup.
 +
 +config XTFPGA_LCD_8BIT_ACCESS
 +      bool "Use 8-bit access to XTFPGA LCD"
 +      depends on XTFPGA_LCD
 +      default n
 +      help
 +        LCD may be connected with 4- or 8-bit interface, 8-bit access may
 +        only be used with 8-bit interface. Please consult prototyping user
 +        guide for your board for the correct interface width.
 +
  endmenu
  
  menu "Executable file formats"
@@@ -466,12 -414,6 +466,12 @@@ source "fs/Kconfig.binfmt
  
  endmenu
  
 +menu "Power management options"
 +
 +source "kernel/power/Kconfig"
 +
 +endmenu
 +
  source "net/Kconfig"
  
  source "drivers/Kconfig"
index 546b7e81161dd21df253aa7d5f0f41722a30c15e,c79adebc3743cdd98fe7e0efce08932b377eb272..aa5dd5668528912ec1f402deea49951fe8e15ff2
@@@ -58,7 -58,7 +58,7 @@@
   * About SOFTNET:
   * Most of the changes were pretty obvious and basically done by HE already.
   *
-  * One problem of the isdn net device code is that is uses struct net_device
+  * One problem of the isdn net device code is that it uses struct net_device
   * for masters and slaves. However, only master interface are registered to
   * the network layer, and therefore, it only makes sense to call netif_*
   * functions on them.
@@@ -1951,6 -1951,38 +1951,6 @@@ static int isdn_net_header(struct sk_bu
        return len;
  }
  
 -/* We don't need to send arp, because we have point-to-point connections. */
 -static int
 -isdn_net_rebuild_header(struct sk_buff *skb)
 -{
 -      struct net_device *dev = skb->dev;
 -      isdn_net_local *lp = netdev_priv(dev);
 -      int ret = 0;
 -
 -      if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
 -              struct ethhdr *eth = (struct ethhdr *) skb->data;
 -
 -              /*
 -               *      Only ARP/IP is currently supported
 -               */
 -
 -              if (eth->h_proto != htons(ETH_P_IP)) {
 -                      printk(KERN_WARNING
 -                             "isdn_net: %s don't know how to resolve type %d addresses?\n",
 -                             dev->name, (int) eth->h_proto);
 -                      memcpy(eth->h_source, dev->dev_addr, dev->addr_len);
 -                      return 0;
 -              }
 -              /*
 -               *      Try to get ARP to resolve the header.
 -               */
 -#ifdef CONFIG_INET
 -              ret = arp_find(eth->h_dest, skb);
 -#endif
 -      }
 -      return ret;
 -}
 -
  static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh,
                             __be16 type)
  {
@@@ -1973,6 -2005,7 +1973,6 @@@ static void isdn_header_cache_update(st
  
  static const struct header_ops isdn_header_ops = {
        .create = isdn_net_header,
 -      .rebuild = isdn_net_rebuild_header,
        .cache = isdn_header_cache,
        .cache_update = isdn_header_cache_update,
  };
index f9f205cb1f115a92617fca64002f028d1856faab,ede5461fbe966260512a535c9c83c24c5d12d74d..68f3d2b55632498cea1cd0e9b25d33271042286c
@@@ -38,8 -38,7 +38,8 @@@ config ACER_WM
  
  config ACERHDF
        tristate "Acer Aspire One temperature and fan driver"
 -      depends on THERMAL && ACPI
 +      depends on ACPI && THERMAL
 +      select THERMAL_GOV_BANG_BANG
        ---help---
          This is a driver for Acer Aspire One netbooks. It allows to access
          the temperature sensor and to control the fan.
@@@ -129,10 -128,10 +129,10 @@@ config DELL_WMI_AI
          be called dell-wmi-aio.
  
  config DELL_SMO8800
 -      tristate "Dell Latitude freefall driver (ACPI SMO8800/SMO8810)"
 +      tristate "Dell Latitude freefall driver (ACPI SMO88XX)"
        depends on ACPI
        ---help---
 -        Say Y here if you want to support SMO8800/SMO8810 freefall device
 +        Say Y here if you want to support SMO88XX freefall devices
          on Dell Latitude laptops.
  
          To compile this driver as a module, choose M here: the module will
@@@ -614,7 -613,6 +614,7 @@@ config ACPI_TOSHIB
        depends on INPUT
        depends on RFKILL || RFKILL = n
        depends on SERIO_I8042 || SERIO_I8042 = n
 +      depends on ACPI_VIDEO || ACPI_VIDEO = n
        select INPUT_POLLDEV
        select INPUT_SPARSEKMAP
        ---help---
@@@ -660,7 -658,7 +660,7 @@@ config TOSHIBA_HAP
        depends on ACPI
        ---help---
          This driver adds support for the built-in accelerometer
-         found on recent Toshiba laptops equiped with HID TOS620A
+         found on recent Toshiba laptops equipped with HID TOS620A
          device.
  
          This driver receives ACPI notify events 0x80 when the sensor
          been stabilized.
  
          Also provides sysfs entries to get/set the desired protection
-         level and reseting the HDD protection interface.
+         level and resetting the HDD protection interface.
  
          If you have a recent Toshiba laptop with a built-in accelerometer
          device, say Y.
@@@ -736,31 -734,6 +736,31 @@@ config INTEL_IP
          functionality.  If in doubt, say Y here; it will only load on
          supported platforms.
  
 +config INTEL_IMR
 +      bool "Intel Isolated Memory Region support"
 +      default n
 +      depends on X86_INTEL_QUARK && IOSF_MBI
 +      ---help---
 +        This option provides a means to manipulate Isolated Memory Regions.
 +        IMRs are a set of registers that define read and write access masks
 +        to prohibit certain system agents from accessing memory with 1 KiB
 +        granularity.
 +
 +        IMRs make it possible to control read/write access to an address
 +        by hardware agents inside the SoC. Read and write masks can be
 +        defined for:
 +              - eSRAM flush
 +              - Dirty CPU snoop (write only)
 +              - RMU access
 +              - PCI Virtual Channel 0/Virtual Channel 1
 +              - SMM mode
 +              - Non SMM mode
 +
 +        Quark contains a set of eight IMR registers and makes use of those
 +        registers during its bootup process.
 +
 +        If you are running on a Galileo/Quark say Y here.
 +
  config IBM_RTL
        tristate "Device driver to enable PRTL support"
        depends on X86 && PCI
diff --combined drivers/scsi/Kconfig
index b021bcb885375445ca5d4bf2820b6e29a1f7152c,8cc7b3b0f45018f9df222da427ec8149748ac5b5..b94c217a09ae1060d384ad8148791d9b836b0e80
@@@ -52,7 -52,7 +52,7 @@@ config SCSI_MQ_DEFAUL
          This option enables the new blk-mq based I/O path for SCSI
          devices by default.  With the option the scsi_mod.use_blk_mq
          module/boot option defaults to Y, without it to N, but it can
-         still be overriden either way.
+         still be overridden either way.
  
          If unsure say N.
  
@@@ -201,12 -201,12 +201,12 @@@ config SCSI_ENCLOSUR
          certain enclosure conditions to be reported and is not required.
  
  config SCSI_CONSTANTS
 -      bool "Verbose SCSI error reporting (kernel size +=12K)"
 +      bool "Verbose SCSI error reporting (kernel size +=75K)"
        depends on SCSI
        help
          The error messages regarding your SCSI hardware will be easier to
          understand if you say Y here; it will enlarge your kernel by about
 -        12 KB. If in doubt, say Y.
 +        75 KB. If in doubt, say Y.
  
  config SCSI_LOGGING
        bool "SCSI logging facility"
@@@ -1341,15 -1341,13 +1341,15 @@@ config SCSI_DC395
          To compile this driver as a module, choose M here: the
          module will be called dc395x.
  
 -config SCSI_DC390T
 -      tristate "Tekram DC390(T) and Am53/79C974 SCSI support"
 +config SCSI_AM53C974
 +      tristate "Tekram DC390(T) and Am53/79C974 SCSI support (new driver)"
        depends on PCI && SCSI
 +      select SCSI_SPI_ATTRS
        ---help---
          This driver supports PCI SCSI host adapters based on the Am53C974A
          chip, e.g. Tekram DC390(T), DawiControl 2974 and some onboard
          PCscsi/PCnet (Am53/79C974) solutions.
 +        This is a new implementation base on the generic esp_scsi driver.
  
          Documentation can be found in <file:Documentation/scsi/tmscsim.txt>.
  
          based on NCR/Symbios chips. Use "NCR53C8XX SCSI support" for those.
  
          To compile this driver as a module, choose M here: the
 -        module will be called tmscsim.
 +        module will be called am53c974.
  
  config SCSI_T128
        tristate "Trantor T128/T128F/T228 SCSI support"
@@@ -1453,26 -1451,19 +1453,26 @@@ config SCSI_NSP3
          To compile this driver as a module, choose M here: the
          module will be called nsp32.
  
 +config SCSI_WD719X
 +      tristate "Western Digital WD7193/7197/7296 support"
 +      depends on PCI && SCSI
 +      select EEPROM_93CX6
 +      ---help---
 +        This is a driver for Western Digital WD7193, WD7197 and WD7296 PCI
 +        SCSI controllers (based on WD33C296A chip).
 +
  config SCSI_DEBUG
 -      tristate "SCSI debugging host simulator"
 +      tristate "SCSI debugging host and device simulator"
        depends on SCSI
        select CRC_T10DIF
        help
 -        This is a host adapter simulator that can simulate multiple hosts
 -        each with multiple dummy SCSI devices (disks). It defaults to one
 -        host adapter with one dummy SCSI disk. Each dummy disk uses kernel
 -        RAM as storage (i.e. it is a ramdisk). To save space when multiple
 -        dummy disks are simulated, they share the same kernel RAM for 
 -        their storage. See <http://sg.danny.cz/sg/sdebug26.html> for more
 -        information. This driver is primarily of use to those testing the
 -        SCSI and block subsystems. If unsure, say N.
 +        This pseudo driver simulates one or more hosts (SCSI initiators),
 +        each with one or more targets, each with one or more logical units.
 +        Defaults to one of each, creating a small RAM disk device. Many
 +        parameters found in the /sys/bus/pseudo/drivers/scsi_debug
 +        directory can be tweaked at run time.
 +        See <http://sg.danny.cz/sg/sdebug26.html> for more information.
 +        Mainly used for testing and best as a module. If unsure, say N.
  
  config SCSI_MESH
        tristate "MESH (Power Mac internal SCSI) support"
@@@ -1624,7 -1615,7 +1624,7 @@@ config ATARI_SCSI_RESET_BOO
          that leave the devices with SCSI operations partway completed.
  
  config MAC_SCSI
 -      bool "Macintosh NCR5380 SCSI"
 +      tristate "Macintosh NCR5380 SCSI"
        depends on MAC && SCSI=y
        select SCSI_SPI_ATTRS
        help
index 513edcb0c2dae3794b302282b62a730eeda0c6f5,8cf412dc23b0c1d8f9f9ab8d0ddd87d8d4d5b6b5..25aa9b98d53aa3452fb670b55f3efe810062e27a
@@@ -1,7 -1,7 +1,7 @@@
  /*******************************************************************
   * This file is part of the Emulex Linux Device Driver for         *
   * Fibre Channel Host Bus Adapters.                                *
 - * Copyright (C) 2007-2014 Emulex.  All rights reserved.           *
 + * Copyright (C) 2007-2015 Emulex.  All rights reserved.           *
   * EMULEX and SLI are trademarks of Emulex.                        *
   * www.emulex.com                                                  *
   *                                                                 *
@@@ -710,7 -710,7 +710,7 @@@ lpfc_debugfs_slow_ring_trc(struct lpfc_
   * returns a pointer to that log in the private_data field in @file.
   *
   * Returns:
-  * This function returns zero if successful. On error it will return an negative
+  * This function returns zero if successful. On error it will return a negative
   * error value.
   **/
  static int
@@@ -760,7 -760,7 +760,7 @@@ out
   * returns a pointer to that log in the private_data field in @file.
   *
   * Returns:
-  * This function returns zero if successful. On error it will return an negative
+  * This function returns zero if successful. On error it will return a negative
   * error value.
   **/
  static int
@@@ -810,7 -810,7 +810,7 @@@ out
   * returns a pointer to that log in the private_data field in @file.
   *
   * Returns:
-  * This function returns zero if successful. On error it will return an negative
+  * This function returns zero if successful. On error it will return a negative
   * error value.
   **/
  static int
@@@ -852,7 -852,7 +852,7 @@@ out
   * returns a pointer to that log in the private_data field in @file.
   *
   * Returns:
-  * This function returns zero if successful. On error it will return an negative
+  * This function returns zero if successful. On error it will return a negative
   * error value.
   **/
  static int
@@@ -894,7 -894,7 +894,7 @@@ out
   * returns a pointer to that log in the private_data field in @file.
   *
   * Returns:
-  * This function returns zero if successful. On error it will return an negative
+  * This function returns zero if successful. On error it will return a negative
   * error value.
   **/
  static int
@@@ -968,8 -968,8 +968,8 @@@ lpfc_debugfs_dumpDif_open(struct inode 
                goto out;
  
        /* Round to page boundary */
 -      printk(KERN_ERR "9060 BLKGRD: %s: _dump_buf_dif=0x%p file=%s\n",
 -              __func__, _dump_buf_dif, file->f_dentry->d_name.name);
 +      printk(KERN_ERR "9060 BLKGRD: %s: _dump_buf_dif=0x%p file=%pD\n",
 +              __func__, _dump_buf_dif, file);
        debug->buffer = _dump_buf_dif;
        if (!debug->buffer) {
                kfree(debug);
@@@ -1011,7 -1011,7 +1011,7 @@@ static ssize_
  lpfc_debugfs_dif_err_read(struct file *file, char __user *buf,
        size_t nbytes, loff_t *ppos)
  {
 -      struct dentry *dent = file->f_dentry;
 +      struct dentry *dent = file->f_path.dentry;
        struct lpfc_hba *phba = file->private_data;
        char cbuf[32];
        uint64_t tmp = 0;
@@@ -1052,7 -1052,7 +1052,7 @@@ static ssize_
  lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf,
        size_t nbytes, loff_t *ppos)
  {
 -      struct dentry *dent = file->f_dentry;
 +      struct dentry *dent = file->f_path.dentry;
        struct lpfc_hba *phba = file->private_data;
        char dstbuf[32];
        uint64_t tmp = 0;
@@@ -1115,7 -1115,7 +1115,7 @@@ lpfc_debugfs_dif_err_release(struct ino
   * returns a pointer to that log in the private_data field in @file.
   *
   * Returns:
-  * This function returns zero if successful. On error it will return an negative
+  * This function returns zero if successful. On error it will return a negative
   * error value.
   **/
  static int
index 890637fdd61e3535da093d0f9b41e4efc95eca13,3d95b165436ef2674d27182b3f8a3c651f184aae..4c3fc0eb8b3046e62a5ccee09c2ea144cf181495
@@@ -1,8 -1,7 +1,8 @@@
  /*
   *  Linux MegaRAID driver for SAS based RAID controllers
   *
 - *  Copyright (c) 2003-2012  LSI Corporation.
 + *  Copyright (c) 2003-2013  LSI Corporation
 + *  Copyright (c) 2013-2014  Avago Technologies
   *
   *  This program is free software; you can redistribute it and/or
   *  modify it under the terms of the GNU General Public License
   *  GNU General Public License for more details.
   *
   *  You should have received a copy of the GNU General Public License
 - *  along with this program; if not, write to the Free Software
 - *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
   *
 - *  FILE: megaraid_sas_base.c
 - *  Version : 06.805.06.00-rc1
 - *
 - *  Authors: LSI Corporation
 + *  Authors: Avago Technologies
   *           Sreenivas Bagalkote
   *           Sumant Patro
   *           Bo Yang
 - *           Adam Radford <linuxraid@lsi.com>
 + *           Adam Radford
 + *           Kashyap Desai <kashyap.desai@avagotech.com>
 + *           Sumit Saxena <sumit.saxena@avagotech.com>
   *
 - *  Send feedback to: <megaraidlinux@lsi.com>
 + *  Send feedback to: megaraidlinux.pdl@avagotech.com
   *
 - *  Mail to: LSI Corporation, 1621 Barber Lane, Milpitas, CA 95035
 - *     ATTN: Linuxraid
 + *  Mail to: Avago Technologies, 350 West Trimble Road, Building 90,
 + *  San Jose, California 95131
   */
  
  #include <linux/kernel.h>
@@@ -78,7 -79,7 +78,7 @@@ static int allow_vf_ioctls
  module_param(allow_vf_ioctls, int, S_IRUGO);
  MODULE_PARM_DESC(allow_vf_ioctls, "Allow ioctls in SR-IOV VF mode. Default: 0");
  
 -static int throttlequeuedepth = MEGASAS_THROTTLE_QUEUE_DEPTH;
 +static unsigned 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");
@@@ -1007,7 -1008,7 +1007,7 @@@ megasas_issue_blocked_abort_cmd(struct 
                cpu_to_le32(upper_32_bits(cmd_to_abort->frame_phys_addr));
  
        cmd->sync_cmd = 1;
 -      cmd->cmd_status = 0xFF;
 +      cmd->cmd_status = ENODATA;
  
        instance->instancet->issue_dcmd(instance, cmd);
  
@@@ -1417,15 -1418,16 +1417,15 @@@ megasas_build_ldio(struct megasas_insta
  }
  
  /**
 - * megasas_is_ldio -          Checks if the cmd is for logical drive
 + * megasas_cmd_type -         Checks if the cmd is for logical drive/sysPD
 + *                            and whether it's RW or non RW
   * @scmd:                     SCSI command
   *
 - * Called by megasas_queue_command to find out if the command to be queued
 - * is a logical drive command
   */
 -inline int megasas_is_ldio(struct scsi_cmnd *cmd)
 +inline int megasas_cmd_type(struct scsi_cmnd *cmd)
  {
 -      if (!MEGASAS_IS_LOGICAL(cmd))
 -              return 0;
 +      int ret;
 +
        switch (cmd->cmnd[0]) {
        case READ_10:
        case WRITE_10:
        case WRITE_6:
        case READ_16:
        case WRITE_16:
 -              return 1;
 +              ret = (MEGASAS_IS_LOGICAL(cmd)) ?
 +                      READ_WRITE_LDIO : READ_WRITE_SYSPDIO;
 +              break;
        default:
 -              return 0;
 +              ret = (MEGASAS_IS_LOGICAL(cmd)) ?
 +                      NON_READ_WRITE_LDIO : NON_READ_WRITE_SYSPDIO;
        }
 +      return ret;
  }
  
   /**
@@@ -1474,7 -1472,7 +1474,7 @@@ megasas_dump_pending_frames(struct mega
                if(!cmd->scmd)
                        continue;
                printk(KERN_ERR "megasas[%d]: Frame addr :0x%08lx : ",instance->host->host_no,(unsigned long)cmd->frame_phys_addr);
 -              if (megasas_is_ldio(cmd->scmd)){
 +              if (megasas_cmd_type(cmd->scmd) == READ_WRITE_LDIO) {
                        ldio = (struct megasas_io_frame *)cmd->frame;
                        mfi_sgl = &ldio->sgl;
                        sgcount = ldio->sge_count;
@@@ -1534,7 -1532,7 +1534,7 @@@ megasas_build_and_issue_cmd(struct mega
        /*
         * Logical drive command
         */
 -      if (megasas_is_ldio(scmd))
 +      if (megasas_cmd_type(scmd) == READ_WRITE_LDIO)
                frame_count = megasas_build_ldio(instance, scmd, cmd);
        else
                frame_count = megasas_build_dcdb(instance, scmd, cmd);
@@@ -1574,12 -1572,6 +1574,12 @@@ megasas_queue_command(struct Scsi_Host 
        instance = (struct megasas_instance *)
            scmd->device->host->hostdata;
  
 +      if (instance->unload == 1) {
 +              scmd->result = DID_NO_CONNECT << 16;
 +              scmd->scsi_done(scmd);
 +              return 0;
 +      }
 +
        if (instance->issuepend_done == 0)
                return SCSI_MLQUEUE_HOST_BUSY;
  
@@@ -1692,66 -1684,22 +1692,66 @@@ static int megasas_slave_alloc(struct s
        return 0;
  }
  
 +/*
 +* megasas_complete_outstanding_ioctls - Complete outstanding ioctls after a
 +*                                       kill adapter
 +* @instance:                          Adapter soft state
 +*
 +*/
 +void megasas_complete_outstanding_ioctls(struct megasas_instance *instance)
 +{
 +      int i;
 +      struct megasas_cmd *cmd_mfi;
 +      struct megasas_cmd_fusion *cmd_fusion;
 +      struct fusion_context *fusion = instance->ctrl_context;
 +
 +      /* Find all outstanding ioctls */
 +      if (fusion) {
 +              for (i = 0; i < instance->max_fw_cmds; i++) {
 +                      cmd_fusion = fusion->cmd_list[i];
 +                      if (cmd_fusion->sync_cmd_idx != (u32)ULONG_MAX) {
 +                              cmd_mfi = instance->cmd_list[cmd_fusion->sync_cmd_idx];
 +                              if (cmd_mfi->sync_cmd &&
 +                                      cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT)
 +                                      megasas_complete_cmd(instance,
 +                                                           cmd_mfi, DID_OK);
 +                      }
 +              }
 +      } else {
 +              for (i = 0; i < instance->max_fw_cmds; i++) {
 +                      cmd_mfi = instance->cmd_list[i];
 +                      if (cmd_mfi->sync_cmd && cmd_mfi->frame->hdr.cmd !=
 +                              MFI_CMD_ABORT)
 +                              megasas_complete_cmd(instance, cmd_mfi, DID_OK);
 +              }
 +      }
 +}
 +
 +
  void megaraid_sas_kill_hba(struct megasas_instance *instance)
  {
 +      /* Set critical error to block I/O & ioctls in case caller didn't */
 +      instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
 +      /* Wait 1 second to ensure IO or ioctls in build have posted */
 +      msleep(1000);
        if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
 -          (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) ||
 -          (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION) ||
 -          (instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) ||
 -          (instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
 -          (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) {
 -              writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY) ||
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION) ||
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) ||
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) {
 +              writel(MFI_STOP_ADP,
 +                      &instance->reg_set->doorbell);
                /* Flush */
                readl(&instance->reg_set->doorbell);
                if (instance->mpio && instance->requestorId)
                        memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
        } else {
 -              writel(MFI_STOP_ADP, &instance->reg_set->inbound_doorbell);
 +              writel(MFI_STOP_ADP,
 +                      &instance->reg_set->inbound_doorbell);
        }
 +      /* Complete outstanding ioctls when adapter is killed */
 +      megasas_complete_outstanding_ioctls(instance);
  }
  
   /**
@@@ -1764,7 -1712,6 +1764,7 @@@ voi
  megasas_check_and_restore_queue_depth(struct megasas_instance *instance)
  {
        unsigned long flags;
 +
        if (instance->flag & MEGASAS_FW_BUSY
            && time_after(jiffies, instance->last_time + 5 * HZ)
            && atomic_read(&instance->fw_outstanding) <
  
                spin_lock_irqsave(instance->host->host_lock, flags);
                instance->flag &= ~MEGASAS_FW_BUSY;
 -              if (instance->is_imr) {
 -                      instance->host->can_queue =
 -                              instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS;
 -              } else
 -                      instance->host->can_queue =
 -                              instance->max_fw_cmds - MEGASAS_INT_CMDS;
  
 +              instance->host->can_queue = instance->max_scsi_cmds;
                spin_unlock_irqrestore(instance->host->host_lock, flags);
        }
  }
@@@ -2634,6 -2586,20 +2634,6 @@@ megasas_service_aen(struct megasas_inst
        }
  }
  
 -static int megasas_change_queue_depth(struct scsi_device *sdev,
 -                                    int queue_depth, int reason)
 -{
 -      if (reason != SCSI_QDEPTH_DEFAULT)
 -              return -EOPNOTSUPP;
 -
 -      if (queue_depth > sdev->host->can_queue)
 -              queue_depth = sdev->host->can_queue;
 -      scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev),
 -                              queue_depth);
 -
 -      return queue_depth;
 -}
 -
  static ssize_t
  megasas_fw_crash_buffer_store(struct device *cdev,
        struct device_attribute *attr, const char *buf, size_t count)
@@@ -2798,7 -2764,7 +2798,7 @@@ static struct scsi_host_template megasa
        .shost_attrs = megaraid_host_attrs,
        .bios_param = megasas_bios_param,
        .use_clustering = ENABLE_CLUSTERING,
 -      .change_queue_depth = megasas_change_queue_depth,
 +      .change_queue_depth = scsi_change_queue_depth,
        .no_write_same = 1,
  };
  
@@@ -3071,9 -3037,10 +3071,9 @@@ megasas_issue_pending_cmds_again(struc
                                        "was tried multiple times during reset."
                                        "Shutting down the HBA\n",
                                        cmd, cmd->scmd, cmd->sync_cmd);
 +                              instance->instancet->disable_intr(instance);
 +                              atomic_set(&instance->fw_reset_no_pci_access, 1);
                                megaraid_sas_kill_hba(instance);
 -
 -                              instance->adprecovery =
 -                                              MEGASAS_HW_CRITICAL_ERROR;
                                return;
                        }
                }
@@@ -3207,8 -3174,8 +3207,8 @@@ process_fw_state_change_wq(struct work_
                if (megasas_transition_to_ready(instance, 1)) {
                        printk(KERN_NOTICE "megaraid_sas:adapter not ready\n");
  
 +                      atomic_set(&instance->fw_reset_no_pci_access, 1);
                        megaraid_sas_kill_hba(instance);
 -                      instance->adprecovery   = MEGASAS_HW_CRITICAL_ERROR;
                        return ;
                }
  
@@@ -3589,6 -3556,7 +3589,6 @@@ static int megasas_create_frame_pool(st
        int i;
        u32 max_cmd;
        u32 sge_sz;
 -      u32 sgl_sz;
        u32 total_sz;
        u32 frame_count;
        struct megasas_cmd *cmd;
        }
  
        /*
 -       * Calculated the number of 64byte frames required for SGL
 -       */
 -      sgl_sz = sge_sz * instance->max_num_sge;
 -      frame_count = (sgl_sz + MEGAMFI_FRAME_SIZE - 1) / MEGAMFI_FRAME_SIZE;
 -      frame_count = 15;
 -
 -      /*
 -       * We need one extra frame for the MFI command
 +       * For MFI controllers.
 +       * max_num_sge = 60
 +       * max_sge_sz  = 16 byte (sizeof megasas_sge_skinny)
 +       * Total 960 byte (15 MFI frame of 64 byte)
 +       *
 +       * Fusion adapter require only 3 extra frame.
 +       * max_num_sge = 16 (defined as MAX_IOCTL_SGE)
 +       * max_sge_sz  = 12 byte (sizeof  megasas_sge64)
 +       * Total 192 byte (3 MFI frame of 64 byte)
         */
 -      frame_count++;
 -
 +      frame_count = instance->ctrl_context ? (3 + 1) : (15 + 1);
        total_sz = MEGAMFI_FRAME_SIZE * frame_count;
        /*
         * Use DMA pool facility provided by PCI layer
         */
        instance->frame_dma_pool = pci_pool_create("megasas frame pool",
 -                                                 instance->pdev, total_sz, 64,
 -                                                 0);
 +                                      instance->pdev, total_sz, 256, 0);
  
        if (!instance->frame_dma_pool) {
                printk(KERN_DEBUG "megasas: failed to setup frame pool\n");
@@@ -4059,83 -4028,25 +4059,83 @@@ megasas_ld_list_query(struct megasas_in
        return ret;
  }
  
 +/*
 + * megasas_update_ext_vd_details : Update details w.r.t Extended VD
 + * instance                    : Controller's instance
 +*/
 +static void megasas_update_ext_vd_details(struct megasas_instance *instance)
 +{
 +      struct fusion_context *fusion;
 +      u32 old_map_sz;
 +      u32 new_map_sz;
 +
 +      fusion = instance->ctrl_context;
 +      /* For MFI based controllers return dummy success */
 +      if (!fusion)
 +              return;
 +
 +      instance->supportmax256vd =
 +              instance->ctrl_info->adapterOperations3.supportMaxExtLDs;
 +      /* Below is additional check to address future FW enhancement */
 +      if (instance->ctrl_info->max_lds > 64)
 +              instance->supportmax256vd = 1;
 +
 +      instance->drv_supported_vd_count = MEGASAS_MAX_LD_CHANNELS
 +                                      * MEGASAS_MAX_DEV_PER_CHANNEL;
 +      instance->drv_supported_pd_count = MEGASAS_MAX_PD_CHANNELS
 +                                      * MEGASAS_MAX_DEV_PER_CHANNEL;
 +      if (instance->supportmax256vd) {
 +              instance->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT;
 +              instance->fw_supported_pd_count = MAX_PHYSICAL_DEVICES;
 +      } else {
 +              instance->fw_supported_vd_count = MAX_LOGICAL_DRIVES;
 +              instance->fw_supported_pd_count = MAX_PHYSICAL_DEVICES;
 +      }
 +      dev_info(&instance->pdev->dev, "Firmware supports %d VD %d PD\n",
 +              instance->fw_supported_vd_count,
 +              instance->fw_supported_pd_count);
 +      dev_info(&instance->pdev->dev, "Driver supports %d VD  %d PD\n",
 +              instance->drv_supported_vd_count,
 +              instance->drv_supported_pd_count);
 +
 +      old_map_sz =  sizeof(struct MR_FW_RAID_MAP) +
 +                              (sizeof(struct MR_LD_SPAN_MAP) *
 +                              (instance->fw_supported_vd_count - 1));
 +      new_map_sz =  sizeof(struct MR_FW_RAID_MAP_EXT);
 +      fusion->drv_map_sz =  sizeof(struct MR_DRV_RAID_MAP) +
 +                              (sizeof(struct MR_LD_SPAN_MAP) *
 +                              (instance->drv_supported_vd_count - 1));
 +
 +      fusion->max_map_sz = max(old_map_sz, new_map_sz);
 +
 +
 +      if (instance->supportmax256vd)
 +              fusion->current_map_sz = new_map_sz;
 +      else
 +              fusion->current_map_sz = old_map_sz;
 +
 +}
 +
  /**
   * megasas_get_controller_info -      Returns FW's controller structure
   * @instance:                         Adapter soft state
 - * @ctrl_info:                                Controller information structure
   *
   * Issues an internal command (DCMD) to get the FW's controller structure.
   * This information is mainly used to find out the maximum IO transfer per
   * command supported by the FW.
   */
  int
 -megasas_get_ctrl_info(struct megasas_instance *instance,
 -                    struct megasas_ctrl_info *ctrl_info)
 +megasas_get_ctrl_info(struct megasas_instance *instance)
  {
        int ret = 0;
        struct megasas_cmd *cmd;
        struct megasas_dcmd_frame *dcmd;
        struct megasas_ctrl_info *ci;
 +      struct megasas_ctrl_info *ctrl_info;
        dma_addr_t ci_h = 0;
  
 +      ctrl_info = instance->ctrl_info;
 +
        cmd = megasas_get_cmd(instance);
  
        if (!cmd) {
        else
                ret = megasas_issue_polled(instance, cmd);
  
 -      if (!ret)
 +      if (!ret) {
                memcpy(ctrl_info, ci, sizeof(struct megasas_ctrl_info));
 +              le32_to_cpus((u32 *)&ctrl_info->properties.OnOffProperties);
 +              le32_to_cpus((u32 *)&ctrl_info->adapterOperations2);
 +              le32_to_cpus((u32 *)&ctrl_info->adapterOperations3);
 +              megasas_update_ext_vd_details(instance);
 +      }
  
        pci_free_consistent(instance->pdev, sizeof(struct megasas_ctrl_info),
                            ci, ci_h);
@@@ -4383,7 -4289,7 +4383,7 @@@ megasas_init_adapter_mfi(struct megasas
        if (megasas_issue_init_mfi(instance))
                goto fail_fw_init;
  
 -      if (megasas_get_ctrl_info(instance, instance->ctrl_info)) {
 +      if (megasas_get_ctrl_info(instance)) {
                dev_err(&instance->pdev->dev, "(%d): Could get controller info "
                        "Fail from %s %d\n", instance->unique_id,
                        __func__, __LINE__);
@@@ -4621,8 -4527,12 +4621,8 @@@ static int megasas_init_fw(struct megas
                dev_info(&instance->pdev->dev,
                        "Controller type: iMR\n");
        }
 -      /* OnOffProperties are converted into CPU arch*/
 -      le32_to_cpus((u32 *)&ctrl_info->properties.OnOffProperties);
        instance->disableOnlineCtrlReset =
        ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset;
 -      /* adapterOperations2 are converted into CPU arch*/
 -      le32_to_cpus((u32 *)&ctrl_info->adapterOperations2);
        instance->mpio = ctrl_info->adapterOperations2.mpio;
        instance->UnevenSpanSupport =
                ctrl_info->adapterOperations2.supportUnevenSpans;
                       "requestorId %d\n", instance->requestorId);
        }
  
 -      le32_to_cpus((u32 *)&ctrl_info->adapterOperations3);
        instance->crash_dump_fw_support =
                ctrl_info->adapterOperations3.supportCrashDump;
        instance->crash_dump_drv_support =
                                instance->crash_dump_h);
                instance->crash_dump_buf = NULL;
        }
 +
 +      instance->secure_jbod_support =
 +              ctrl_info->adapterOperations3.supportSecurityonJBOD;
 +      if (instance->secure_jbod_support)
 +              dev_info(&instance->pdev->dev, "Firmware supports Secure JBOD\n");
        instance->max_sectors_per_req = instance->max_num_sge *
                                                PAGE_SIZE / 512;
        if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors))
                instance->max_sectors_per_req = tmp_sectors;
  
 -      kfree(ctrl_info);
 +      /*
 +       * 1. For fusion adapters, 3 commands for IOCTL and 5 commands
 +       *    for driver's internal DCMDs.
 +       * 2. For MFI skinny adapters, 5 commands for IOCTL + driver's
 +       *    internal DCMDs.
 +       * 3. For rest of MFI adapters, 27 commands reserved for IOCTLs
 +       *    and 5 commands for drivers's internal DCMD.
 +       */
 +      if (instance->ctrl_context) {
 +              instance->max_scsi_cmds = instance->max_fw_cmds -
 +                                      (MEGASAS_FUSION_INTERNAL_CMDS +
 +                                      MEGASAS_FUSION_IOCTL_CMDS);
 +              sema_init(&instance->ioctl_sem, MEGASAS_FUSION_IOCTL_CMDS);
 +      } else if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
 +              instance->max_scsi_cmds = instance->max_fw_cmds -
 +                                              MEGASAS_SKINNY_INT_CMDS;
 +              sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
 +      } else {
 +              instance->max_scsi_cmds = instance->max_fw_cmds -
 +                                              MEGASAS_INT_CMDS;
 +              sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
 +      }
  
        /* Check for valid throttlequeuedepth module parameter */
 -      if (instance->is_imr) {
 -              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 =
 +      if (throttlequeuedepth &&
 +                      throttlequeuedepth <= instance->max_scsi_cmds)
 +              instance->throttlequeuedepth = throttlequeuedepth;
 +      else
 +              instance->throttlequeuedepth =
                                MEGASAS_THROTTLE_QUEUE_DEPTH;
 -              else
 -                      instance->throttlequeuedepth = throttlequeuedepth;
 -      }
  
          /*
        * Setup tasklet for cmd completion
@@@ -4747,7 -4640,7 +4747,7 @@@ fail_ready_state
  
  /**
   * megasas_release_mfi -      Reverses the FW initialization
-  * @intance:                  Adapter soft state
+  * @instance:                 Adapter soft state
   */
  static void megasas_release_mfi(struct megasas_instance *instance)
  {
@@@ -5007,7 -4900,12 +5007,7 @@@ static int megasas_io_attach(struct meg
         */
        host->irq = instance->pdev->irq;
        host->unique_id = instance->unique_id;
 -      if (instance->is_imr) {
 -              host->can_queue =
 -                      instance->max_fw_cmds - MEGASAS_SKINNY_INT_CMDS;
 -      } else
 -              host->can_queue =
 -                      instance->max_fw_cmds - MEGASAS_INT_CMDS;
 +      host->can_queue = instance->max_scsi_cmds;
        host->this_id = instance->init_id;
        host->sg_tablesize = instance->max_num_sge;
  
                return -ENODEV;
        }
  
 -      /*
 -       * Trigger SCSI to scan our drives
 -       */
 -      scsi_scan_host(host);
        return 0;
  }
  
@@@ -5181,10 -5083,10 +5181,10 @@@ static int megasas_probe_one(struct pci
                        goto fail_alloc_dma_buf;
                }
                fusion = instance->ctrl_context;
 +              memset(fusion, 0,
 +                      ((1 << PAGE_SHIFT) << instance->ctrl_context_pages));
                INIT_LIST_HEAD(&fusion->cmd_pool);
                spin_lock_init(&fusion->mpt_pool_lock);
 -              memset(fusion->load_balance_info, 0,
 -                      sizeof(struct LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT);
        }
        break;
        default: /* For all other supported controllers */
        instance->init_id = MEGASAS_DEFAULT_INIT_ID;
        instance->ctrl_info = NULL;
  
 +
        if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
 -              (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
 +              (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY))
                instance->flag_ieee = 1;
 -              sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
 -      } else
 -              sema_init(&instance->ioctl_sem, (MEGASAS_INT_CMDS - 5));
  
        megasas_dbg_lvl = 0;
        instance->flag = 0;
@@@ -5384,10 -5288,6 +5384,10 @@@ retry_irq_register
                goto fail_io_attach;
  
        instance->unload = 0;
 +      /*
 +       * Trigger SCSI to scan our drives
 +       */
 +      scsi_scan_host(host);
  
        /*
         * Initiate AEN (Asynchronous Event Notification)
@@@ -6151,11 -6051,6 +6151,11 @@@ megasas_mgmt_fw_ioctl(struct megasas_in
        megasas_issue_blocked_cmd(instance, cmd, 0);
        cmd->sync_cmd = 0;
  
 +      if (instance->unload == 1) {
 +              dev_info(&instance->pdev->dev, "Driver unload is in progress "
 +                      "don't submit data to application\n");
 +              goto out;
 +      }
        /*
         * copy out the kernel buffers to user buffers
         */
@@@ -6266,6 -6161,9 +6266,6 @@@ static int megasas_mgmt_ioctl_fw(struc
                goto out_kfree_ioc;
        }
  
 -      /*
 -       * We will allow only MEGASAS_INT_CMDS number of parallel ioctl cmds
 -       */
        if (down_interruptible(&instance->ioctl_sem)) {
                error = -ERESTARTSYS;
                goto out_kfree_ioc;
@@@ -6501,6 -6399,16 +6501,6 @@@ static ssize_t megasas_sysfs_show_versi
  
  static DRIVER_ATTR(version, S_IRUGO, megasas_sysfs_show_version, NULL);
  
 -static ssize_t
 -megasas_sysfs_show_release_date(struct device_driver *dd, char *buf)
 -{
 -      return snprintf(buf, strlen(MEGASAS_RELDATE) + 2, "%s\n",
 -                      MEGASAS_RELDATE);
 -}
 -
 -static DRIVER_ATTR(release_date, S_IRUGO, megasas_sysfs_show_release_date,
 -                 NULL);
 -
  static ssize_t
  megasas_sysfs_show_support_poll_for_event(struct device_driver *dd, char *buf)
  {
@@@ -6804,7 -6712,8 +6804,7 @@@ static int __init megasas_init(void
        /*
         * Announce driver version and other information
         */
 -      printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
 -             MEGASAS_EXT_VERSION);
 +      pr_info("megasas: %s\n", MEGASAS_VERSION);
  
        spin_lock_init(&poll_aen_lock);
  
                                  &driver_attr_version);
        if (rval)
                goto err_dcf_attr_ver;
 -      rval = driver_create_file(&megasas_pci_driver.driver,
 -                                &driver_attr_release_date);
 -      if (rval)
 -              goto err_dcf_rel_date;
  
        rval = driver_create_file(&megasas_pci_driver.driver,
                                &driver_attr_support_poll_for_event);
@@@ -6862,7 -6775,12 +6862,7 @@@ err_dcf_support_device_change
  err_dcf_dbg_lvl:
        driver_remove_file(&megasas_pci_driver.driver,
                        &driver_attr_support_poll_for_event);
 -
  err_dcf_support_poll_for_event:
 -      driver_remove_file(&megasas_pci_driver.driver,
 -                         &driver_attr_release_date);
 -
 -err_dcf_rel_date:
        driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version);
  err_dcf_attr_ver:
        pci_unregister_driver(&megasas_pci_driver);
@@@ -6882,6 -6800,8 +6882,6 @@@ static void __exit megasas_exit(void
                        &driver_attr_support_poll_for_event);
        driver_remove_file(&megasas_pci_driver.driver,
                        &driver_attr_support_device_change);
 -      driver_remove_file(&megasas_pci_driver.driver,
 -                         &driver_attr_release_date);
        driver_remove_file(&megasas_pci_driver.driver, &driver_attr_version);
  
        pci_unregister_driver(&megasas_pci_driver);
index 5a0800d19970d4fedff5332a73ef397e611f7914,c2f2f9e4ea7cd00cba90e56bf88c262aebef3979..dba4de04de3cf4fb6206db4235944f82367184a6
@@@ -1,8 -1,7 +1,8 @@@
  /*
   *  Linux MegaRAID driver for SAS based RAID controllers
   *
 - *  Copyright (c) 2009-2012  LSI Corporation.
 + *  Copyright (c) 2009-2013  LSI Corporation
 + *  Copyright (c) 2013-2014  Avago Technologies
   *
   *  This program is free software; you can redistribute it and/or
   *  modify it under the terms of the GNU General Public License
   *  GNU General Public License for more details.
   *
   *  You should have received a copy of the GNU General Public License
 - *  along with this program; if not, write to the Free Software
 - *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
   *
   *  FILE: megaraid_sas_fusion.c
   *
 - *  Authors: LSI Corporation
 + *  Authors: Avago Technologies
   *           Sumant Patro
 - *           Adam Radford <linuxraid@lsi.com>
 + *           Adam Radford
 + *           Kashyap Desai <kashyap.desai@avagotech.com>
 + *           Sumit Saxena <sumit.saxena@avagotech.com>
   *
 - *  Send feedback to: <megaraidlinux@lsi.com>
 + *  Send feedback to: megaraidlinux.pdl@avagotech.com
   *
 - *  Mail to: LSI Corporation, 1621 Barber Lane, Milpitas, CA 95035
 - *     ATTN: Linuxraid
 + *  Mail to: Avago Technologies, 350 West Trimble Road, Building 90,
 + *  San Jose, California 95131
   */
  
  #include <linux/kernel.h>
@@@ -63,6 -61,7 +63,6 @@@ extern struct megasas_cmd *megasas_get_
  extern void
  megasas_complete_cmd(struct megasas_instance *instance,
                     struct megasas_cmd *cmd, u8 alt_status);
 -int megasas_is_ldio(struct scsi_cmnd *cmd);
  int
  wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
              int seconds);
@@@ -102,8 -101,6 +102,8 @@@ megasas_enable_intr_fusion(struct megas
  {
        struct megasas_register_set __iomem *regs;
        regs = instance->reg_set;
 +
 +      instance->mask_interrupts = 0;
        /* For Thunderbolt/Invader also clear intr on enable */
        writel(~0, &regs->outbound_intr_status);
        readl(&regs->outbound_intr_status);
  
        /* Dummy readl to force pci flush */
        readl(&regs->outbound_intr_mask);
 -      instance->mask_interrupts = 0;
  }
  
  /**
@@@ -196,7 -194,6 +196,7 @@@ inline void megasas_return_cmd_fusion(s
  
        cmd->scmd = NULL;
        cmd->sync_cmd_idx = (u32)ULONG_MAX;
 +      memset(cmd->io_request, 0, sizeof(struct MPI2_RAID_SCSI_IO_REQUEST));
        list_add(&cmd->list, (&fusion->cmd_pool)->next);
  
        spin_unlock_irqrestore(&fusion->mpt_pool_lock, flags);
@@@ -690,8 -687,6 +690,8 @@@ megasas_ioc_init_fusion(struct megasas_
                = 1;
        init_frame->driver_operations.mfi_capabilities.support_ndrive_r1_lb
                = 1;
 +      init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw
 +              = 1;
        /* Convert capability to LE32 */
        cpu_to_le32s((u32 *)&init_frame->driver_operations.mfi_capabilities);
  
                cpu_to_le32(lower_32_bits(ioc_init_handle));
        init_frame->data_xfer_len = cpu_to_le32(sizeof(struct MPI2_IOC_INIT_REQUEST));
  
 -      req_desc.Words = 0;
 +      req_desc.u.low = cpu_to_le32(lower_32_bits(cmd->frame_phys_addr));
 +      req_desc.u.high = cpu_to_le32(upper_32_bits(cmd->frame_phys_addr));
        req_desc.MFAIo.RequestFlags =
                (MEGASAS_REQ_DESCRIPT_FLAGS_MFA <<
 -               MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
 -      cpu_to_le32s((u32 *)&req_desc.MFAIo);
 -      req_desc.Words |= cpu_to_le64(cmd->frame_phys_addr);
 +              MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
  
        /*
         * disable the intr before firing the init frame
@@@ -884,7 -880,7 +884,7 @@@ megasas_sync_map_info(struct megasas_in
  
        map = fusion->ld_drv_map[instance->map_id & 1];
  
 -      num_lds = le32_to_cpu(map->raidMap.ldCount);
 +      num_lds = le16_to_cpu(map->raidMap.ldCount);
  
        dcmd = &cmd->frame->dcmd;
  
@@@ -1019,12 -1015,8 +1019,12 @@@ megasas_init_adapter_fusion(struct mega
         * does not exceed max cmds that the FW can support
         */
        instance->max_fw_cmds = instance->max_fw_cmds-1;
 -      /* Only internal cmds (DCMD) need to have MFI frames */
 -      instance->max_mfi_cmds = MEGASAS_INT_CMDS;
 +
 +      /*
 +       * Only Driver's internal DCMDs and IOCTL DCMDs needs to have MFI frames
 +       */
 +      instance->max_mfi_cmds =
 +              MEGASAS_FUSION_INTERNAL_CMDS + MEGASAS_FUSION_IOCTL_CMDS;
  
        max_cmd = instance->max_fw_cmds;
  
                goto fail_ioc_init;
  
        megasas_display_intel_branding(instance);
 -      if (megasas_get_ctrl_info(instance, instance->ctrl_info)) {
 +      if (megasas_get_ctrl_info(instance)) {
                dev_err(&instance->pdev->dev,
                        "Could not get controller info. Fail from %s %d\n",
                        __func__, __LINE__);
                goto fail_ioc_init;
        }
  
 -      instance->supportmax256vd =
 -              instance->ctrl_info->adapterOperations3.supportMaxExtLDs;
 -      /* Below is additional check to address future FW enhancement */
 -      if (instance->ctrl_info->max_lds > 64)
 -              instance->supportmax256vd = 1;
 -      instance->drv_supported_vd_count = MEGASAS_MAX_LD_CHANNELS
 -                                      * MEGASAS_MAX_DEV_PER_CHANNEL;
 -      instance->drv_supported_pd_count = MEGASAS_MAX_PD_CHANNELS
 -                                      * MEGASAS_MAX_DEV_PER_CHANNEL;
 -      if (instance->supportmax256vd) {
 -              instance->fw_supported_vd_count = MAX_LOGICAL_DRIVES_EXT;
 -              instance->fw_supported_pd_count = MAX_PHYSICAL_DEVICES;
 -      } else {
 -              instance->fw_supported_vd_count = MAX_LOGICAL_DRIVES;
 -              instance->fw_supported_pd_count = MAX_PHYSICAL_DEVICES;
 -      }
 -      dev_info(&instance->pdev->dev, "Firmware supports %d VDs %d PDs\n"
 -              "Driver supports %d VDs  %d PDs\n",
 -              instance->fw_supported_vd_count,
 -              instance->fw_supported_pd_count,
 -              instance->drv_supported_vd_count,
 -              instance->drv_supported_pd_count);
 -
        instance->flag_ieee = 1;
        fusion->fast_path_io = 0;
  
 -      fusion->old_map_sz =
 -              sizeof(struct MR_FW_RAID_MAP) + (sizeof(struct MR_LD_SPAN_MAP) *
 -              (instance->fw_supported_vd_count - 1));
 -      fusion->new_map_sz =
 -              sizeof(struct MR_FW_RAID_MAP_EXT);
 -      fusion->drv_map_sz =
 -              sizeof(struct MR_DRV_RAID_MAP) + (sizeof(struct MR_LD_SPAN_MAP) *
 -              (instance->drv_supported_vd_count - 1));
 -
        fusion->drv_map_pages = get_order(fusion->drv_map_sz);
        for (i = 0; i < 2; i++) {
                fusion->ld_map[i] = NULL;
                                        fusion->drv_map_pages);
                        goto fail_ioc_init;
                }
 +              memset(fusion->ld_drv_map[i], 0,
 +                      ((1 << PAGE_SHIFT) << fusion->drv_map_pages));
        }
  
 -      fusion->max_map_sz = max(fusion->old_map_sz, fusion->new_map_sz);
 -
 -      if (instance->supportmax256vd)
 -              fusion->current_map_sz = fusion->new_map_sz;
 -      else
 -              fusion->current_map_sz = fusion->old_map_sz;
 -
 -
        for (i = 0; i < 2; i++) {
                fusion->ld_map[i] = dma_alloc_coherent(&instance->pdev->dev,
                                                       fusion->max_map_sz,
@@@ -1143,10 -1173,9 +1143,10 @@@ megasas_fire_cmd_fusion(struct megasas_
                        struct megasas_register_set __iomem *regs)
  {
  #if defined(writeq) && defined(CONFIG_64BIT)
 -      u64 req_data = (((u64)req_desc_hi << 32) | (u32)req_desc_lo);
 +      u64 req_data = (((u64)le32_to_cpu(req_desc_hi) << 32) |
 +                      le32_to_cpu(req_desc_lo));
  
 -      writeq(le64_to_cpu(req_data), &(regs)->inbound_low_queue_port);
 +      writeq(req_data, &(regs)->inbound_low_queue_port);
  #else
        unsigned long flags;
  
@@@ -1291,7 -1320,6 +1291,7 @@@ megasas_make_sgl_fusion(struct megasas_
  
                        sgl_ptr =
                          (struct MPI25_IEEE_SGE_CHAIN64 *)cmd->sg_frame;
 +                      memset(sgl_ptr, 0, MEGASAS_MAX_SZ_CHAIN_FRAME);
                }
        }
  
@@@ -1345,7 -1373,7 +1345,7 @@@ megasas_set_pd_lba(struct MPI2_RAID_SCS
                /* Logical block reference tag */
                io_request->CDB.EEDP32.PrimaryReferenceTag =
                        cpu_to_be32(ref_tag);
 -              io_request->CDB.EEDP32.PrimaryApplicationTagMask = 0xffff;
 +              io_request->CDB.EEDP32.PrimaryApplicationTagMask = cpu_to_be16(0xffff);
                io_request->IoFlags = cpu_to_le16(32); /* Specify 32-byte cdb */
  
                /* Transfer length */
@@@ -1584,11 -1612,11 +1584,11 @@@ megasas_build_ldio_fusion(struct megasa
                        fp_possible = io_info.fpOkForIo;
        }
  
 -      /* Use smp_processor_id() for now until cmd->request->cpu is CPU
 +      /* Use raw_smp_processor_id() for now until cmd->request->cpu is CPU
           id by default, not CPU group id, otherwise all MSI-X queues won't
           be utilized */
        cmd->request_desc->SCSIIO.MSIxIndex = instance->msix_vectors ?
 -              smp_processor_id() % instance->msix_vectors : 0;
 +              raw_smp_processor_id() % instance->msix_vectors : 0;
  
        if (fp_possible) {
                megasas_set_pd_lba(io_request, scp->cmd_len, &io_info, scp,
@@@ -1665,8 -1693,6 +1665,8 @@@ megasas_build_dcdb_fusion(struct megasa
        u32 device_id;
        struct MPI2_RAID_SCSI_IO_REQUEST *io_request;
        u16 pd_index = 0;
 +      u16 os_timeout_value;
 +      u16 timeout_limit;
        struct MR_DRV_RAID_MAP_ALL *local_map_ptr;
        struct fusion_context *fusion = instance->ctrl_context;
        u8                          span, physArm;
  
        io_request->DataLength = cpu_to_le32(scsi_bufflen(scmd));
  
 -
 -      /* Check if this is a system PD I/O */
        if (scmd->device->channel < MEGASAS_MAX_PD_CHANNELS &&
            instance->pd_list[pd_index].driveState == MR_PD_STATE_SYSTEM) {
 -              io_request->Function = 0;
                if (fusion->fast_path_io)
                        io_request->DevHandle =
                        local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
 -              io_request->RaidContext.timeoutValue =
 -                      local_map_ptr->raidMap.fpPdIoTimeoutSec;
 -              io_request->RaidContext.regLockFlags = 0;
 -              io_request->RaidContext.regLockRowLBA = 0;
 -              io_request->RaidContext.regLockLength = 0;
                io_request->RaidContext.RAIDFlags =
 -                      MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD <<
 -                      MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT;
 +                      MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD
 +                      << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT;
 +              cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle;
 +              cmd->request_desc->SCSIIO.MSIxIndex =
 +                      instance->msix_vectors ?
 +                              raw_smp_processor_id() %
 +                                      instance->msix_vectors :
 +                              0;
 +              os_timeout_value = scmd->request->timeout / HZ;
 +
 +              if (instance->secure_jbod_support &&
 +                      (megasas_cmd_type(scmd) == NON_READ_WRITE_SYSPDIO)) {
 +                      /* system pd firmware path */
 +                      io_request->Function  =
 +                              MEGASAS_MPI2_FUNCTION_LD_IO_REQUEST;
 +                      cmd->request_desc->SCSIIO.RequestFlags =
 +                              (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO <<
 +                              MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
 +                      io_request->RaidContext.timeoutValue =
 +                              cpu_to_le16(os_timeout_value);
 +              } else {
 +                      /* system pd Fast Path */
 +                      io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST;
 +                      io_request->RaidContext.regLockFlags = 0;
 +                      io_request->RaidContext.regLockRowLBA = 0;
 +                      io_request->RaidContext.regLockLength = 0;
 +                      timeout_limit = (scmd->device->type == TYPE_DISK) ?
 +                                      255 : 0xFFFF;
 +                      io_request->RaidContext.timeoutValue =
 +                              cpu_to_le16((os_timeout_value > timeout_limit) ?
 +                              timeout_limit : os_timeout_value);
                if ((instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
                        (instance->pdev->device == PCI_DEVICE_ID_LSI_FURY))
 -                      io_request->IoFlags |= cpu_to_le16(
 -                              MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH);
 -              cmd->request_desc->SCSIIO.RequestFlags =
 -                      (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY <<
 -                       MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
 -              cmd->request_desc->SCSIIO.DevHandle =
 -                      local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
 -              cmd->request_desc->SCSIIO.MSIxIndex =
 -                      instance->msix_vectors ? smp_processor_id() % instance->msix_vectors : 0;
 -              /*
 -               * If the command is for the tape device, set the
 -               * FP timeout to the os layer timeout value.
 -               */
 -              if (scmd->device->type == TYPE_TAPE) {
 -                      if ((scmd->request->timeout / HZ) > 0xFFFF)
 -                              io_request->RaidContext.timeoutValue =
 -                                      0xFFFF;
 -                      else
 -                              io_request->RaidContext.timeoutValue =
 -                                      scmd->request->timeout / HZ;
 +                      io_request->IoFlags |=
 +                      cpu_to_le16(MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH);
 +
 +                      cmd->request_desc->SCSIIO.RequestFlags =
 +                              (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY <<
 +                              MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
                }
        } else {
                if (scmd->device->channel < MEGASAS_MAX_PD_CHANNELS)
                        goto NonFastPath;
  
 +              /*
 +               * For older firmware, Driver should not access ldTgtIdToLd
 +               * beyond index 127 and for Extended VD firmware, ldTgtIdToLd
 +               * should not go beyond 255.
 +               */
 +
 +              if ((!fusion->fast_path_io) ||
 +                      (device_id >= instance->fw_supported_vd_count))
 +                      goto NonFastPath;
 +
                ld = MR_TargetIdToLdGet(device_id, local_map_ptr);
 -              if ((ld >= instance->fw_supported_vd_count) ||
 -                      (!fusion->fast_path_io))
 +
 +              if (ld >= instance->fw_supported_vd_count)
                        goto NonFastPath;
  
                raid = MR_LdRaidGet(ld, local_map_ptr);
  
                /* set RAID context values */
                pRAID_Context->regLockFlags     = REGION_TYPE_SHARED_READ;
 -              pRAID_Context->timeoutValue     = raid->fpIoTimeoutForLd;
 +              pRAID_Context->timeoutValue     = cpu_to_le16(raid->fpIoTimeoutForLd);
                pRAID_Context->VirtualDiskTgtId = cpu_to_le16(device_id);
                pRAID_Context->regLockRowLBA    = 0;
                pRAID_Context->regLockLength    = 0;
@@@ -1837,7 -1846,7 +1837,7 @@@ megasas_build_io_fusion(struct megasas_
         */
        io_request->IoFlags = cpu_to_le16(scp->cmd_len);
  
 -      if (megasas_is_ldio(scp))
 +      if (megasas_cmd_type(scp) == READ_WRITE_LDIO)
                megasas_build_ldio_fusion(instance, scp, cmd);
        else
                megasas_build_dcdb_fusion(instance, scp, cmd);
@@@ -2245,7 -2254,7 +2245,7 @@@ build_mpt_mfi_pass_thru(struct megasas_
         * megasas_complete_cmd
         */
  
 -      if (frame_hdr->flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)
 +      if (frame_hdr->flags & cpu_to_le16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE))
                cmd->flags = MFI_FRAME_DONT_POST_IN_REPLY_QUEUE;
  
        fusion = instance->ctrl_context;
@@@ -2334,7 -2343,7 +2334,7 @@@ megasas_issue_dcmd_fusion(struct megasa
  
  /**
   * megasas_release_fusion -   Reverses the FW initialization
-  * @intance:                  Adapter soft state
+  * @instance:                 Adapter soft state
   */
  void
  megasas_release_fusion(struct megasas_instance *instance)
@@@ -2376,8 -2385,6 +2376,8 @@@ megasas_alloc_host_crash_buffer(struct 
                                "memory allocation failed at index %d\n", i);
                        break;
                }
 +              memset(instance->crash_buf[i], 0,
 +                      ((1 << PAGE_SHIFT) << instance->crash_buf_pages));
        }
        instance->drv_buf_alloc = i;
  }
@@@ -2638,6 -2645,7 +2638,6 @@@ int megasas_reset_fusion(struct Scsi_Ho
                                instance->host->host_no);
                        megaraid_sas_kill_hba(instance);
                        instance->skip_heartbeat_timer_del = 1;
 -                      instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
                        retval = FAILED;
                        goto out;
                }
                                }
                        }
  
 -                      clear_bit(MEGASAS_FUSION_IN_RESET,
 -                                &instance->reset_flags);
 -                      instance->instancet->enable_intr(instance);
 -                      instance->adprecovery = MEGASAS_HBA_OPERATIONAL;
 -
 +                      if (megasas_get_ctrl_info(instance)) {
 +                              dev_info(&instance->pdev->dev,
 +                                      "Failed from %s %d\n",
 +                                      __func__, __LINE__);
 +                              megaraid_sas_kill_hba(instance);
 +                              retval = FAILED;
 +                      }
                        /* Reset load balance info */
                        memset(fusion->load_balance_info, 0,
                               sizeof(struct LD_LOAD_BALANCE_INFO)
                        if (!megasas_get_map_info(instance))
                                megasas_sync_map_info(instance);
  
 +                      clear_bit(MEGASAS_FUSION_IN_RESET,
 +                                &instance->reset_flags);
 +                      instance->instancet->enable_intr(instance);
 +                      instance->adprecovery = MEGASAS_HBA_OPERATIONAL;
 +
                        /* Restart SR-IOV heartbeat */
                        if (instance->requestorId) {
                                if (!megasas_sriov_start_heartbeat(instance, 0))
                               "successful for scsi%d.\n",
                                instance->host->host_no);
  
 -                      if (instance->crash_dump_drv_support) {
 -                              if (instance->crash_dump_app_support)
 -                                      megasas_set_crash_dump_params(instance,
 -                                              MR_CRASH_BUF_TURN_ON);
 -                              else
 -                                      megasas_set_crash_dump_params(instance,
 -                                              MR_CRASH_BUF_TURN_OFF);
 -                      }
 +                      if (instance->crash_dump_drv_support &&
 +                              instance->crash_dump_app_support)
 +                              megasas_set_crash_dump_params(instance,
 +                                      MR_CRASH_BUF_TURN_ON);
 +                      else
 +                              megasas_set_crash_dump_params(instance,
 +                                      MR_CRASH_BUF_TURN_OFF);
 +
                        retval = SUCCESS;
                        goto out;
                }
                       "adapter scsi%d.\n", instance->host->host_no);
                megaraid_sas_kill_hba(instance);
                instance->skip_heartbeat_timer_del = 1;
 -              instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
                retval = FAILED;
        } else {
                /* For VF: Restart HB timer if we didn't OCR */
index b7cf1982d1d94055b5eade551dcc59fe6e353aaf,9cfb56d9e0eafe045e50ab83593d5e8e303f5b16..56ecb8b5115dd66b8d0db52849e9738e127a2afa
@@@ -60,7 -60,6 +60,7 @@@ config USB_SERIAL_SIMPL
                - Suunto ANT+ USB device.
                - Medtronic CareLink USB device
                - Fundamental Software dongle.
 +              - Google USB serial devices
                - HP4x calculators
                - a number of Motorola phones
                - Novatel Wireless GPS receivers
@@@ -171,7 -170,7 +171,7 @@@ config USB_SERIAL_FTDI_SI
        ---help---
          Say Y here if you want to use a FTDI SIO single port USB to serial
          converter device. The implementation I have is called the USC-1000.
-         This driver has also be tested with the 245 and 232 devices.
+         This driver has also been tested with the 245 and 232 devices.
  
          See <http://ftdi-usb-sio.sourceforge.net/> for more
          information on this driver and the device.
@@@ -607,10 -606,10 +607,10 @@@ config USB_SERIAL_CYBERJAC
          If unsure, say N.
  
  config USB_SERIAL_XIRCOM
 -      tristate "USB Xircom / Entregra Single Port Serial Driver"
 +      tristate "USB Xircom / Entrega Single Port Serial Driver"
        select USB_EZUSB_FX2
        help
 -        Say Y here if you want to use a Xircom or Entregra single port USB to
 +        Say Y here if you want to use a Xircom or Entrega single port USB to
          serial converter device.  This driver makes use of firmware
          developed from scratch by Brian Warner.
  
index f1bd3962e6b6d2388ff611da201bf87584f7d5b2,9ac6f263956b4ea2875d55d665e3d71c79923b81..8ca6d6464ea31fd7fa8c9faf53c9b5aa5c58980e
@@@ -6,16 -6,15 +6,16 @@@
   *
   *  ebtables.c,v 2.0, April, 2002
   *
-  *  This code is stongly inspired on the iptables code which is
+  *  This code is strongly inspired by the iptables code which is
   *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
   */
  #ifndef __LINUX_BRIDGE_EFF_H
  #define __LINUX_BRIDGE_EFF_H
  
 +#include <linux/if.h>
 +#include <linux/if_ether.h>
  #include <uapi/linux/netfilter_bridge/ebtables.h>
  
 -
  /* return values for match() functions */
  #define EBT_MATCH 0
  #define EBT_NOMATCH 1
index 773dfe8924c7e76a0411e08247663203a69e5306,ab46c805c455741ff95fd2606c51bc94058227ba..fd2ee501726d6949d8680a70f95a686602b3b6b2
@@@ -6,13 -6,15 +6,13 @@@
   *
   *  ebtables.c,v 2.0, April, 2002
   *
-  *  This code is stongly inspired on the iptables code which is
+  *  This code is strongly inspired by the iptables code which is
   *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
   */
  
  #ifndef _UAPI__LINUX_BRIDGE_EFF_H
  #define _UAPI__LINUX_BRIDGE_EFF_H
 -#include <linux/if.h>
  #include <linux/netfilter_bridge.h>
 -#include <linux/if_ether.h>
  
  #define EBT_TABLE_MAXNAMELEN 32
  #define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
index 91180a7fc94376ea3ca7eecf274c03c3bc919590,54df89edcf204e25ec96d56df9094e9aa9803719..c2cabbe6fa58170f650e00eaac4996a5f5d74818
@@@ -6,7 -6,7 +6,7 @@@
   *
   *  ebtables.c,v 2.0, July, 2002
   *
-  *  This code is stongly inspired on the iptables code which is
+  *  This code is strongly inspired by the iptables code which is
   *  Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
   *
   *  This program is free software; you can redistribute it and/or
@@@ -133,7 -133,7 +133,7 @@@ ebt_basic_match(const struct ebt_entry 
        __be16 ethproto;
        int verdict, i;
  
 -      if (vlan_tx_tag_present(skb))
 +      if (skb_vlan_tag_present(skb))
                ethproto = htons(ETH_P_8021Q);
        else
                ethproto = h->h_proto;