1. 21 Dec, 2010 22 commits
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Sanity check for phy count is added using max phy count · b41c09d1
      Kashyap, Desai authored
      Fix oops loading driver when there is direct attached
      SEP device
      
      The driver set max phys count to the value reported in sas iounit page
      zero.  However this page doesn't take into account additional virutal
      phys.  When sas topology event arrives, the phy count is larger than
      expected, and the driver accesses memory array beyond the end of
      allocated space, then oops.  Manufacturing page 8 contains the info
      on direct attached phys.
      
      For this fix will making sure that sas topology event is not
      processing phys greater than the expected phy count.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      b41c09d1
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: change queue depth with reason argument more appropriately · a93c6b45
      Kashyap, Desai authored
      change_queue_depth callback API changed
      The change_queue_depth callback changed where there is now an additional
      parameter called reason, with SCSI_QDEPTH_DEFAULT, SCSI_QDEPTH_QFULL,
      and SCSI_QDEPTH_RAMP_UP codes.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      a93c6b45
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Remove code for TASK_SET_FULL from driver. · 90d2a672
      Kashyap, Desai authored
      remove support for MPI2_EVENT_TASK_SET_FULL
      This event is obsoleted, so this processing of this event
      needs to be removed from the driver.  The controller firmware is going
      to handle TASK_SET_FULL, the driver doesn't need to do anything.
      Even though we are removing the EVENT handling, the behavour has not
      changed between driver versions becuase fimrware will still be handling
      queue throttling, and retrying of commands when the target device queues
      are full.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      90d2a672
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: MPI 2.0 Header updated · 7d061402
      Kashyap, Desai authored
      MPI2 Rev header files.
      
      1) Removed Task Set Full Event. Modified description of Disable SCSI
      Initiator Task Set Full Handling bit in the Flags field of IO Unit
      Page 1. Modified the descriptions for the three queue depth fields in
      SAS IO Unit Page 1.
      (2) Added new value for the Current Operation bits of the Flags field
      in the RAID Volume Indicator Structure to indicate that the Make Data
      Consistent operation is running.
      (3) Added a value of 0x6 to various SAS link rate fields to indicate an
      attached PHY that is not using any commonly supported settings.
      (4) Added Volume Not Consistent bit to the VolumeStatusFlags field of
      RAID Volume Page 0.
      (5) Added a new value for the IncompatibleReason field of RAID Physical
      Disk Page 0 to indicate an incompatible media type.
      (6) Added Diagnostic Data Upload tool for the Toolbox Request.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      7d061402
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Modify code to support Expander switch · 7f6f794d
      Kashyap, Desai authored
      Issue : Switch swap doesn't work when device missing delay is enabled.
      
      (1) add support to individually add and remove phys to and from
      existing ports. This replaces the routine
      _transport_delete_duplicate_port.
      (2) _scsih_sas_host_refresh - was modified to change the link rate
      from zero to 1.5 GB rate when the firmware reports there is an
      attached device with zero link.
      (3) add new function mpt2sas_device_remove, this is wrapper function
      deletes some redundant code through out driver by combining into one
      subrountine
      (4) two subroutines were modified so the sas_device, raid_device, and
      port lists are traversed once when objects are deleted from the list.
      Previously it was looping back each time an object was deleted from the
      list.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      7f6f794d
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Create a pool of chain buffer instead of dedicated per IOs · 35f805b5
      Kashyap, Desai authored
      Create a pool of chain buffers, instead of dedicated per IO:
      This enahancment is to address memory allocation failure when asking
      for more than 2300 IOs per host.   There is just not enough contiquious
      DMA physical memory to make one single allocation to hold both message
      frames and chain buffers when asking for more than 2300 request. In order
      to address this problem we will have to allocate memory for each chain
      buffer in a seperate individual memory allocation, placing each chain
      element of 128 bytes onto a pool of available chains, which can be
      shared amoung all request.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      35f805b5
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Added loadtime para for IOMissingDelay and DMD · 6cb8ef57
      Kashyap, Desai authored
      Ability to override/set the ReportDeviceMissingDelay and
      IODeviceMissingDelay from driver: Add new command line option missing_delay,
      this is an array, where the first element is the device missing delay,
      and the second element is io missing delay.  The driver will program
      sas iounit page 1 with the new setting when the driver loads. This is
      programmed to the current and persistent configuration page so this takes
      immediately, as will be sticky across host reboots.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      6cb8ef57
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Added sanity check for cb_idx and smid access. · dd3741d3
      Kashyap, Desai authored
      Sometime it is seen that controller
      firmware returns an invalid system message id (smid).
      
      the oops is occurring becuase mpt_callbacks pointer is referenced to
      either null or invalid virtual address.  this is due to cb_idx set
      incorrectly from routine _base_get_cb_idx.  the cb_idx was set incorrectly
      becuase there is no check to make sure smid is less than maxiumum
      anticapted smid.   to fix this issue, we add a check in
      _base_get_cb_idx to make sure smid is not greater than
      ioc->hba_queue_depth.   in addition, a similar check was added to make
      sure the reply address was less than the largest anticapated address.
      
      Newer firmware has sovled this issue, however it good to have this sanity
      check.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      dd3741d3
    • Kashyap, Desai's avatar
      [SCSI] mpt2sas: Removed compiler warnnings when logging is disabled · 363fa50f
      Kashyap, Desai authored
      The compiler throws warning messages while compiling without
      CONFIG_SCSI_MPT2SAS_LOGGING.
      Set proper ifdef for CONFIG_SCSI_MPT2SAS_LOGGING to avoid warnnings.
      Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      363fa50f
    • James Smart's avatar
    • James Smart's avatar
    • James Smart's avatar
      [SCSI] lpfc 8.3.19: Added support for ELS RRQ command · 19ca7609
      James Smart authored
      Added support for ELS RRQ command
      
      - Add new routine lpfc_set_rrq_active() to track XRI qualifier state.
      - Add new module parameter lpfc_enable_rrq to control RRQ operation.
      - Add logic to ELS RRQ completion handler and xri qualifier timeout
        to clear XRI qualifier state.
      - Use OX_ID from XRI_ABORTED_CQE for RRQ payload.
      - Tie abort and XRI_ABORTED_CQE andler to RRQ generation.
      Signed-off-by: default avatarAlex Iannicelli <alex.iannicelli@emulex.com>
      Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      19ca7609
    • James Smart's avatar
      [SCSI] lpfc 8.3.19: Add SLI4 FC Discovery support · 76a95d75
      James Smart authored
      Add SLI4 FC Discovery support
      
      - Replace READ_LA and READ_LA64 with READ_TOPOLOGY mailbox command.
      - Converted the old READ_LA structure to use bf_set/get instead of bit fields.
      - Rename HBA_FCOE_SUPPORT flag to HBA_FCOE_MODE. Flag now indicates function
        is running as SLI-4 FC or FCoE port. Make sure flag reset each time
        READ_REV completed as it can dynamically change.
      - Removed BDE union in the READ_TOPOLOGY mailbox command and added a define to
        define the ALPA MAP SIZE. Added FC Code for async events.
      - Added code to support new 16G link speed.
      - Define new set of values to keep track of valid user settable link speeds.
      - Used new link speed definitions to define link speed max and bitmap.
      - Redefined FDMI Port sppeds to be hax values and added the 16G value.
      - Added new CQE trailer code for FC Events.
      - Add lpfc_issue_init_vfi and lpfc_init_vfi_cmpl routines.
      - Replace many calls to the initial_flogi routine with lpfc_issue_init_vfi.
      - Add vp and vpi fields to the INIT_VFI mailbox command.
      - Addapt lpfc_hba_init_link routine for SLI4 use.
      - Use lpfc_hba_init_link call from lpfc_sli4_hba_setup.
      - Add a check for FC mode to register the FCFI before init link.
      - Convert lpfc_sli4_init_vpi to be called without a vpi (get it from vport).
      Signed-off-by: default avatarAlex Iannicelli <alex.iannicelli@emulex.com>
      Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      76a95d75
    • James Smart's avatar
      [SCSI] lpfc 8.3.19: Add latest SLI4 Hardware initialization support · 085c647c
      James Smart authored
      - Add the Lancer FC and FCoE PCI IDs
      - Add new SLI4 INTF register definitions
      - Implement new SLI4 doorbell register
      Signed-off-by: default avatarAlex Iannicelli <alex.iannicelli@emulex.com>
      Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      085c647c
    • James Smart's avatar
      [SCSI] lpfc 8.3.19: Fix critical errors and crashes · 63e801ce
      James Smart authored
      Fix critical errors and crashes
      
      - Replace LOF_SECURITY with LOG_SECURITY
      - When calculating diag test memory size, use full size with header.
      - Return LS_RJT with status=UNSUPPORTED on unrecognized ELS's
      - Correct NULL pointer dereference when lpfc_create_vport_work_array()
        returns NULL.
      - Added code to handle CVL when port is in LPFC_VPORT_FAILED state.
      - In lpfc_do_scr_ns_plogi, check the nodelist for FDMI_DID and reuse
        the resource.
      - Check for generic request 64 and calculate the sgl offset for the request
        and reply sgls, also calculate the xmit length using only the request bde.
      Signed-off-by: default avatarAlex Iannicelli <alex.iannicelli@emulex.com>
      Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      63e801ce
    • James Bottomley's avatar
      [SCSI] fix id computation in scsi_eh_target_reset() · 98db5195
      James Bottomley authored
      The current code in scsi_eh_target_reset() has an off by one error
      that actually sends spurious extra resets.  Since there's no real need
      to reset the targets in numerical order, simply chunk up the command
      recovery list doing target resets and pulling matching targets out of
      the list (that also makes the loop O(N) instead of O(N^2).
      
      [mike christie found and fixed a list_splice -> list_splice_init problem]
      
      Reported-by: Hillf Danton<dhillf@gmail.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      98db5195
    • Wayne Boyer's avatar
      [SCSI] ipr: fix mailbox register definition and add a delay before reading · 110def85
      Wayne Boyer authored
      The definition for the mailbox register for new adapters was incorrect.  The
      value has been updated to the correct offset.
      
      After an adapter reset, the mailbox register on the new adapters takes a
      number of seconds to stabilize.  A delay has been added before reading the
      register.
      Signed-off-by: default avatarWayne Boyer <wayneb@linux.vnet.ibm.com>
      Acked-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      110def85
    • Wayne Boyer's avatar
      [SCSI] ipr: fix lun assignment and comparison · 0cb992ed
      Wayne Boyer authored
      The lun value was not getting set up correctly for all devices attached to the
      new 64 bit adapters.  The fix is to move the logic to earlier in the
      ipr_init_res_entry routine such that the value does get set correctly for all
      devices.
      
      Then the ipr_is_same_device comparison function was using the wrong lun value
      in the logic for the new adapters.  Change this to use the correct lun value.
      Signed-off-by: default avatarWayne Boyer <wayneb@linux.vnet.ibm.com>
      Acked-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      0cb992ed
    • Luben Tuikov's avatar
      [SCSI] Retrieve the Caching mode page · 24d720b7
      Luben Tuikov authored
      Some kernel transport drivers unconditionally disable
      retrieval of the Caching mode page. One such for example is
      the BBB/CBI transport over USB.  Such a restraint is too
      harsh as some devices do support the Caching mode
      page. Unconditionally enabling the retrieval of this mode
      page over those transports at their transport code level may
      result in some devices failing and becoming unusable.
      
      This patch implements a method of retrieving the Caching
      mode page without unconditionally enabling it in the
      transports which unconditionally disable it. The idea is to
      ask for all supported pages, page code 0x3F, and then search
      for the Caching mode page in the mode parameter data
      returned. The sd driver already asks for all the mode pages
      supported by the attached device by setting the page code to
      0x3F in order to find out if the media is write protected by
      reading the WP bit in the Device Specific Parameter
      field. It then attempts to retrieve only the Caching mode
      page by setting the page code to 8 and actually attempting
      to retrieve it if and only if the transport allows it.
      
      The method implemented here is that if the transport doesn't
      allow retrieval of the Caching mode page and the device is
      not RBC, then we ask for all pages supported by setting the
      page code to 0x3F (similarly to how the WP bit is retrieved
      above), and then we search for the Caching mode page in the
      mode parameter data returned.
      
      With this patch, devices over SATA, report this (no change):
      
      Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
      Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
      Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] Write Protect is off
      Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
      Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
      
      Smart devices report their Caching mode page. This is a
      change where we'd previously see the kernel making
      assumption about the device's cache being write-through:
      
      Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0
      Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] 610472646 4096-byte logical blocks: (2.50 TB/2.27 TiB)
      Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] Write Protect is off
      Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] Mode Sense: 47 00 10 08
      Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
      
      And "dumb" devices over BBB, are correctly shown not to
      support reporting the Caching mode page:
      
      Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] 15663104 512-byte logical blocks: (8.01 GB/7.46 GiB)
      Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] Write Protect is off
      Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] Mode Sense: 23 00 00 00
      Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] No Caching mode page present
      Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] Assuming drive cache: write through
      Signed-off-by: default avatarLuben Tuikov <ltuikov@yahoo.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      24d720b7
    • Dan Williams's avatar
      [SCSI] libsas: fix definition of wideport, include local sas address · 00f0254e
      Dan Williams authored
      To date libsas has only looked at the attached sas address when
      determining the formation of wide ports.  The specification and some
      hardware expects that phys with different addresses will not form a wide
      port unless the local peer phys also match each other.  Introduce a flag
      to select stricter behavior at sas_register_ha() time.  The flag can be
      dropped once it is known that all libsas users expect the same behavior.
      
      Current drivers just initialize this field to zero and get the
      traditional behavior.
      Reported-by: default avatarPatrick Thomson <patrick.s.thomson@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      00f0254e
    • Alan Stern's avatar
      [SCSI] sd: improve logic and efficiecy of media-change detection · 3ff5588d
      Alan Stern authored
      This patch (as1415) improves the formerly incomprehensible logic in
      sd_media_changed() (the current code refers to "changed" as a state,
      whereas in fact it is a relation between two states).  It also adds a
      big comment so that everyone can understand what is really going on.
      
      The patch also improves efficiency by not reporting a media change
      when no medium was ever present.  If no medium was present the last
      time we checked and there's still no medium, it's not necessary to
      tell the caller that a change occurred.  Doing so merely causes the
      caller to attempt to revalidate a non-existent disk, which is a waste
      of time.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      3ff5588d
    • James Bottomley's avatar
      [SCSI] fix up documentation for change in ->queuecommand to lockless calling · 29687512
      James Bottomley authored
      The current doc still says we call it with the host lock held, which is
      going to cause confusion.
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      29687512
  2. 20 Dec, 2010 1 commit
  3. 16 Dec, 2010 2 commits
  4. 15 Dec, 2010 15 commits