03 Aug, 2018

1 commit

  • [ Upstream commit 9413532788df7470297dd0475995c5dc5b07f362 ]

    As a unconstrained command, a command can be sent to SATA disk even if
    SATA disk status is BUSY, ERR or DRQ.

    If an ATA reset assert is successful but ATA reset de-assert fails, then
    it will retry the reset de-assert. If reset de- assert retry is
    successful, we think it is okay to probe the device but actually it
    still has Err status.

    Apparently we need to retry the ATA reset assertion and de- assertion
    instead for this mentioned scenario.

    As such, we config ATA reset assert as a constrained command, if ATA
    reset de-assert fails, then ATA reset de-assert retry will also
    fail. Then we will retry the proper process of ATA reset assert and
    de-assert again.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Xiang Chen
     

20 Dec, 2017

1 commit

  • [ Upstream commit 6ba0fbc35aa9f3bc8c12be3b4047055c9ce2ac92 ]

    The function hisi_sas_slot_task_free() is used to free the slot and do
    tidy-up of LLDD resources. The LLDD generally should know the state of
    a slot and decide when to free it, and it should only be done once.

    For some scenarios, we really don't know the state, like when TMF
    timeout. In this case, we check task->lldd_task before calling
    hisi_sas_slot_task_free().

    However, we may miss some scenarios when we should also check
    task->lldd_task, and it is not SMP safe to check task->lldd_task as we
    don't protect it within spin lock.

    This patch is to fix this risk of freeing slot twice, as follows:

    1. Check task->lldd_task in the hisi_sas_slot_task_free(), and give
    up freeing of this time if task->lldd_task is NULL.

    2. Set slot->buf to NULL after it is freed.

    Signed-off-by: Xiaofei Tan
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Xiaofei Tan
     

26 Aug, 2017

1 commit


25 Aug, 2017

6 commits


11 Aug, 2017

13 commits

  • This patch adds calls to kill CQ takslets v3 hw during probe failure.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • The channel interrupt is to process all the interrupts except PHY
    UP/DOWN and broadcast interrupt. So we need to clear all the interrupts
    except those 3 interrupts after processing channel interrupts.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • Modify STP link timer from 10ms to 500ms. Also add the register address.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • For v3 hw, internal abort function required status and command buffer to
    be set, so add necessary code for this.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • Add two ATA commands, ATA_CMD_ZAC_MGMT_IN and ATA_CMD_ZAC_MGMT_OUT in
    hisi_sas_get_ata_protocol(), to support SATA SMR disk.

    Signed-off-by: Xiaofei Tan
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiaofei Tan
     
  • This patch is a fix related to freeing a device in v2 hw driver.

    Before, we polled to ITCT CLR interrupt to check if a device is free.

    This was error prone, as if the interrupt doesn't occur in 10us, we miss
    processing it.

    To avoid this situation, service this interrupt and sync the event with
    a completion.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • This patch adds support to clean-up allocated IRQs and kill tasklets
    when probe fails and for driver removal.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • This patch removes some repeated configurations:

    (1) The device id of the device is already set in the alloc function, so
    we don't need to modify in free device function.

    (2) Field dev_type and dev_status are configured in hisi_sas_dev_gone(),
    so there is no need for repeated config in free_device_v3_hw.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • The code to print ECC errors in v2 hw driver is very repetitive. This
    patch condensed the code by looping an array of errors.

    Signed-off-by: John Garry
    Signed-off-by: Shiju Jose
    Signed-off-by: Martin K. Petersen

    John Garry
     
  • Add DFX feature for v2 hw. We are adding support for
    the following errors:
    - loss_of_dword_sync_count
    - invalid_dword_count
    - phy_reset_problem_count
    - running_disparity_error_count

    Signed-off-by: Xiaofei Tan
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiaofei Tan
     
  • The value dw0 is the residual bytes when UNDERFLOW error happens, but we
    filled the residual with the value of dw3 before. So change the residual
    from dw3 to dw0.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • When some interrupts happen together, we need to process every interrupt
    one-by-one, and should not return immediately when one interrupt process
    is finished being processed.

    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiang Chen
     
  • This patch provides fixes for the following issues:

    1. Fix issue of controller reset required to send commands. For reset
    process, it may be required to send commands to the controller, but
    not during soft reset. So add HISI_SAS_NOT_ACCEPT_CMD_BIT to prevent
    executing a task during this period.

    2. Send a broadcast event in rescan topology to detect any topology
    changes during reset.

    3. Previously it was not ensured that libsas has processed the PHY up
    and down events after reset. Potentially this could cause an issue
    that we still process the PHY event after reset. So resolve this by
    flushing shot workqueue in LLDD reset.

    4. Port ID requires refresh after reset. The port ID generated after
    reset is not guaranteed to be the same as before reset, so it needs
    to be refreshed for each device's ITCT.

    Signed-off-by: Xiaofei Tan
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiaofei Tan
     

13 Jul, 2017

1 commit

  • Don't populate various tables on the stack but make them static const.
    Makes the object code smaller by over 280 bytes:

    Before:
    text data bss dec hex filename
    39887 5080 64 45031 afe7 hisi_sas_v2_hw.o

    After:
    text data bss dec hex filename
    39318 5368 64 44750 aece hisi_sas_v2_hw.o

    Signed-off-by: Colin Ian King
    Acked-by: John Garry
    Signed-off-by: Martin K. Petersen

    Colin Ian King
     

02 Jul, 2017

1 commit

  • Currently we allocate 3 sets of DMA memories from separate pools for
    each slot. This is inefficient in terms of memory usage
    (buffers are less than 1 page in size, so we lose due to alignment),
    and also time spent in doing 3 allocations + de-allocations per slot,
    instead of 1.

    To optimise, combine the 3 DMA buffers into a single buffer from a
    single pool.

    Signed-off-by: Xiaofei Tan
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    Xiaofei Tan
     

27 Jun, 2017

1 commit

  • Element phy_type is a bitmask and it only ever has 2 bits possibly set,
    and it is overkill to define as a u64, so redefine as a u32.

    This change resolves static code check complaint that "phy->phy_type &=
    ~PORT_TYPE_SAS;" would unintentionally clear the high 32 bits as well.

    Structure hisi_sas_phy is also reordered to ensure packing efficiency.

    Reported-by: Dan Carpenter
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     

20 Jun, 2017

15 commits