24 Feb, 2016

40 commits

  • 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
     
  • We were setting the queue depth correctly, then setting it back to
    two. If you hit this as a bisection point then please send me an email
    as it would imply we've been hiding other bugs with this one.

    Cc:
    Signed-off-by: Alan Cox
    Reviewed-by: Hannes Reinicke
    Signed-off-by: Martin K. Petersen

    Alan
     
  • When logging async events the scsi_id, wwpn, and node_name values are
    used directly from the CRQ struct which are of type __be64. This can be
    confusing to someone looking through the log on a LE system. Instead
    byteswap these values to host endian prior to logging.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • In a couple places the magic value of 2 is used to check the return code
    of hypercalls. This translates to H_CLOSED.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • The values returned by the show functions for the host os_type,
    mad_version, and partition_number attributes get their values directly
    from the madapter_info struct whose associated fields are __be32
    typed. Added endian conversion to ensure these values are sane on LE
    platforms.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • A VIOSRP_HOST_CONFIG_TYPE management datagram (MAD) has existed in the
    code for some time. From what information I've gathered from Brian King
    this was likely implemented on the host side in a SLES 9 based VIOS,
    which is no longer supported anywhere. Further, it is not defined in
    PAPR or supported by any AIX based VIOS.

    Treating as bit rot and removing the associated host config code. The
    config attribute and its show function are left as not to break
    userspace. The behavior remains the same returning nothing.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • The root node of the OF device tree is exported as of_root. No need to
    look up the root by path name. Instead just get a reference directly via
    of_root.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • Add defines for mad version and mad os_type, and replace the magic
    numbers in set_adapter_info() accordingly.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Manoj Kumar
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • The PAPR defines four valid header values for the first byte of a CRQ
    message. Namely, an unused/empty message (0x00), a valid
    command/response entry (0x80), a valid initialization entry (0xC0), and
    a valid transport event (0xFF). Further, initialization responses have
    two formats namely initialize (0x01) and initialize complete
    (0x02). Define these values as enums and use them in the code in
    place of their magic number equivalents.

    Signed-off-by: Tyrel Datwyler
    Reported-by: Johannes Thumshirn
    Reviewed-by: Manoj Kumar
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • The enum values for VIOSRP_LINUX_FORMAT and VIOSRP_INLINE_FORMAT are off
    by one. They are currently defined as 0x06 and 0x07 respetively. These
    values are defined in PAPR correctly as 0x05 and 0x06. This
    inconsistency has gone unnoticed as neither enum is currently used. The
    possible future support of PING messages between the VIOS and client
    adapter relies on VIOSRP_INLINE_FORMAT crq messages. Corrected these
    enum values to match PAPR definitions.

    Signed-off-by: Tyrel Datwyler
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Manoj Kumar
    Signed-off-by: Martin K. Petersen

    Tyrel Datwyler
     
  • Removed cpumask_clear as it is not required for zalloc_cpumask_var and
    free free_cpumask_var before freeing reply_q.

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

    Suganath prabu Subramani
     
  • Several functions in lpfc have comments stating that the function must
    be called with the hbalock (or hostlock, or ringlock) held. Add
    lockdep_assert_held() annotations to these functions, so one can
    actually verify the locks are held.

    Signed-off-by: Johannes Thumshirn
    Acked-by: Dick Kennedy
    Signed-off-by: Martin K. Petersen

    Johannes Thumshirn
     
  • __bfa_trc() compiles to 115 bytes of machine code.
    With this .config: http://busybox.net/~vda/kernel_config
    there are 1494 calls of __bfa_trc().

    __bfa_trc32() is very similar, so it is uninlined too.
    However, it appears to be unused, therefore this patch
    ifdefs it out.

    Change in code size is about 130,000 bytes:

    text data bss dec hex filename
    85975426 22294712 20627456 128897594 7aed23a vmlinux.before
    85842882 22294584 20627456 128764922 7accbfa vmlinux

    [mkp: Removed unused __bfa_trc32()]

    Signed-off-by: Denys Vlasenko
    Acked-by: Anil Gurumurthy
    CC: Fabian Frederick
    CC: Anil Gurumurthy
    CC: Christoph Hellwig
    CC: Guenter Roeck
    CC: Ben Hutchings
    CC: James Bottomley
    CC: linux-kernel@vger.kernel.org
    CC: linux-scsi@vger.kernel.org
    Signed-off-by: Martin K. Petersen

    Denys Vlasenko
     
  • Modify ppa driver to use the new parallel port device model.

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

    Sudip Mukherjee
     
  • We are getting build warning about:
    "Section mismatch in reference from the variable sim710_eisa_driver to
    the function .init.text:sim710_eisa_probe()
    The variable sim710_eisa_driver references the function __init
    sim710_eisa_probe()"

    sim710_eisa_probe() was having __init but that was being referenced from
    sim710_eisa_driver.

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

    Sudip Mukherjee
     
  • In case of error, the memory allocated for phwi_ctrlr was not freed.

    Signed-off-by: Maurizio Lombardi
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Jitendra Bhivare
    Signed-off-by: Martin K. Petersen

    Maurizio Lombardi