23 Apr, 2012

1 commit

  • This changes the ordering of initialization and probing events from:
    1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
    2/ allocate ata_port and schedule port probe in DISCE_PROBE
    ...to:
    1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
    2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
    3/ schedule port probe in DISCE_PROBE

    This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to
    destrory ata devices before they have been fully initialized:

    BUG: unable to handle kernel paging request at 0000000000003b10
    IP: [] sas_ata_end_eh+0x12/0x5e [libsas]
    ...
    [] sas_unregister_common_dev+0x78/0xc9 [libsas]
    [] sas_unregister_dev+0x4f/0xad [libsas]
    [] sas_unregister_domain_devices+0x7f/0xbf [libsas]
    [] sas_deform_port+0x61/0x1b8 [libsas]
    [] sas_phye_loss_of_signal+0x29/0x2b [libsas]

    ...and kills the awkward "sata domain_device briefly existing in the
    domain without an ata_port" state.

    Reported-by: Michal Kosciowski
    Signed-off-by: Dan Williams
    Acked-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Dan Williams
     

28 Mar, 2012

5 commits

  • The latest generation of ipr hardware performs best when command blocks
    are aligned to a boundary equal to the size of the command block. Ensure
    512 byte alignment, since this is the largest size command block we
    can send.

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

    Brian King
     
  • Increase the total number of max concurrent outstanding commands
    for the most recent family of adapters in order to improve overall
    adapter performance.

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

    Brian King
     
  • The ipr driver added some memory barriers in order to ensure
    a PowerPC sync instruction was executed prior to sending a
    command to the adapter to ensure the command block was
    coherent with respect to the PCI bus's view of memory.
    However, some time ago, the powerpc architecture writel
    macros were changed to include the sync since most drivers
    don't properly handle this. So remove these memory barriers
    since they are not needed and result in executing twice
    as many sync instructions, which has a significant performance
    penalty.

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

    Brian King
     
  • The latest ipr hardware no longer requires the driver to issue any MMIOs
    to clear the interrupt so remove this to optimize performance.

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

    Brian King
     
  • For the latest ipr SAS adapters, target id's are a completely
    logical construct that are managed in the ipr driver. This fixes
    an issue that can arise if a device is deleted via sysfs. If
    a new device is then physically added, it will use the previous
    device's target id. If the host is then rescanned, the device
    that had been deleted, since it is using the same target id as
    the new device is using, will never be found, resulting in
    a missing device. Fix this by only freeing the target id
    only if the resource is actually gone.

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

    Brian King
     

01 Mar, 2012

1 commit


18 Feb, 2012

1 commit

  • In some scenarios, an EEH error can take a long time to be detected, since the
    driver issues an MMIO read only after a device reset command times out and we
    try to reset the adapter. This patch adds some code in ipr_cancel_op() to read
    a hardware register so we detect the error earlier in case the op is being
    aborted because of a timeout caused by a frozen adapter slot.

    Another problem in such scenarios is that in __ipr_eh_host_reset() we change the
    dump state flag from WAIT_FOR_DUMP to GET_DUMP, and the flag is later changed
    from GET_DUMP to READ_DUMP in ipr_reset_restore_cfg_space(). However, if when
    __ipr_eh_host_reset() is called by the SCSI error handling the function
    ipr_reset_restore_cfg_space() has already been called by the PCI EEH code, we
    end up with the flag in an inconsistent state. This patch also prevents this
    problem.

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

    Kleber Sacilotto de Souza
     

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

1 commit

  • 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