14 Mar, 2009

15 commits


13 Mar, 2009

25 commits

  • …TION, NOT_READY(02/04/01)

    This patch is to add retry for mode select if mode select command is
    returned with sense NO_SENSE, UNIT_ATTENTION, ABORTED_COMMAND,
    NOT_READY(02/04/01). This patch reorganise the sense keys from if-else
    to switch-case format for better maintainability.

    Signed-off-by: Vijay Chauhan <vijay.chauhan@lsi.com>
    Acked-by: Chandra Seetharaman <sekharan@us.ibm.com>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

    Chauhan, Vijay
     
  • Report the fc_host_port_type as FC_PORTTYPE_NPIV when the subchannel
    is running in NPIV mode. This allows to see the correct type with
    lsscsi -H -t --list

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • A scheduled work might still be pending, running while the adapter is
    in progress to get dequeued from the system. This can lead to an
    invalid pointer dereference (Oops). Once the adpater is set online
    again, ensure the nameserver environment is initialized to the
    appropriate values again.

    Signed-off-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Swen Schillig
     
  • Ensure the refcounting is correct even if we were not able to
    schedule a work. In addition we have to make sure no scheduled
    work is pending while we're dequeing the adapter from the
    systems environment.

    Signed-off-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Swen Schillig
     
  • It will not be necessary to set the erp failed status bit
    in case a SCSI device is removed by the SCSI mid layer.
    In the case a SCSI device is unavailable for a short time
    (15 to 20 seconds) a FCP unit will not get on-line again.

    Signed-off-by: Martin Petermann
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Martin Petermann
     
  • Use the I/O blocking mechanism in the FC transport class to allow
    faster failovers for multipathing:
    - Call fc_remote_port_delete early to set the rport to BLOCKED.
    - Check the rport status in queuecommand with fc_remote_portchkready
    to no longer accept new I/O for this port and fail the I/O with the
    appropriate scsi_cmnd result.
    - Implement the terminate_rport_io handler to abort all pending I/O
    requests
    - Return SCSI commands with DID_TRANSPORT_DISRUPTED while erp is
    running.
    - When updating the remote port status, check for late changes and
    update the remote ports status accordingly.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • After an error condition resolved a remote storage port was never
    re-opened. The incoming RSCN was not processed accordingly due
    to a misinterpreted status flag / return value combination.

    Signed-off-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Swen Schillig
     
  • The usage of the PCI flag to trigger interrupts is optional. Even
    without setting the flag, qdio still receives interrupts to continue
    working on the queue. Remove the PCI flag from zfcp, it is not
    necessary.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • The current number based id ERP logging is replaced by a string
    based tag version. The benefit is an easier location of the code in
    question and the removal of the lengthy array referencing the
    individual messages.
    The string (7 bytes) based version does not use more space since those
    bytes were "used" anyway due to the alignment of the structure.
    The encoding of the 7 byte string is as follows
    [0-1] = filename
    [2-5] = task/function
    [6] = section
    Due to the character of this string (fixed length) a string
    termination is not required here.

    Signed-off-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Swen Schillig
     
  • An adapter close was always performed whether it was required,
    (e.g. in an error scenario) or not (e.g. initial open).
    This patch is changing the process in only doing an
    adapter close when it is required.

    Signed-off-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Swen Schillig
     
  • The status read response FSF_STATUS_READ_SUB_ERROR_PORT is not
    defined in the specs and therefore not valid.
    All occurrences are removed from the code.

    Signed-off-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Swen Schillig
     
  • Issue ELS ADISC requests from workqueue. This allows the link test
    request to be sent when the request queue is full due to I/O load for
    other remote ports. It also simplifies request queue locking,
    zfcp_fsf_send_fcp_command_task is now the only function that has
    interrupts disabled from the caller. This is also a prereq for the FC
    passthrough support that issues ELS requests from userspace.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • When the SCSI midlayer is running error recovery, the low-level error
    recovery in zfcp could be running and preventing the SCSI midlayer to
    issue error recovery requests. To avoid unnecessary error recovery
    escalation, wait for the zfcp erp to finish and retry if necessary.

    While reworking the SCSI eh handlers, alsa cleanup the code and
    simplify the interface from zfcp_scsi to the fsf layer.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • For calls from zfcp erp, scsi_eh and sysfs switch the calls issuing
    FSF requests to zfcp_fsf_req_sbal_get to wait for free SBALs.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • Only increment the req_id for successfully issued requests. This
    avoids some confusion when debugging issued fsf requests.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • The lock only needs to protect the softirq context called from qdio
    against the userspace context called from sysfs. spin_lock and
    spin_lock_bh is enough.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • Provide measurement data for the utilisation of the QDIO outbound queue.
    The additional value allows to calculate an average queue utilisation
    by looking at the deltas per time unit. Needed for capacity planning.
    It is up to user space to handle wrap-arounds of the 64 bit value.

    The new counter neatly complements the existing counter for queue full
    conditions. That is why, both statistics counter have been integrated.

    Signed-off-by: Martin Peschke
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Martin Peschke
     
  • Use the device pointer in zfcp_unit for tracking if we have a
    registered SCSI device. With this approach, the flag
    ZFCP_STATUS_UNIT_REGISTERED is only redundant and can be removed.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • PORT_PHYS_CLOSING is only set and cleared, but not actually used
    for status checking.

    PORT_INVALID_WWPN is set when the GID_PN request does not return
    a d_id for a remote port, e.g. when a remote port has been
    unplugged. For this case, the d_id is zero. In the erp we can
    check the d_id and use the normal escalation procedure that gives
    up after three retries and remove the special case.

    PORT_NO_WWPN is unused: Each port in the remote port list has a
    valid wwpn. The WKA ports are now tracked outside the port
    list. Remove the PORT_NO_WWPN flag, since this is no longer set
    for any port.

    Acked-by: Swen Schillig
    Signed-off-by: Christof Schmitt
    Signed-off-by: James Bottomley

    Christof Schmitt
     
  • The SCSI core calls scsi_proc_hostdir_add() from within
    scsi_host_alloc(), but the corresponding scsi_proc_hostdir_rm()
    routine is called from within scsi_remove_host(). As a result, if a
    host is allocated and then deallocated without ever being registered,
    the host's directory in /proc is leaked.

    This patch (as1181b) fixes this bug in the SCSI core by moving
    scsi_proc_hostdir_rm() into scsi_host_dev_release().

    Signed-off-by: Alan Stern
    Signed-off-by: James Bottomley

    Alan Stern
     
  • sym53c8xx prints a negotiation message after every check condition.
    This can add up to a lot of messages for removable-medium devices
    (CD-ROM, tape drives, etc.) that are being polled, since they return
    check condition when no medium is present. This patch suppresses the
    negotiation message if it would be the same as the last one printed.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • sym53c8xx uses a command queue depth of 2 for untagged devices,
    without good reason. This _mostly_ seems to work ok, but it has
    caused me some subtle problems. For example, I have an application
    where one thread sends write commands to a tape drive, and another
    thread sends log sense polling commands. With a queue depth of
    2, the polling commands end up being starved for long periods of
    time while multiple write commands are serviced (this may also be
    related to the fact the the sg driver queues commands in LIFO order).
    This problem is fixed by changing the queue depth to 1 for untagged
    devices. I have tested this change extensively with many different
    tape drives, medium changers, and disk drives (disk drives of course
    use tagged commands and are therefore unaffected by this patch).

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • sym_init_device() doesn't check if pci_iomap() fails. It also tries
    to map device RAM without first checking FE_RAM.

    1) Move some initialization from sym_init_device() to the top of
    sym2_probe().
    2) Rename sym_init_device() to sym_iomap_device().
    3) Call sym_iomap_device() after sym_check_supported() instead of
    before so that device->chip.features will be set.
    4) Check FE_RAM in sym_iomap_device() before mapping RAM.
    5) If sym_iomap_device() cannot map registers, then abort.
    6) If sym_iomap_device() cannot map RAM, then fall back to not using
    RAM and continue.
    7) Remove the check for FE_RAM in sym_attach() since dev->ram_base
    is now always set correctly.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • During sym2_probe(), sym_init_device() does pci_iomap(), but there is
    no corresponding pci_iounmap() if an error occurs before sym_attach()
    copies sym_device::s.{ioaddr,ramaddr} to np.
    1) Add the sym_iounmap_device() function.
    2) Call sym_iounmap_device() if an error occurs between
    sym_init_device() and the time sym_attach() allocates np.
    3) Make sym_attach() copy sym_device::s.{ioaddr,ramaddr} to np before
    calling any function that can fail so that sym_free_resources()
    will do the unmap instead of sym_iounmap_device().

    Also fixed by this patch:
    During sym2_probe(), if sym_check_raid() returns nonzero, then
    pci_release_regions() is never called.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • If sym_attach() gets an error at or before request_irq(), then
    sym_free_resources() will call free_irq() for an unregistered
    interrupt handler.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby