16 Mar, 2014

2 commits

  • The version of isci driver has not been updated for 2 years.
    It was 83 isci commits ago. Suspend/resume support has been implemented
    and many bugs have been fixed since 1.1. Now update the version to 1.2.

    Signed-off-by: Lukasz Dorau
    Signed-off-by: Dave Jiang
    Signed-off-by: Maciej Patelczyk
    Signed-off-by: James Bottomley

    Lukasz Dorau
     
  • isci is needlessly tying libata's hands by returning
    SAM_STAT_CHECK_CONDITION to some ata errors. Instead, prefer
    SAS_PROTO_RESPONSE to let libata (via sas_ata_task_done()) disposition
    the device-to-host fis.

    For example isci is triggering an HSM Violation where AHCI is showing a
    simple media error for the same bus condition:

    isci:
    ata7.00: failed command: READ VERIFY SECTOR(S)
    ata7.00: cmd 40/00:01:00:00:00/00:00:00:00:00/e0 tag 0
    res 01/04:00:00:00:00/00:00:00:00:00/e0 Emask 0x3 (HSM violation)

    ahci:
    ata6.00: failed command: READ VERIFY SECTOR(S)
    ata6.00: cmd 40/00:01:00:00:00/00:00:00:00:00/e0 tag 0
    res 51/40:01:00:00:00/00:00:00:00:00/e0 Emask 0x9 (media error)

    Note that the isci response matches this from sas_ata_task_done():
    /* We saw a SAS error. Send a vague error. */
    [..]
    dev->sata_dev.fis[3] = 0x04; /* status err */
    dev->sata_dev.fis[2] = ATA_ERR;

    The end effect is that isci is needlessly triggering hard resets when
    they are not necessary.

    Reported-by: Xun Ni
    Tested-by: Nelson Cheng
    Acked-by: Lukasz Dorau
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     

10 Mar, 2014

