07 Jan, 2012

1 commit

  • pci_block_user_cfg_access was designed for the use case that a single
    context, the IPR driver, temporarily delays user space accesses to the
    config space via sysfs. This assumption became invalid by the time
    pci_dev_reset was added as locking instance. Today, if you run two loops
    in parallel that reset the same device via sysfs, you end up with a
    kernel BUG as pci_block_user_cfg_access detect the broken assumption.

    This reworks the pci_block_user_cfg_access to a sleeping service
    pci_cfg_access_lock and an atomic-compatible variant called
    pci_cfg_access_trylock. The former not only blocks user space access as
    before but also waits if access was already locked. The latter service
    just returns false in this case, allowing the caller to resolve the
    conflict instead of raising a BUG.

    Adaptions of the ipr driver were originally written by Brian King.

    Acked-by: Brian King
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Jan Kiszka
    Signed-off-by: Jesse Barnes

    Jan Kiszka
     

31 Oct, 2011

1 commit


20 Oct, 2011

1 commit

  • If an adapter dump times out, the ipr driver will abort the
    dump and proceed to reset and recover the adapter. When an
    adapter dump completes, the work thread which is reading the
    adapter dump will initiate an adapter reset to recover the
    adapter. However, when the adapter dump gets aborted, the
    work thread should not initiate an adapter reset, since an
    adapter reset is already in progress. This fixes a case of
    calling pci_block_user_cfg_access overlapped, which results
    in a BUG.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

16 Oct, 2011

1 commit

  • The write buffer command is used to download and burn new IOA FW images.
    The same interface can now be used to flash FPGA and flash back DRAM images.
    To download and flash the new images takes more than 15 minutes, so increase
    the write buffer command timeout to 30 minutes.

    The FPGA and flash back DRAM images don't have the same card_type as the IOA FW
    image. So, remove the sanity checking from the driver. The adapter has sanity
    checking and will only accept a valid image.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

22 Sep, 2011

1 commit

  • When the ipr driver decides to dump the adapter, it changes the
    sdt_state to GET_DUMP, then prepares the adapter so that the dump
    can be read. However, if the ipr worker thread wakes up for some
    reason before the driver has put the adapter in a state where it
    can succesfully dump the adapter, the driver will start dumping
    the adapter too early, which can potentially trigger a BUG check
    in the pci config blocking API. Fix this by adding a new
    sdt_state to differentiate between the ipr driver wanting to dump
    the adapter in the near future and wanting to dump the adapter now.

    Signed-off-by: Brian King
    Signed-off-by: James Bottomley

    Brian King
     

27 Aug, 2011

1 commit

  • During kdump testing I noticed timeouts when initialising each IPR
    adapter. While the driver has logic to detect an adapter in an
    indeterminate state, it wasn't triggering and each adapter went
    through a 5 minute timeout before finally going operational.

    Some analysis showed the needs_hard_reset flag wasn't getting set.
    We can check the reset_devices kernel parameter which is set by
    kdump and force a full reset. This fixes the problem.

    Signed-off-by: Anton Blanchard
    Cc:
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Anton Blanchard
     

27 Jul, 2011

1 commit

  • The out_msi_disable label should be before cleanup_nomem to additionally
    benefit from the call to iounmap. Subsequent gotos are adjusted to go to
    out_msi_disable instead of cleanup_nomem, which now follows it. This is
    safe because pci_disable_msi does nothing if pci_enable_msi was not called.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r@
    expression e1,e2;
    statement S;
    @@

    e1 = pci_ioremap_bar(...);
    ... when != e1 = e2
    when != iounmap(e1)
    when any
    (
    if () S
    |
    if(...) { ... return 0; }
    |
    if (...) { ... when != iounmap(e1)
    when != if (...) { ... iounmap(e1) ... }
    * return ...;
    } else S
    )
    //

    Signed-off-by: Julia Lawall
    Acked-by: Brian King
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Julia Lawall
     

25 May, 2011

1 commit

  • If the driver is getting flooded with interrupts, there's a possibility
    that the interrupt service routine could falsely detect a stuck interrupt
    condition and reset the adapter.

    This patch changes the logic such that the routine will loop back into
    the command processing code one more time after detecting the stuck
    interrupt signature. If there are no commands to process after that pass,
    and the interrupt is still not cleared, then the driver will print the
    "Error clearing HRRQ" message and reset the adapter.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

17 May, 2011

1 commit

  • I noticed a stream of errors from the IPR driver while doing
    IOMMU fault injection. Rate limit the errors so we don't clog
    up the console and logfiles.

    Signed-off-by: Anton Blanchard
    Acked-by: Brian King
    Signed-off-by: James Bottomley
    Signed-off-by: James Bottomley

    Anton Blanchard
     

02 May, 2011

1 commit

  • Currently the size of the dump generated by the driver is limited
    in 4MB, which is insufficient to gather much useful data from the
    new 64 bit adapters.

    This patch makes the needed changes to increase the dump limit
    for the 64 bit adapters to 32MB, or even to a bigger value in the
    future, but keeping the current limitations for the legacy 32 bit
    adapters.

    Signed-off-by: Kleber Sacilotto de Souza
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Kleber Sacilotto de Souza
     

01 May, 2011

3 commits

  • During performance testing on P7 machines it was observed that the interrupt
    service routine was doing unnecessary MMIO operations.

    This patch rearranges the logic of the routine and moves some of the code out
    of the main routine. The result is that there are now fewer MMIO operations in
    the performance path of the code.

    As a result of the above change, an existing condition was exposed where the
    driver could get an "unexpected" hrrq interrupt. The original code would flag
    the interrupt as unexpected and then reset the adapter. After further analysis
    it was confirmed that this condition can occasionally occur and that the
    interrupt can safely be ignored. Additional code in this patch detects this
    condition, clears the interrupt and allows the driver to continue without
    resetting the adapter.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • This patch removes three volatile declarations based on some feedback and code
    analysis.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • In testing it was noticed that Extended Delay after Reset flag was being set
    for gscsi and volume set devices. This had a negative effect on performance
    for volume sets. The fix is to only set the flag for gscsi devices.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

