26 Feb, 2016

3 commits

  • struct timeval will overflow on 32-bit systems in y2038 and is being
    removed from the kernel. Replace the use of struct timeval and
    do_gettimeofday() with ktime_get_real_seconds() which provides a 64-bit
    seconds value and is y2038 safe.

    gdth driver requires changes in two areas:

    1) gdth_store_event() loads two u32 timestamp fields for ioctl GDTIOCTL_EVENT

    These timestamp fields are part of struct gdth_evt_str used for passing
    event data to userspace. At the first instance of an event we do
    (first_stamp=last_stamp="current time"). If that same event repeats,
    we do (last_stamp="current time") AND increment same_count to indicate
    how many times the event has repeated since first_stamp.

    This patch replaces the use of timeval and do_gettimeofday() with
    ktime_get_real_seconds() cast to u32 to extend the timestamp fields
    to y2106.

    Beyond y2106, the userspace tools (ie. RAID controller monitors) can
    work around the time rollover and this driver would still not need to
    change.

    Alternative: The alternative approach is to introduce a new ioctl in gdth
    with the u32 time fields defined as u64. This would require userspace
    changes now, but not in y2106.

    2) gdth_show_info() calculates elapsed time using u32 first_stamp

    It is adding events with timestamps to a seq_file. Timestamps are
    calculated as the "current time" minus the first_stamp.

    This patch replaces the use of timeval and do_gettimeofday() with
    ktime_get_real_seconds() cast to u32 to calculate the timestamp.

    This elapsed time calculation is safe even when the time wraps (beyond
    y2106) due to how unsigned subtraction works. A comment has been added
    to the code to indicate this safety.

    Alternative: This piece itself doesn't warrant an alternative, but
    if we do introduce a new structure & ioctl with u64 timestamps, this
    would change accordingly.

    Signed-off-by: Alison Schofield
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Martin K. Petersen

    Alison Schofield
     
  • The variable is_ver1 is always true and so OSD_CAP_LEN can never be
    used.

    Reported by Coverity.

    Signed-off-by: Sudip Mukherjee
    Reviewed-by: Matthew R. Ochs
    Acked-by: Boaz harrosh
    Signed-off-by: Martin K. Petersen

    Sudip Mukherjee
     
  • parport_claim() can fail and we should be checking if we were able to
    claim the port.

    Signed-off-by: Sudip Mukherjee
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Martin K. Petersen

    Sudip Mukherjee
     

24 Feb, 2016

37 commits

  • Add S3/S4 support, add .suspend and .resume function in pci_driver. In
    .suspend handler, driver send S3/S4 signal to the device.

    Signed-off-by: Charles Chiou
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Charles
     
  • 1. Add hotplug support. Pegasus support surprise removal. To this end, I
    use return_abnormal_state function to return DID_NO_CONNECT for all
    commands which sent to driver.

    2. Remove stex_hba_stop in stex_remove because we cannot send command to
    device after hotplug.

    3. Add new device status: MU_STATE_STOP, MU_STATE_NOCONNECT,
    MU_STATE_STOP. MU_STATE_STOP is currently not referenced.
    MU_STATE_NOCONNECT represent that device is plugged out from the
    host.

    4. Use return_abnormal_function() to substitute part of code in
    stex_do_reset.

    Signed-off-by: Charles Chiou
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Charles
     
  • Pegasus is a high performace hardware RAID solution designed to unleash
    the raw power of Thunderbolt technology.

    1. Add code to distinct SuperTrack and Pegasus series by sub device ID.
    It should support backward compatibility.

    2. Change the driver version.

    Signed-off-by: Charles Chiou
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Charles
     
  • Reviewed-by: Kevin Barnett
    Reviewed-by: Justin Lindley
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • Reviewed-by: Justin Lindley
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • This patch depends on patch
    - commit ac10a3e4ed64
    ("Export function scsi_scan.c:sanitize_inquiry_string")

    Suggested-by: Hannes Reinecke
    Suggested-by: Matthew R. Ochs mrochs@linux.vnet.ibm.com
    Reviewed-by: Mahesh Rajashekhara
    Reviewed-by: Justin Lindley
    Reviewed-by: Scott Teel
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • An oops can occur when submitting ioaccel2 commands when the phys_disk
    pointer is NULL in hpsa_scsi_ioaccel_raid_map. Happens when there are
    configuration changes during I/O operations.

    If the phys_disk pointer is NULL, send the command down the RAID path.

    Reviewed-by: Mahesh Rajashekhara
    Reviewed-by: Justin Lindley
    Reviewed-by: Scott Teel
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • Aborts were not being sent down to HBA devices

    Reviewed-by: Mahesh Rajashekhara
    Reviewed-by: Justin Lindley
    Reviewed-by: Scott Teel
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • The bitmap was changed after this definition was added to the
    driver. Correcting the bitmap definition.

    Reviewed-by: Mahesh Rajashekhara
    Reviewed-by: Justin Lindley
    Reviewed-by: Scott Teel
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • Reviewed-by: Mahesh Rajashekhara
    Reviewed-by: Justin Lindley
    Reviewed-by: Scott Teel
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • Stop annoying "Error, could not get enclosure information"
    messages.

    Reviewed-by: Mahesh Rajashekhara
    Reviewed-by: Justin Lindley
    Reviewed-by: Scott Teel
    Reviewed-by: Kevin Barnett
    Reviewed-by: Matthew R. Ochs
    Signed-off-by: Don Brace
    Signed-off-by: Martin K. Petersen

    Don Brace
     
  • [mkp: Fixed merge due to patches 20-22 of series being postponed]

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • If a device needs to be rescanned the device_handler might need
    to be rechecked, too.
    So add a 'rescan' callback to the device handler and call it
    upon scsi_rescan_device(). The rescan callback will be invoked
    from the Unit Attention handling of ASC/ASCQ 3F 03
    (INQUIRY DATA HAS CHANGED).

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • Sending a 'REPORT TARGET PORT GROUP' command is a costly operation,
    as the array has to gather information about all ports.
    So instead of using RTPG to poll for a status update when a port
    is in transitioning we should be sending a TEST UNIT READY, and
    wait for the sense code to report success.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Ewan Milne
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • When we read in the target port group state we should be
    updating all affected port groups, otherwise we risk
    running out of sync.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • When we receive a unit attention code of 'ALUA state changed'
    we should recheck the state, as it might be due to an implicit
    ALUA state transition. This allows us to return NEEDS_RETRY
    instead of ADD_TO_MLQUEUE, allowing to terminate the retries
    after a certain time.
    At the same time a workqueue item might already be queued, which
    should be started immediately to avoid any delays.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • Add a new blacklist flag BLIST_SYNC_ALUA to instruct the
    alua device handler to use synchronous command submission
    for ALUA commands.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • Some arrays may only capable of handling one STPG at a time,
    so this patch adds a singlethreaded workqueue for STPGs to be
    submitted synchronously.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • The current ALUA device_handler has two drawbacks:
    - We're sending a 'SET TARGET PORT GROUP' command to every LUN,
    disregarding the fact that several LUNs might be in a port group
    and will be automatically switched whenever _any_ LUN within
    that port group receives the command.
    - Whenever a LUN is in 'transitioning' mode we cannot block I/O
    to that LUN, instead the controller has to abort the command.
    This leads to increased traffic across the wire and heavy load
    on the controller during switchover.

    With this patch the RTPG handling is moved to a per-portgroup
    workqueue. This reduces the number of 'REPORT TARGET PORT GROUP'
    and 'SET TARGET PORT GROUPS' sent to the controller as we're sending
    them now per port group, and not per device as previously.
    It also allows us to block I/O to any LUN / port group found to be
    in 'transitioning' ALUA mode, as the workqueue item will be requeued
    until the controller moves out of transitioning.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • The 'relative port' field is not used, and might get stale when
    the port group changes. So remove the field altogether.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • When the optimize_stpg module option is set we should just set it
    once during port_group allocation. Doing so allows us to override
    it later with device specific settings.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • …ceed while TPG is transitioning")

    This reverts commit a8e5a2d593cbfccf530c3382c2c328d2edaa7b66

    Obsoleted by the next patch.

    Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Ewan Milne <emilne@redhat.com>
    Signed-off-by: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

    Hannes Reinecke
     
  • Rework alua_check_vpd() to use scsi_vpd_get_tpg()
    and move the port group selection into the function, too.
    With that we can simplify alua_initialize() to just
    call alua_check_tpgs() and alua_check_vpd();

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • Use scsi_vpd_lun_id() to assign a unique device identification
    to the alua port group structure.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • The port group needs to be a separate structure as several
    LUNs might belong to the same group.

    Reviewed-by: Christoph Hellwig
    Reviewed-by: Ewan Milne
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • The RTPG buffer will only evaluated within alua_rtpg(),
    so we can allocate it locally there and avoid having to
    put it into the global structure.

    Reviewed-by: Ewan Milne
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • All commands are issued synchronously, so no need to open-code
    scsi_execute_req_flags() anymore. And we can get rid of the
    static sense code structure element. scsi_execute_req_flags()
    will be setting REQ_QUIET and REQ_PREEMPT, but that is
    perfectly fine as we're evaluating and logging any errors
    ourselves and we really need to send the command even if
    the device is quiesced.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Ewan Milne
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • If the call to SET TARGET PORT GROUPS fails we have no idea what
    state the array is left in, so we need to issue a call to
    REPORT TARGET PORT GROUPS in these cases.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • The 'activate_complete' function needs to be executed after
    stpg has finished, so we can as well execute stpg synchronously
    and call the function directly.

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • Separate out SET TARGET PORT GROUP functionality into a separate
    function alua_stpg().

    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • Pass in the buffer as a function argument for submit_rtpg().

    Reviewed-by: Martin K. Petersen
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Bart Van Assche
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     
  • mpt_attach() was not checking for the failure to create fw_event_q.
    Also, iounmap() was not being called in all error cases after ioremap()
    had been called by mpt_mapresources().

    Signed-off-by: Ewan D. Milne
    Reported-by: Insu Yun
    Reviewed-by: Tomas Henzl
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Ewan D. Milne
     
  • We were getting build warning about:
    drivers/scsi/dpt_i2o.c:183:29: warning: 'dptids' defined but not used

    dptids[] is only used in the MODULE_DEVICE_TABLE so when MODULE is not
    defined then dptids[] becomes unused.

    Signed-off-by: Sudip Mukherjee
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Sudip Mukherjee
     
  • Updating maintainers list for MPT FUSION DRIVERS, broadcom support link
    and email id.

    Signed-off-by: Suganath prabu Subramani
    Signed-off-by: Chaitra P B
    Signed-off-by: Martin K. Petersen

    Suganath prabu Subramani
     
  • Deallocate resources before reallocating of the same in retry_allocation
    path of _base_allocate_memory_pools()

    Signed-off-by: Suganath prabu Subramani
    Signed-off-by: Chaitra P B
    Reviewed-by: Tomas Henzl
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Suganath prabu Subramani
     
  • If you feed 32 bytes in then the kstrtoull() doesn't receive a terminated
    string so will run off the end.

    Signed-off-by: Alan Cox
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Alan
     
  • Check the array size *before* dereferencing it with a user provided
    offset.

    Signed-off-by: Alan Cox
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Tomas Henzl
    Signed-off-by: Martin K. Petersen

    Alan