2 commits

  • In the first place, the loop 'for' in the macro 'for_each_isci_host'
    (drivers/scsi/isci/host.h:314) is incorrect, because it accesses
    the 3rd element of 2 element array. After the 2nd iteration it executes
    the instruction:
    ihost = to_pci_info(pdev)->hosts[2]
    (while the size of the 'hosts' array equals 2) and reads an
    out of range element.

    In the second place, this loop is incorrectly optimized by GCC v4.8
    (see http://marc.info/?l=linux-kernel&m=138998871911336&w=2).
    As a result, on platforms with two SCU controllers,
    the loop is executed more times than it can be (for i=0,1 and 2).
    It causes kernel panic during entering the S3 state
    and the following oops after 'rmmod isci':

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] __list_add+0x1b/0xc0
    Oops: 0000 [#1] SMP
    RIP: 0010:[] [] __list_add+0x1b/0xc0
    Call Trace:
    [] __mutex_lock_slowpath+0x114/0x1b0
    [] mutex_lock+0x1f/0x30
    [] sas_disable_events+0x1b/0x50 [libsas]
    [] sas_unregister_ha+0x18/0x60 [libsas]
    [] isci_unregister+0x1e/0x40 [isci]
    [] isci_pci_remove+0x5d/0x100 [isci]
    [] pci_device_remove+0x3b/0xb0
    [] __device_release_driver+0x7f/0xf0
    [] driver_detach+0xa8/0xb0
    [] bus_remove_driver+0x9b/0x120
    [] driver_unregister+0x2c/0x50
    [] pci_unregister_driver+0x23/0x80
    [] isci_exit+0x10/0x1e [isci]
    [] SyS_delete_module+0x16b/0x2d0
    [] ? do_notify_resume+0x61/0xa0
    [] system_call_fastpath+0x16/0x1b

    The loop has been corrected.
    This patch fixes kernel panic during entering the S3 state
    and the above oops.

    Signed-off-by: Lukasz Dorau
    Reviewed-by: Maciej Patelczyk
    Tested-by: Lukasz Dorau
    Cc:
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Lukasz Dorau
     
  • Remove an erroneous BUG_ON() in the case of a hard reset timeout. The
    reset timeout handler puts the port into the "awaiting link-up" state.
    The timeout causes the device to be disconnected and we need to be in
    the awaiting link-up state to re-connect the port. The BUG_ON() made
    the incorrect assumption that resets never timeout and we always
    complete the reset in the "resetting" state.

    Testing this patch also uncovered that libata continues to attempt to
    reset the port long after the driver has torn down the context. Once
    the driver has committed to abandoning the link it must indicate to
    libata that recovery ends by returning -ENODEV from
    ->lldd_I_T_nexus_reset().

    Cc:
    Acked-by: Lukasz Dorau
    Reported-by: David Milburn
    Reported-by: Xun Ni
    Tested-by: Xun Ni
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     

26 Aug, 2013

1 commit


25 Jul, 2013

1 commit

  • Oops, apparently no-one I cc'd at intel actually bothered to check this
    patch for the isci driver:

    commit e73823f7a2c921dcf068d34ea03bd682498d9e42
    Author: James Bottomley
    Date: Tue May 7 15:38:18 2013 -0700

    [SCSI] libsas: implement > 16 byte CDB support

    sci_swab32_cpy needs multiples of four, so for commands that aren't that, it's
    rounding the wrong way. fix by doing (len+3)/4 instead of len/4.

    Reported-by: Tony Luck
    Tested-by: Tony Luck
    Signed-off-by: James Bottomley

    James Bottomley
     

23 Jul, 2013

1 commit

  • This commit fixes a race condition in the isci driver abort task and SSP
    device task management path. The race is caused when an I/O termination
    in the SCU hardware is necessary because of an SSP target timeout condition,
    and the check of the I/O end state races against the HW-termination-driven
    end state. The failure of the race meant that no TMF was sent to the device
    to clean-up the pending I/O.

    Signed-off-by: Jeff Skirvin
    Reviewed-by: Lukasz Dorau
    Cc:
    Signed-off-by: James Bottomley

    Jeff Skirvin
     

05 Jun, 2013

1 commit

  • Remove the arbitrary expectation in libsas that all SCSI commands are 16 bytes
    or less. Instead do all copies via cmd->cmd_len (and use a pointer to this in
    the libsas task instead of a copy). Note that this still doesn't enable > 16
    byte CDB support in the underlying drivers because their internal format has
    to be fixed and the wire format of > 16 byte CDBs according to the SAS spec is
    different. the libsas drivers (isci, aic94xx, mvsas and pm8xxx are all
    updated for this change.

    Cc: Lukasz Dorau
    Cc: Maciej Patelczyk
    Cc: Dave Jiang
    Cc: Jack Wang
    Cc: Lindar Liu
    Cc: Xiangliang Yu
    Signed-off-by: James Bottomley

    James Bottomley
     

10 May, 2013

1 commit

  • These enums have been separate since the dawn of SAS, mainly because the
    latter is a procotol only enum and the former includes additional state
    for libsas. The dichotomy causes endless confusion about which one you
    should use where and leads to pointless warnings like this:

    drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo':
    drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare]

    Fix by eliminating one of them. The one kept is effectively the sas.h
    one, but call it sas_device_type and make sure the enums are all
    properly namespaced with the SAS_ prefix.

    Signed-off-by: James Bottomley

    James Bottomley
     

12 Apr, 2013

1 commit

  • Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
    build warning when CONFIG_PM_SLEEP is not selected. This is because
    sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
    the CONFIG_PM_SLEEP is enabled.

    drivers/scsi/isci/init.c:725:12: warning: 'isci_suspend' defined but not used [-Wunused-function]
    drivers/scsi/isci/init.c:743:12: warning: 'isci_resume' defined but not used [-Wunused-function]

    Signed-off-by: Jingoo Han
    Acked-by: Lukasz Dorau
    Signed-off-by: James Bottomley

    Jingoo Han
     

31 Jan, 2013

1 commit

  • Originally 'efi_enabled' indicated whether a kernel was booted from
    EFI firmware. Over time its semantics have changed, and it now
    indicates whether or not we are booted on an EFI machine with
    bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.

    The immediate motivation for this patch is the bug report at,

    https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557

    which details how running a platform driver on an EFI machine that is
    designed to run under BIOS can cause the machine to become
    bricked. Also, the following report,

    https://bugzilla.kernel.org/show_bug.cgi?id=47121

    details how running said driver can also cause Machine Check
    Exceptions. Drivers need a new means of detecting whether they're
    running on an EFI machine, as sadly the expression,

    if (!efi_enabled)

    hasn't been a sufficient condition for quite some time.

    Users actually want to query 'efi_enabled' for different reasons -
    what they really want access to is the list of available EFI
    facilities.

    For instance, the x86 reboot code needs to know whether it can invoke
    the ResetSystem() function provided by the EFI runtime services, while
    the ACPI OSL code wants to know whether the EFI config tables were
    mapped successfully. There are also checks in some of the platform
    driver code to simply see if they're running on an EFI machine (which
    would make it a bad idea to do BIOS-y things).

    This patch is a prereq for the samsung-laptop fix patch.

    Cc: David Airlie
    Cc: Corentin Chary
    Cc: Matthew Garrett
    Cc: Dave Jiang
    Cc: Olof Johansson
    Cc: Peter Jones
    Cc: Colin Ian King
    Cc: Steve Langasek
    Cc: Tony Luck
    Cc: Konrad Rzeszutek Wilk
    Cc: Rafael J. Wysocki
    Cc:
    Signed-off-by: Matt Fleming
    Signed-off-by: H. Peter Anvin

    Matt Fleming
     

