1. 01 6月, 2015 4 次提交
    • S
      hpsa: factor out hpsa_init_cmd function · 360c73bd
      Stephen Cameron 提交于
      Factor out hpsa_cmd_init from cmd_alloc().  We also need
      this for resubmitting commands down the default RAID path
      when they have returned from the ioaccel paths with errors.
      
      In particular, reinitialize the cmd_type and busaddr fields as these
      will not be correct for submitting down the RAID stack path
      after ioaccel command completion.
      
      This saves time when submitting commands.
      Reviewed-by: NScott Teel <scott.teel@pmcs.com>
      Reviewed-by: NKevin Barnett <kevin.barnett@pmcs.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Reviewed-by: NHannes Reinecke <hare@Suse.de>
      Signed-off-by: NDon Brace <don.brace@pmcs.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      360c73bd
    • S
      hpsa: hpsa decode sense data for io and tmf · 9437ac43
      Stephen Cameron 提交于
      In hba mode, we could get sense data in descriptor format so
      we need to handle that.
      
      It's possible for CommandStatus to have value 0x0D
      "TMF Function Status", which we should handle.  We will get
      this from a P1224 when aborting a non-existent tag, for
      example.  The "ScsiStatus" field of the errinfo field
      will contain the TMF function status value.
      Reviewed-by: NScott Teel <scott.teel@pmcs.com>
      Reviewed-by: NKevin Barnett <kevin.barnett@pmcs.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Signed-off-by: NDon Brace <don.brace@pmcs.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      9437ac43
    • W
      hpsa: rework controller command submission · 25163bd5
      Webb Scales 提交于
      Allow driver initiated commands to have a timeout.  It does not
      yet try to do anything with timeouts on such commands.
      
      We are sending a reset in order to get rid of a command we want to abort.
      If we make it return on the same reply queue as the command we want to abort,
      the completion of the aborted command will not race with the completion of
      the reset command.
      
      Rename hpsa_scsi_do_simple_cmd_core() to hpsa_scsi_do_simple_cmd(), since
      this function is the interface for issuing commands to the controller and
      not the "core" of that implementation.  Add a parameter to it which allows
      the caller to specify the reply queue to be used.  Modify existing callers
      to specify the default reply queue.
      
      Rename __hpsa_scsi_do_simple_cmd_core() to hpsa_scsi_do_simple_cmd_core(),
      since this routine is the "core" implementation of the "do simple command"
      function and there is no longer any other function with a similar name.
      Modify the existing callers of this routine (other than
      hpsa_scsi_do_simple_cmd()) to instead call hpsa_scsi_do_simple_cmd(), since
      it will now accept the reply_queue paramenter, and it provides a controller
      lock-up check.  (Also, tweak two related message strings to make them
      distinct from each other.)
      
      Submitting a command to a locked up controller always results in a timeout,
      so check for controller lock-up before submitting.
      
      This is to enable fixing a race between command completions and
      abort completions on different reply queues in a subsequent patch.
      We want to be able to specify which reply queue an abort completion
      should occur on so that it cannot race the completion of the command
      it is trying to abort.
      
      The following race was possible in theory:
      
        1. Abort command is sent to hardware.
        2. Command to be aborted simultaneously completes on another
           reply queue.
        3. Hardware receives abort command, decides command has already
           completed and indicates this to the driver via another different
           reply queue.
        4. driver processes abort completion finds that the hardware does not know
           about the command, concludes that therefore the command cannot complete,
           returns SUCCESS indicating to the mid-layer that the scsi_cmnd may be
           re-used.
        5. Command from step 2 is processed and completed back to scsi mid
           layer (after we already promised that would never happen.)
      
      Fix by forcing aborts to complete on the same reply queue as the command
      they are aborting.
      
      Piggybacking device rescanning functionality onto the lockup
      detection thread is not a good idea because if the controller
      locks up during device rescanning, then the thread could get
      stuck, then the lockup isn't detected.  Use separate work
      queues for device rescanning and lockup detection.
      
      Detect controller lockup in abort handler.
      
      After a lockup is detected, return DO_NO_CONNECT which results in immediate
      termination of commands rather than DID_ERR which results in retries.
      
      Modify detect_controller_lockup() to return the result, to remove the need for
      a separate check.
      Reviewed-by: NScott Teel <scott.teel@pmcs.com>
      Reviewed-by: NKevin Barnett <kevin.barnett@pmcs.com>
      Signed-off-by: NWebb Scales <webbnh@hp.com>
      Signed-off-by: NDon Brace <don.brace@pmcs.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      25163bd5
    • S
      hpsa: add masked physical devices into h->dev[] array · 41ce4c35
      Stephen Cameron 提交于
      Cache the ioaccel handle so that when we need to abort commands sent
      down the ioaccel2 path, we can look up the LUN ID in h->dev[] instead of
      having to do I/O to the controller.
      
      Add a field to elements in h->dev[] to keep track of how the device is exposed
      to the SCSI mid layer: Not at all, without an upper level driver
      (no_uld_attach) or normally exposed.
      
      Since masked physical devices are now present in h->dev[] array
      it would be perfectly possible to do
      
      	echo scsi add-single-device 2 2 0 0 > /proc/scsi/scsi
      
      and bring them online.  This was previously not allowed for masked
      physical devices.
      
      Ensure that the mapping of physical disks to logical drives gets updated in a
      consistent way when a RAID migration occurs and is not touched until updates
      to it are complete.
      
      now instead of doing CISS_REPORT_PHYSICAL to get the LUNID for
      the physical disk in hpsa_get_pdisk_of_ioaccel2(), just get
      it out of h->dev[] where we already have it cached.
      
      do not touch phys_disk[] for ioaccel enabled logical drives during rescan
      Reviewed-by: NScott Teel <scott.teel@pmcs.com>
      Reviewed-by: NKevin Barnett <kevin.barnett@pmcs.com>
      Reviewed-by: NTomas Henzl <thenzl@redhat.com>
      Reviewed-by: NHannes Reinecke <hare@Suse.de>
      Signed-off-by: NDon Brace <don.brace@pmcs.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      41ce4c35
  2. 03 2月, 2015 6 次提交
  3. 20 11月, 2014 3 次提交
  4. 02 6月, 2014 4 次提交
  5. 16 3月, 2014 16 次提交
  6. 20 12月, 2013 2 次提交
  7. 10 5月, 2012 3 次提交
  8. 19 2月, 2012 2 次提交
    • S
      [SCSI] hpsa: eliminate 8 external target limitation · aca4a520
      Scott Teel 提交于
      Driver limits SAS external target IDs to range 1-8.
      Need to increase limit and clean up overlapping concepts of targets and paths
      in the code.
      
      There are several defined constants that control this:
      HPSA_MAX_TARGETS_PER_CTLR     16
      MAX_MSA2XXX_ENCLOSURES        32
      HPSA_MAX_PATHS                8
      
      We can condense this to one constant:
      MAX_EXT_TARGETS               32
      
      SAS switches allow for 8 connections, and there is capacity for 4 switches per
      enclosure in largest blade enclosure type.
      Signed-off-by: NScott Teel <scott.teel@hp.com>
      Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      aca4a520
    • S
      [SCSI] hpsa: removed unneeded structure member max_sg_entries and fix badly... · d66ae08b
      Stephen M. Cameron 提交于
      [SCSI] hpsa: removed unneeded structure member max_sg_entries and fix badly named constant MAXSGENTRIES
      
      We had both h->max_sg_entries and h->maxsgentries in the per controller
      structure which is terribly confusing.  max_sg_entries was really
      just a constant, 32, which defines how big the "block fetch table"
      is, which is as large as the max number of SG elements embedded
      within a command (excluding SG elements in chain blocks).
      
      MAXSGENTRIES was the constant used to denote the max number of SG
      elements embedded within a command, also a poor name.
      
      So renamed MAXSGENTREIS to SG_ENTRIES_IN_CMD, and removed
      h->max_sg_entries and replaced it with SG_ENTRIES_IN_CMD.
      
      h->maxsgentries is unchanged, and is the maximum number of sg
      elements the controller will support in a command, including
      those in chain blocks, minus 1 for the chain block pointer..
      Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      d66ae08b