26 Aug, 2013

1 commit

  • The IO command size is 128 bytes for these new controllers as opposed to 64
    for the old 8001 controller.

    The Adaptec out-of-tree driver did this correctly. After comparing the two
    this turned out to be the crucial difference.

    So don't hardcode the IO command size, instead use pm8001_ha->iomb_size as
    that is the correct value for both old and new controllers.

    Signed-off-by: Hans Verkuil
    Acked-by: Anand Kumar Santhanam
    Acked-by: Jack Wang
    Cc: stable@vger.kernel.org # for v3.10 and up
    Signed-off-by: James Bottomley

    Hans Verkuil
     

05 Jun, 2013

2 commits

  • Coccinelle complains about the inconsistent NULL checking on "t". It
    turns out the check isn't needed because we verified that "t" is
    non-NULL at the start of the function.

    Signed-off-by: Dan Carpenter
    Acked-by: Anand Kumar Santhanam
    Signed-off-by: James Bottomley

    Dan Carpenter
     
  • 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

10 commits


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
     

10 May, 2012

1 commit

  • This is a followup to a patch provided by Jack Wang on September 21 2011.

    After increasing the CAN_QUEUE to 510 in pm8001 we discovered some performance
    degredation from time to time. We needed to increase the MPI queue to
    compensate and ensure we never hit that limit. We also needed to double
    the margin to support event and administrivial commands that take from
    the pool resulting in an occasional largely unproductive command completion
    with soft error to the caller when the command pool is overloaded temporarily.

    Signed-off-by: Mark Salyzyn
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Mark Salyzyn
     

24 Apr, 2012

1 commit