04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Adam Radford
    Cc: "James E.J. Bottomley"
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

13 Nov, 2012

1 commit

  • SATA MICROCODE DOWNALOAD fails on isci driver. After receiving Register
    Device to Host (FIS 0x34) frame Initiator resets phy.
    In the frame handler routine response (FIS 0x34) was copied into wrong
    buffer and upper layer did not receive any answer which resulted in
    timeout and reset.
    This patch corrects this bug.

    Signed-off-by: Maciej Patelczyk
    Signed-off-by: Lukasz Dorau
    Cc:
    Signed-off-by: James Bottomley

    Maciej Patelczyk
     

03 Oct, 2012

1 commit

  • Pull first round of SCSI updates from James Bottomley:
    "This is a large set of updates, mostly for drivers (qla2xxx [including
    support for new 83xx based card], qla4xxx, mpt2sas, bfa, zfcp, hpsa,
    be2iscsi, isci, lpfc, ipr, ibmvfc, ibmvscsi, megaraid_sas).

    There's also a rework for tape adding virtually unlimited numbers of
    tape drives plus a set of dif fixes for sd and a fix for a live lock
    on hot remove of SCSI devices.

    This round includes a signed tag pull of isci-for-3.6

    Signed-off-by: James Bottomley "

    Fix up trivial conflict in drivers/scsi/qla2xxx/qla_nx.c due to new PCI
    helper function use in a function that was removed by this pull.

    * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (198 commits)
    [SCSI] st: remove st_mutex
    [SCSI] sd: Ensure we correctly disable devices with unknown protection type
    [SCSI] hpsa: gen8plus Smart Array IDs
    [SCSI] qla4xxx: Update driver version to 5.03.00-k1
    [SCSI] qla4xxx: Disable generating pause frames for ISP83XX
    [SCSI] qla4xxx: Fix double clearing of risc_intr for ISP83XX
    [SCSI] qla4xxx: IDC implementation for Loopback
    [SCSI] qla4xxx: update copyrights in LICENSE.qla4xxx
    [SCSI] qla4xxx: Fix panic while rmmod
    [SCSI] qla4xxx: Fail probe_adapter if IRQ allocation fails
    [SCSI] qla4xxx: Prevent MSI/MSI-X falling back to INTx for ISP82XX
    [SCSI] qla4xxx: Update idc reg in case of PCI AER
    [SCSI] qla4xxx: Fix double IDC locking in qla4_8xxx_error_recovery
    [SCSI] qla4xxx: Clear interrupt while unloading driver for ISP83XX
    [SCSI] qla4xxx: Print correct IDC version
    [SCSI] qla4xxx: Added new mbox cmd to pass driver version to FW
    [SCSI] scsi_dh_alua: Enable STPG for unavailable ports
    [SCSI] scsi_remove_target: fix softlockup regression on hot remove
    [SCSI] ibmvscsi: Fix host config length field overflow
    [SCSI] ibmvscsi: Remove backend abstraction
    ...

    Linus Torvalds
     

02 Oct, 2012

