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
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
26 Aug, 2017
1 commit
-
The bus reset handler is calling I_T Nexus reset, which logically is a
target reset as it need to specify both the initiator and the target.
So move it to target reset.Signed-off-by: Hannes Reinecke
Reviewed-by: Christoph Hellwig
Reviewed-by: Johannes Thumshirn
Signed-off-by: Martin K. Petersen
25 Aug, 2017
6 commits
-
The driver version is not updated with changes to the driver, so it has
no value, so just get rid of it.Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
Instances of kfree(shost) should be replaced with scsi_host_put().
In addition, a missing scsi_host_put() is added for error path in
hisi_sas_shost_alloc_pci() and v3 driver removal.Signed-off-by: Pan Bian # For main.c changes
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
Variable res only holds value 0, so remove it.
This cleans up a coccicheck warning.
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
Add function to set linkrate for v3 hw.
Signed-off-by: Xiang Chen
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
This patch updates some register setting according to recommendation
from HW designer and experiment.Signed-off-by: Xiang Chen
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
Use ACPI "_RST" method to reset the controller, since FLR is not
supported.Function hisi_sas_stop_phys() is introduced to remove some code
duplication.Signed-off-by: Xiang Chen
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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_countSigned-off-by: Xiaofei Tan
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
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 -
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 -
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
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.oAfter:
text data bss dec hex filename
39318 5368 64 44750 aece hisi_sas_v2_hw.oSigned-off-by: Colin Ian King
Acked-by: John Garry
Signed-off-by: Martin K. Petersen
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
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
20 Jun, 2017
15 commits
-
There is a change for abort dev for v3 hw: add registers to configure
unaborted iptt for a device, and then inform this to logic.Signed-off-by: Xiang Chen
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen -
Add code to fill the interface of phy_hard_reset, phy_get_max_linkrate,
and phy enable/disable.Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code for interface get_wideport_bitmap.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to prepare internal abort command.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to itct setup and free for v3 hw.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to prepare ATA frame for v3 hw
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to prepare SMP frame.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to prepare SSP frame and deliver it to hardware.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add v3 cq interrupt handler slot_complete_v3_hw().
Note: The slot error handling needs to be further refined in the future
to examine all fields in the error record, and handle appropriately,
instead of current solution - just report SAS_OPEN_REJECT.Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to initialise interrupts and add some interrupt handlers.
Also add function hisi_sas_v3_destroy_irqs() to clean-up irqs upon
module unloading.Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to configure PHYs for v3 hw.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add code to initialise v3 hardware.
Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add the code to initialise the controller which is based on pci device
in hisi_sas_v3_hw.cThe core controller routines are still in hisi_sas_main.c; some common
initialisation functions are also exported from hisi_sas_main.cFor pci-based controller, the device properties, like phy count and sas
address are read from the firmware, same as platform device-based
controller.Signed-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Add skeleton driver for v3 hw in hisi_sas_v3_hw.c
File hisi_sas_v3_hw.c will serve 2 purposes:
- probing and initialisation of the controller based on pci device
- hw layer for v3-based controllersThe controller design is quite similar to v2 hw in hip07.
However key differences include:
-All v2 hw bugs are fixed (hopefully), so workarounds are not required
-support for device deregistration
-some interrupt modifications
-configurable max device supportSigned-off-by: John Garry
Signed-off-by: Xiang Chen
Signed-off-by: Martin K. Petersen -
Move the functionality to retrieve the fw info into a dedicated device
type-agnostic function, hisi_sas_get_fw_info().The reasoning is that this function will be required for future
pci-based platforms.Also add some debug logs for failure.
Signed-off-by: John Garry
Signed-off-by: Martin K. Petersen