01 Apr, 2012

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is primarily another round of driver updates (lpfc, bfa, fcoe,
    ipr) plus a new ufshcd driver. There shouldn't be anything
    controversial in here (The final deletion of scsi proc_ops which
    caused some build breakage has been held over until the next merge
    window to give us more time to stabilise it).

    I'm afraid, with me moving continents at exactly the wrong time,
    anything submitted after the merge window opened has been held over to
    the next merge window."

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (63 commits)
    [SCSI] ipr: Driver version 2.5.3
    [SCSI] ipr: Increase alignment boundary of command blocks
    [SCSI] ipr: Increase max concurrent oustanding commands
    [SCSI] ipr: Remove unnecessary memory barriers
    [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters
    [SCSI] ipr: Fix target id allocation re-use problem
    [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
    [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
    [SCSI] bfa: Update the driver version to 3.0.23.0
    [SCSI] bfa: BSG and User interface fixes.
    [SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.
    [SCSI] bfa: Move service parameter programming logic into firmware.
    [SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
    [SCSI] bfa: Flash controller IOC pll init fixes.
    [SCSI] bfa: Serialize the IOC hw semaphore unlock logic.
    [SCSI] bfa: Modify ISR to process pending completions
    [SCSI] bfa: Add fc host issue lip support
    [SCSI] mpt2sas: remove extraneous sas_log_info messages
    [SCSI] libfc: fcoe_transport_create fails in single-CPU environment
    [SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]
    ...

    Linus Torvalds
     

28 Mar, 2012

1 commit


23 Mar, 2012

1 commit

  • SCSI updates from James Bottomley:
    "The update includes the usual assortment of driver updates (lpfc,
    qla2xxx, qla4xxx, bfa, bnx2fc, bnx2i, isci, fcoe, hpsa) plus a huge
    amount of infrastructure work in the SAS library and transport class
    as well as an iSCSI update. There's also a new SCSI based virtio
    driver."

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (177 commits)
    [SCSI] qla4xxx: Update driver version to 5.02.00-k15
    [SCSI] qla4xxx: trivial cleanup
    [SCSI] qla4xxx: Fix sparse warning
    [SCSI] qla4xxx: Add support for multiple session per host.
    [SCSI] qla4xxx: Export CHAP index as sysfs attribute
    [SCSI] scsi_transport: Export CHAP index as sysfs attribute
    [SCSI] qla4xxx: Add support to display CHAP list and delete CHAP entry
    [SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry
    [SCSI] pm8001: fix endian issue with code optimization.
    [SCSI] pm8001: Fix possible racing condition.
    [SCSI] pm8001: Fix bogus interrupt state flag issue.
    [SCSI] ipr: update PCI ID definitions for new adapters
    [SCSI] qla2xxx: handle default case in qla2x00_request_firmware()
    [SCSI] isci: improvements in driver unloading routine
    [SCSI] isci: improve phy event warnings
    [SCSI] isci: debug, provide state-enum-to-string conversions
    [SCSI] scsi_transport_sas: 'enable' phys on reset
    [SCSI] libsas: don't recover end devices attached to disabled phys
    [SCSI] libsas: fixup target_port_protocols for expanders that don't report sata
    [SCSI] libsas: set attached device type and target protocols for local phys
    ...

    Linus Torvalds
     

01 Mar, 2012

3 commits

  • 1. Fix endian issue.
    2. Fix the following warning :
    " drivers/scsi/pm8001/pm8001_hwi.c:2932:32: warning: comparison
    between ‘enum sas_device_type’ and ‘enum sas_dev_type’".
    3. Few code optimization.

    Signed-off-by: Santosh Nayak
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Santosh Nayak
     
  • There is a possble racing scenario.

    'process_oq' is called by two routines, as shown below.

    pm8001_8001_dispatch = {
    .......

    .isr = pm8001_chip_isr --> process_oq,// A
    .isr_process_oq = process_oq, // B
    .....
    }

    process_oq() --> process_one_iomb() --> mpi_sata_completion()

    In 'mpi_sata_completion', "pm8001_ha->lock" is first released.
    It means lock is taken before, which is true for
    the context A, as 'pm8001_ha->lock' is taken in 'pm8001_chip_isr()'

    But for context B there is no lock taken before and pm8001_ha->lock
    is unlocked in 'mpi_sata_completion()'. This may unlock the lock
    taken in context A. Possible racing ??

    If 'pm8001_ha->lock' is taken in 'process_oq()' instead of
    'pm8001_chip_isr' then the above issue can be avoided.

    Signed-off-by: Santosh Nayak
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Santosh Nayak
     
  • Static checker is giving following warning:
    " error: calling 'spin_unlock_irqrestore()' with bogus flags"

    The code flow is as shown below:
    process_oq() --> process_one_iomb --> mpi_sata_completion

    In 'mpi_sata_completion'
    the first call for 'spin_unlock_irqrestore()' is with flags=0,
    which is as good as 'spin_unlock_irq()' ( unconditional interrupt
    enabling).

    So for better performance 'spin_unlock_irqrestore()' can be replaced
    with 'spin_unlock_irq()' and 'spin_lock_irqsave()' can be replaced by
    'spin_lock_irq()'.

    Signed-off-by: Santosh Nayak
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Santosh Nayak
     

19 Feb, 2012

2 commits

  • IO_XFER_ERROR_BREAK and IO_XFER_OPEN_RETRY_TIMEOUT are deficient of the
    required actions as outlined in the programming manual for the pm8001. Due to
    the overlapping code requirements of these recovery responses, we found it
    necessary to bundle them together into one patch.

    When a break is received during the command phase (ssp_completion), this is a
    result of a timeout or interruption on the bus. Logic suggests that we should
    retry the command.

    When a break is received during the data-phase (ssp_event), the task must be
    aborted on the target or it will retain a data-phase lock turning the target
    reticent to all future media commands yet will successfully respond to TUR,
    INQUIRY and ABORT leading eventually to target failure through several
    abort-cycle loops.

    The open retry interval is exceedingly short resulting in occasional target
    drop-off during expander resets or when targets push-back during bad-block
    remapping. Increased effective timeout from 130ms to 1.5 seconds for each try
    so as to trigger after the administrative inquiry/tur timeout in the scsi
    subsystem to keep error-recovery harmonics to a minimum.

    When an open retry timeout event is received, the action required by the
    targets is to issue an abort for the outstanding command then logic suggests
    we retry the command as this state is usually an indication of a credit block
    or busy condition on the target.

    We hijacked the pm8001_handle_event work queue handler so that it will handle
    task as an argument instead of device for the workers in support of the
    deferred handling outlined above.

    Moderate to Heavy bad-path testing on a 2.6.32 vintage kernel, compile-testing
    on scsi-misc-2.6 kernel ...

    Signed-off-by: Mark Salyzyn
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Mark Salyzyn
     
  • Jack noticed I dropped a patch fragment associated with a flags automatic
    variable in mpi_set_phys_g3_with_ssc (ooops) and that the pre-emptive locking
    that piggy-backed this patch was not in-fact necessary because of underlying
    atomic accesses to the hardware. Here is the updated patch fixing these two
    issues.

    The pm8001 driver is missing the FUNC_GET_EVENTS handler in the phy control
    function. Since the pm8001_bar4_shift function was not designed to be called
    at runtime, added locking surrounding the adjustment for all accesses.

    Signed-off-by: Mark Salyzyn
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Mark Salyzyn
     

04 Feb, 2012

1 commit


03 Oct, 2011

1 commit

  • Code Inspection: found two missing break directives. First one will
    result in not retrying an a task that report
    IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY, the second will result in cosmetic
    debug printk conflicting statement stutter. Because checkpatch.pl came
    up with a warning regarding unnecessary space before a newline on one of
    the fragments associated with the diff context, I took the liberty of
    fixing all the cases of this issue in the pair of files touched by this
    defect. These cosmetic changes hide the break changes :-(

    To help focus, break changes are in pm8001_hwi.c fragment line 1649 for
    the IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY case statement and pm8001_sas.c
    line 1000 deals with the conflicting debug print stutter.

    Signed-off-by: Mark Salyzyn
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Mark Salyzyn
     

31 Mar, 2011

1 commit


13 Feb, 2011

1 commit

  • pm8001 manages its own list of pending works and cancel them on device
    free. It is unnecessarily complex and has a race condition - the
    works are canceled but not synced, so the work could still be running
    during and after the data structures are freed.

    This patch simplifies workqueue usage.

    * A driver specific workqueue pm8001_wq is created to serve these
    work items.

    * To avoid confusion, the "queue" suffixes are dropped from work items
    and functions.

    * Delayed queueing was never used. pm8001_work now uses work_struct
    instead.

    * The driver no longer keeps track of pending works. All pm8001_works
    are queued to pm8001_wq and the workqueue is flushed as necessary.

    flush_scheduled_work() usage is removed during conversion.

    Signed-off-by: Tejun Heo
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Tejun Heo
     

10 Sep, 2010

1 commit


07 Aug, 2010

1 commit

  • Error handling code following a kmalloc should free the allocated data.

    The semantic match that finds the problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    expression E;
    identifier f,f1;
    position p1,p2;
    @@

    x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
    }
    when != (x) == NULL
    when != (x) != NULL
    when != (x) == 0
    when != (x) != 0
    (
    x->f1 = E
    |
    (x->f1 == NULL || ...)
    |
    f(...,x->f1,...)
    )
    ...>
    (
    return ;
    |
    return@p2 ...;
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
    //

    Signed-off-by: Julia Lawall
    Acked-by: jack wang
    Signed-off-by: James Bottomley

    Julia Lawall
     

05 Aug, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits)
    Documentation: update broken web addresses.
    fix comment typo "choosed" -> "chosen"
    hostap:hostap_hw.c Fix typo in comment
    Fix spelling contorller -> controller in comments
    Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault
    fs/Kconfig: Fix typo Userpace -> Userspace
    Removing dead MACH_U300_BS26
    drivers/infiniband: Remove unnecessary casts of private_data
    fs/ocfs2: Remove unnecessary casts of private_data
    libfc: use ARRAY_SIZE
    scsi: bfa: use ARRAY_SIZE
    drm: i915: use ARRAY_SIZE
    drm: drm_edid: use ARRAY_SIZE
    synclink: use ARRAY_SIZE
    block: cciss: use ARRAY_SIZE
    comment typo fixes: charater => character
    fix comment typos concerning "challenge"
    arm: plat-spear: fix typo in kerneldoc
    reiserfs: typo comment fix
    update email address
    ...

    Linus Torvalds
     

28 Jul, 2010

1 commit

  • We have two separate definitions for identical constants with nearly the
    same name. One comes from the generic headers in scsi.h; the other is
    an enum in libsas.h ... it's causing confusion about which one is
    correct (fortunately they both are).

    Fix this by eliminating the libsas.h duplicate

    Signed-off-by: James Bottomley

    James Bottomley
     

17 Jun, 2010

2 commits


11 Apr, 2010

1 commit

  • The region set by the call to memset is immediately overwritten by the
    subsequent call to memcpy.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression e1,e2,e3,e4;
    @@

    - memset(e1,e2,e3);
    memcpy(e1,e4,e3);
    //

    Signed-off-by: Julia Lawall
    Acked-by: Jack Wang
    Signed-off-by: James Bottomley

    Julia Lawall
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

09 Feb, 2010

1 commit

  • In particular, several occurances of funny versions of 'success',
    'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
    'beginning', 'desirable', 'separate' and 'necessary' are fixed.

    Signed-off-by: Daniel Mack
    Cc: Joe Perches
    Cc: Junio C Hamano
    Signed-off-by: Jiri Kosina

    Daniel Mack
     

11 Dec, 2009

3 commits