2 commits

  • James Bottomley
     
  • Pull the trivial tree from Jiri Kosina:
    "Tiny usual fixes all over the place"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    doc: fix old config name of kprobetrace
    fs/fs-writeback.c: cleanup riteback_sb_inodes kerneldoc
    btrfs: fix the commment for the action flags in delayed-ref.h
    btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID
    vfs: fix kerneldoc for generic_fh_to_parent()
    treewide: fix comment/printk/variable typos
    ipr: fix small coding style issues
    doc: fix broken utf8 encoding
    nfs: comment fix
    platform/x86: fix asus_laptop.wled_type module parameter
    mfd: printk/comment fixes
    doc: getdelays.c: remember to close() socket on error in create_nl_socket()
    doc: aliasing-test: close fd on write error
    mmc: fix comment typos
    dma: fix comments
    spi: fix comment/printk typos in spi
    Coccinelle: fix typo in memdup_user.cocci
    tmiofb: missing NULL pointer checks
    tools: perf: Fix typo in tools/perf
    tools/testing: fix comment / output typos
    ...

    Linus Torvalds
     

24 Sep, 2012

2 commits

  • We always assign a dummy task context to a port in order to address a
    silicon issue. We have 4 ports per controller. So when idle, there are always
    exactly 4 TCs "active". The adaptive interrupt coalescing code uses number of
    active TCs to figure out the coalescing values. However, we never hit "0" TCs
    because of the 4 dummy TCs. Putting in fix so that we calculate this correctly.

    Reported-by: Dan Melnic
    Signed-off-by: Dave Jiang
    Signed-off-by: James Bottomley

    Dave Jiang
     
  • This commit fixes a driver bug for SSP tasks that require task management
    in the target after they complete in the SCU hardware. The problem was
    manifested in the function "isci_task_abort_task", which tests
    to see if the sas_task.lldd_task is non-NULL before allowing task
    management; this bug would always NULL lldd_task in the SCU I/O completion
    path even if target management was required, which would prevent
    task / target manangement from happening.

    Note that in the case of SATA/STP targets, error recovery is provided by
    the libata error handler which is why SATA/STP device recovery worked
    correctly even though SSP handling did not.

    Signed-off-by: Jeff Skirvin
    Signed-off-by: James Bottomley

    Jeff Skirvin
     

13 Sep, 2012

1 commit

  • isci update for 3.6

    1/ Fix the workaround for drives that have a slow response to COMSAS.
    Drives with this problem intermittently take a long time to be
    identified, or fail to be identified altogether.

    2/ A minor fix for the efi variable code failure path

    3/ A handful of smatch fixups from Dan Carpenter

    James Bottomley
     

02 Sep, 2012

1 commit


01 Sep, 2012

1 commit


24 Aug, 2012

1 commit

  • Provide a "simple-dev-pm-ops" implementation that shuts down the domain
    and the device on suspend, and resumes the device and the domain on
    resume. All of the mechanics of restoring domain connectivity are
    handled by libsas once isci has notified libsas that all links should be
    back up. libsas is in charge of handling links that did not resume, or
    resumed out of order.

    Signed-off-by: Artur Wojcik
    Signed-off-by: Jacek Danecki
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Artur Wojcik
     

20 Jul, 2012

1 commit


04 Jul, 2012

4 commits

  • These are __iomem. Sparse complains if we don't have that.

    drivers/scsi/isci/phy.c +149 70: warning:
    incorrect type in initializer (different address spaces)

    Signed-off-by: Dan Carpenter
    Signed-off-by: Dan Williams

    Dan Carpenter
     
  • Sparse complains that we redeclare this with a different type, because
    in the .c file we use an enum and in the .h file we declare the
    parameter as a u32. Probably it's best to use an enum in both places.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Dan Williams

    Dan Carpenter
     
  • The following patch is a fix for the WD workaround
    COMSAS negation timeout change. This patch disables the
    OOB SM when the OOB is placed in reset, which allows
    the updated COMSAS negation timeout value to take
    effect.

    Cc: Dan Thompson
    Reported-by: Dan Thompson
    Signed-off-by: Dave Maurer
    Signed-off-by: Dan Williams

    Dave Maurer
     
  • The oem parameter image embedded in the efi variable is at an offset
    from the start of the variable. However, in the failure path we try to
    free the 'orom' pointer which is only valid when the paramaters are
    being read from the legacy option-rom space.

    Since failure to load the oem parameters is unlikely and we keep the
    memory around in the success case just defer all de-allocation to devm.

    Cc:
    Reported-by: Don Morris
    Signed-off-by: Dan Williams

    Dan Williams
     

18 May, 2012

13 commits