18 Mar, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits)
    [SCSI] scsi_dh_rdac: Add MD36xxf into device list
    [SCSI] scsi_debug: add consecutive medium errors
    [SCSI] libsas: fix ata list corruption issue
    [SCSI] hpsa: export resettable host attribute
    [SCSI] hpsa: move device attributes to avoid forward declarations
    [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
    [SCSI] sd: Logical Block Provisioning update
    [SCSI] Include protection operation in SCSI command trace
    [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
    [SCSI] target: Fix volume size misreporting for volumes > 2TB
    [SCSI] bnx2fc: Broadcom FCoE offload driver
    [SCSI] fcoe: fix broken fcoe interface reset
    [SCSI] fcoe: precedence bug in fcoe_filter_frames()
    [SCSI] libfcoe: Remove stale fcoe-netdev entries
    [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
    [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
    [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
    [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
    [SCSI] libfc: Fixing a memory leak when destroying an interface
    [SCSI] megaraid_sas: Version and Changelog update
    ...

    Fix up trivial conflicts due to whitespace differences in
    drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}

    Linus Torvalds
     

02 Mar, 2011

4 commits

  • All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
    c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe
    fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata:
    update libata core layer to use devres), so I think it's time to finally
    get rid of this flag...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap)
    removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
    Do it now, at last...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • These flags are marked as obsolete and the checks for them have been removed
    by commit 294440887b32c58d220fb54b73b7a58079b78f20 (libata-sff: kill unused
    ata_bus_reset()), so I think it's time to finally get rid of them...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Commit 14bdef982caeda19afe34010482867c18217c641 ([libata] convert drivers to
    use ata.h mode mask defines) didn't convert these two libata driver outside
    drivers/ata/...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     

19 Feb, 2011

1 commit

  • In a multiple configuration change scenario a remove notification can be
    followed by an immediate add notification for the same device, which
    will cause the device to be removed but never added back. This patch
    fixes the problem by ensuring that in such situations the device will be
    added back.

    Signed-off-by: Kleber Sacilotto de Souza
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Kleber Sacilotto de Souza
     

13 Feb, 2011

1 commit

  • Simple conversions to drop flush_scheduled_work() usages in
    drivers/scsi. More involved ones will be done in separate patches.

    * NCR5380, megaraid_sas: cancel_delayed_work() +
    flush_scheduled_work() -> cancel_delayed_work_sync().

    * mpt2sas_scsih: drop unnecessary flush_scheduled_work().

    * arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of
    using flush_scheduled_work().

    Signed-off-by: Tejun Heo
    Signed-off-by: James Bottomley

    Tejun Heo
     

15 Jan, 2011

1 commit

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
    PCI/PM: Report wakeup events before resuming devices
    PCI/PM: Use pm_wakeup_event() directly for reporting wakeup events
    PCI: sysfs: Update ROM to include default owner write access
    x86/PCI: make Broadcom CNB20LE driver EMBEDDED and EXPERIMENTAL
    x86/PCI: don't use native Broadcom CNB20LE driver when ACPI is available
    PCI/ACPI: Request _OSC control once for each root bridge (v3)
    PCI: enable pci=bfsort by default on future Dell systems
    PCI/PCIe: Clear Root PME Status bits early during system resume
    PCI: pci-stub: ignore zero-length id parameters
    x86/PCI: irq and pci_ids patch for Intel Patsburg
    PCI: Skip id checking if no id is passed
    PCI: fix __pci_device_probe kernel-doc warning
    PCI: make pci_restore_state return void
    PCI: Disable ASPM if BIOS asks us to
    PCI: Add mask bit definition for MSI-X table
    PCI: MSI: Move MSI-X entry definition to pci_regs.h

    Fix up trivial conflicts in drivers/net/{skge.c,sky2.c} that had in the
    meantime been converted to not use legacy PCI power management, and thus
    no longer use pci_restore_state() at all (and that caused trivial
    conflicts with the "make pci_restore_state return void" patch)

    Linus Torvalds
     

11 Jan, 2011

1 commit

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    pata_platform: Remove CONFIG_HAVE_PATA_PLATFORM's dependencies.
    pata_hpt37x: actually limit HPT370 to UltraDMA/66
    pata_hpt3x2n: coding style cleanup
    pata_hpt37x: coding style cleanup
    pata_hpt366: coding style cleanup
    pata_hpt3x2n: calculate average f_CNT
    pata_hpt3x2n: clarify about HPT371N support
    pata_hpt{37x|3x2n}: SATA mode filtering
    [libata] avoid needlessly passing around ptr to SCSI completion func
    [libata] new driver acard_ahci, for ATP8620 host controller

    Linus Torvalds
     

06 Jan, 2011

1 commit


24 Dec, 2010

1 commit

  • pci_restore_state only ever returns 0, thus there is no benefit in
    having it return any value. Also, a large majority of the callers do
    not check the return code of pci_restore_state. Make the
    pci_restore_state a void return and avoid the overhead.

    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Jon Mason
    Signed-off-by: Jesse Barnes

    Jon Mason
     

22 Dec, 2010

2 commits

  • The definition for the mailbox register for new adapters was incorrect. The
    value has been updated to the correct offset.

    After an adapter reset, the mailbox register on the new adapters takes a
    number of seconds to stabilize. A delay has been added before reading the
    register.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • The lun value was not getting set up correctly for all devices attached to the
    new 64 bit adapters. The fix is to move the logic to earlier in the
    ipr_init_res_entry routine such that the value does get set correctly for all
    devices.

    Then the ipr_is_same_device comparison function was using the wrong lun value
    in the logic for the new adapters. Change this to use the correct lun value.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

17 Nov, 2010

1 commit

  • Move the mid-layer's ->queuecommand() invocation from being locked
    with the host lock to being unlocked to facilitate speeding up the
    critical path for drivers who don't need this lock taken anyway.

    The patch below presents a simple SCSI host lock push-down as an
    equivalent transformation. No locking or other behavior should change
    with this patch. All existing bugs and locking orders are preserved.

    Additionally, add one parameter to queuecommand,
    struct Scsi_Host *
    and remove one parameter from queuecommand,
    void (*done)(struct scsi_cmnd *)

    Scsi_Host* is a convenient pointer that most host drivers need anyway,
    and 'done' is redundant to struct scsi_cmnd->scsi_done.

    Minimal code disturbance was attempted with this change. Most drivers
    needed only two one-line modifications for their host lock push-down.

    Signed-off-by: Jeff Garzik
    Acked-by: James Bottomley
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

26 Oct, 2010

1 commit


08 Oct, 2010

1 commit

  • The structure definitions for reporting array errors did not have the correct
    size for the Array WWID field. This patch fixes those definitions. It also
    fixes part of the output formatting that did not have newlines and fixes size
    calculations.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

10 Sep, 2010

1 commit

  • The isr optimization patch that was submitted a few months ago
    exposed problems with receiving and handling spurious HRRQ interrutps.

    commit 64ffdb762241c0a9c0c8fac7ea92aa0ba1529334
    Author: Wayne Boyer
    Date: Wed May 19 11:56:13 2010 -0700

    [SCSI] ipr: improve interrupt service routine performance

    That patch is reverted with this one. A new patch will be submitted
    once the issue is better understood and properly handled in the driver.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

06 Sep, 2010

1 commit


28 Jul, 2010

6 commits

  • Setting the resource type in the ipr_update_res_entry function was incorrect in
    that the top 4 bits were masked off. The assignment has been updated to no
    longer mask those bits.

    Then, two new attributes were added to allow the user space utilities to more
    easily get information. The resource_type sdev attribute is set for all devices
    in the adapter's configuration table and indicates the type of device. The
    fw_type shost attribute indicates the firmware type supported by the adapter.

    Finally, the resource_path attribute was changed to be mode S_IRUGO.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • The method of transitioning to operational for new adapters includes using
    initialization stages. The current stage is indicated via a register read.
    The final good stage in the sequence is "operational" but does not necessarily
    indicate that the driver can proceed. There is another bit that gets set in the
    adapter->host interrupt register when the adapter has completed enough of its
    bringup such that it can accept commands. The driver was not checking that
    bit before proceeding which led to intermittent errors and adapter resets.

    The fix is to check the "transition to operational" bit in the interrupt
    register after detecting that the initialization stage is "operational" and
    only proceed if both are set.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • This patch allows the driver to recognize a new Obsidian-E based adapter that
    uses a new subsystem ID.

    This patch also fixes a few tab/space problems.

    Signed-off-by: Wayne Boyer
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • The 64 bit chip used in new adapters does not properly support the BIST register
    in PCI config space. This patch implements an alternative MMIO write reset
    method.

    Signed-off-by: Wayne Boyer
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • A problem was found where the call to scsi_add_device() fails intermittently
    for an adapter. This is caused when __scsi_add_device() returns -ENODEV as
    a result of not calling scsi_probe_and_add_lun() since the call to
    scsi_host_scan_allowed() fails. scsi_host_scan_allowed() fails because the
    adapter state is set to SHOST_RECOVERY instead of SHOST_RUNNING. The state of
    the adapter is being set to SHOST_RECOVERY by scsi_eh_scmd_add() during
    error handling.

    This problem is avoided by moving the setting of the allow_restart flag to
    later in the device initialization sequence. This prevents further error
    handling if we get a NOT_READY response from a TUR command by causing
    scsi_check_sense() to return SUCCESS. Therefore, scsi_eh_scmd_add() will
    not run and the adapter state will remain as SHOST_RUNNING.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • A change in the hardware design of the chip for the new adapters changes the
    default endianness of MMIO operations. This patch adds a register definition
    which when written to with a predefined value will change the endianness
    back to what the driver expects.

    This patch also fixes two problems found during testing.

    First, the first reserved field in the ipr_hostrcb64_fabirc_desc structure only
    reserved one byte. The correct amount to reserve is 2 bytes.

    Second, the reserved field of the ipr_hostrcb64_error structure only reserved
    2 bytes. The correct amount to reserve is 16 bytes.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

22 Jul, 2010

1 commit

  • It was possible to overflow the buffer used to print out the formatted
    version of the resource path. The fix is to limit the number of
    bytes that get formatted.

    This patch also updates the ipr_show_resource_path function to display the
    resource address for devices that are attached to adapters that don't
    support resource paths.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     

25 May, 2010

2 commits

  • During performance testing on P7 machines it was observed that the interrupt
    service routine was doing unnecessary MMIO operations.

    This patch rearranges the logic of the routine and moves some of the code out
    of the main routine. The result is that there are now fewer MMIO operations in
    the performance path of the code.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer
     
  • In bring up testing for the new 64 bit adapters, the first read command failed
    after loading the driver. The cause was that the command requires more than
    one scatter gather element and the corresponding code to set the data list
    length in the request control block was missing. This patch adds the correct
    assignment.

    Signed-off-by: Wayne Boyer
    Acked-by: Brian King
    Signed-off-by: James Bottomley

    Wayne Boyer