aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-02-29hisi_sas: update driver version to 1.3John Garry1-1/+1
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-29hisi_sas: add hisi_sas_slave_configure()John Garry1-1/+14
In high-datarate aging tests, it is found that the SCSI framework can periodically issue lu resets as some commands timeout. Response TASK SET FULL and SAS_QUEUE_FULL may be returned many times for the same command, causing the timeouts. The SAS_QUEUE_FULL errors come from TRANS_TX_CREDIT_TIMEOUT_ERR, TRANS_TX_CLOSE_NORMAL_ERR, and TRANS_TX_ERR_FRAME_TXED errors. They do not mean that the queue is full in the host, but rather it is equivalent to meaning the queue is full for the sdev. To overcome this, the queue depth for the sdev is reduced to 64 (from 256, set in sas_slave_configure()). Normally error code SAS_QUEUE_FULL will result in the sdev queue depth falling, but it falls too slowly during high-datarate tests and commands timeout before it has fallen to an adequete level from original value. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-29hisi_sas: use slot abort in v2 hwJohn Garry1-3/+12
When TRANS_TX_ERR_FRAME_TXED error occurs in a slot, the command should be re-attempted. This error is equivalent to meaning that the queue is full in the sdev (and not the host). A superflous debug statement is also removed in the slot complete handler. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-29hisi_sas: use slot abort in v1 hwJohn Garry1-0/+13
When TRANS_TX_CREDIT_TIMEOUT_ERR or TRANS_TX_CLOSE_NORMAL_ERR error occur in a slot, the command should be re-attempted. This error is equivalent to meaning that the queue is full in the sdev (and not the host). Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-29hisi_sas: add hisi_sas_slot_abort()John Garry2-0/+44
Add a function to abort a slot (task) in the target device and then cleanup and complete the task. The function is called from work queue context as it cannot be called from the context where it is triggered (interrupt). Flag hisi_sas_slot.abort is added as the flag used in the slot error handler to indicate whether the slot needs to be aborted in the sdev prior to cleanup and finish. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-29hisi_sas: change tmf func complete checkJohn Garry1-1/+1
In hisi_sas_exec_internal_tmf_task(), the check for SAM_STAT_GOOD is replaced with TMF_RESP_FUNC_COMPLETE, which is a genuine tmf response code. SAM_STAT_GOOD and TMF_RESP_FUNC_COMPLETE have the same value, so this is why it worked before. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: update driver version to 1.2John Garry1-1/+1
Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v1 hw ACPI supportJohn Garry1-24/+43
Add support in v1 hw driver for ACPI. A check on whether an ACPI handle is available for the device is used to decide on whether to use ACPI reset handler or syscon for hw reset. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: use Unified Device Properties APIJohn Garry2-20/+23
The hisi_sas driver is required to support both device tree and ACPI. The scanning of the device properties now uses the Unified Device Properties API, which serves both OF and ACPI. Since syscon is not supported by ACPI, syscon is only used in the driver when device tree is used. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: update driver version to 1.1John Garry1-1/+1
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 tmf functionsJohn Garry1-0/+23
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 slot error handlerJohn Garry1-0/+421
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 path to send ATA commandJohn Garry3-0/+174
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 code for itct setup and freeJohn Garry1-0/+92
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 code to send smp commandJohn Garry1-0/+71
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 path to send ssp frameJohn Garry1-0/+185
Include code to prep ssp frame and deliver to hardware. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 cq interrupt handlerJohn Garry1-0/+190
Also include slot_complete_v2_hw handler Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 SATA interrupt handlerJohn Garry1-0/+100
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 channel interrupt handlerJohn Garry1-0/+79
This also includes broadcast handler. Unlike v1 hw, broadcast does not have its own dedicated interrupt. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 phy down handlerJohn Garry1-0/+49
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 int init and phy up handlerJohn Garry1-0/+171
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 phy init codeJohn Garry1-0/+49
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add init_id_frame_v2_hw()John Garry1-0/+40
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 hw initJohn Garry1-0/+288
Add code to initialise the hardware. Support is also added to deal with the "am-max-transmissions" (amt) limitation in hip06 controller #1. This is how many connection requests we can send on the system bus before waiting for a response. Due to chip bus design, controller #1 is limited to 32 amt, while, by design, a controller supports 64. The default value for the nibbles in the relevant registers is 0x40; these need to be programmed with 0x20. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add v2 register definitionsJohn Garry1-0/+237
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add bare v2 hw driverJohn Garry2-1/+49
Just add enough to build and init the module. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: rename some fields in hisi_sas_itctJohn Garry1-12/+1
Since hisi_sas_itct format is different between v1 and v2 hw, give more general names for some fields. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: add hisi_sas_err_record_v1John Garry2-13/+16
Since the error record structure is different for v2 hw, make hisi_sas_err_record opaque and add hisi_sas_err_record_v1. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: reduce max itct entriesJohn Garry1-1/+1
Since v2 hw only supports 2048 itct entries, as opposed to 4096 for v1 hw, set the max itct entries to the lower of the two. It is not anticipated that any device with v1 will ever require to connect > 2048 devices. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: set max commands as configurableJohn Garry3-13/+16
Since v2 hardware permits different numbers of commands to v1, set this as configurable in hisi_sas_hw. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23hisi_sas: relocate DEV_IS_EXPANDERJohn Garry2-4/+4
Relocate DEV_IS_EXPANDER to hisi_sas.h as it will be required for v2 hw support. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-04Merge remote-tracking branch 'mkp-scsi/4.5/scsi-fixes' into fixesJames Bottomley2-7/+4
2016-01-26hisi_sas: fix v1 hw check for slot errorJohn Garry1-6/+3
Completion header bit CMPLT_HDR_RSPNS_XFRD flags whether the response frame is received into host memory, and not whether the response frame has an error. As such, change the decision on whether a slot has an error. Also redundant check on CMPLT_HDR_CMD_CMPLT_MSK is removed. Fixes: 27a3f229 ("hisi_sas: Add cq interrupt handler") Signed-off-by: John Garry <john.garry@huawei.com> Tested-by: Ricardo Salveti <ricardo.salveti@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-01-26hisi_sas: add dependency for HAS_IOMEMJohn Garry1-1/+1
Not every arch has io, so fix build by adding necessary dependency. Signed-off-by: John Garry <john.garry@huawei.com> Suggested-by: Richard Weinberger <richard@nod.at> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-01-26Merge remote-tracking branch 'mkp-scsi/4.5/scsi-fixes' into fixesJames Bottomley1-0/+2
2016-01-20hisi_sas: Restrict SCSI_HISI_SAS to arm64Geert Uytterhoeven1-0/+1
The HiSilicon SAS HBA is available in HiSilicon arm64 SoCs only. Restrict it to arm64, unless compile-testing. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-01-20hisi_sas: SCSI_HISI_SAS should depend on HAS_DMAGeert Uytterhoeven1-0/+1
If NO_DMA=y: ERROR: "dma_map_sg" [drivers/scsi/hisi_sas/hisi_sas_v1_hw.ko] undefined! ERROR: "dma_pool_alloc" [drivers/scsi/hisi_sas/hisi_sas_v1_hw.ko] undefined! ERROR: "dma_unmap_sg" [drivers/scsi/hisi_sas/hisi_sas_v1_hw.ko] undefined! ERROR: "dma_unmap_sg" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_set_mask" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_map_sg" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_pool_destroy" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_free_coherent" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_pool_free" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_alloc_coherent" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_pool_alloc" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_supported" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! ERROR: "dma_pool_create" [drivers/scsi/hisi_sas/hisi_sas_main.ko] undefined! Add a dependency on HAS_DMA to fix this. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-01-08hisi_sas: Use u64 for qw0 in free_device_v1_hw()John Garry1-1/+2
By reading in itct.qw0 into a 32b variable the top 32 bits were being lost. In practice this was OK as they were zeroes. Fixes: 27a3f229 ("hisi_sas: Add cq interrupt") Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-01-08hisi_sas: Fix typo in setup_itct_v1_hw()John Garry1-4/+4
We were doing a arithmetic comparison instead of logical shift by accident. Mis-programming the itct did not seem to make a difference to operation. Fixes: abda97c2fe874 ("hisi_sas: Add dev_found") Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-01-08hisi_sas: Fix v1 itct masksJohn Garry1-17/+12
The mask fields are for quad-words, so add ULL suffix. Also unreferenced ITCT_HDR_BREAK_REPLY and ITCT_HDR_MAX_BURST are removed. Fixes: 50af155b6c ("hisi_sas: Add v1 hardware reg") Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-16hisi_sas: use platform_get_irq()John Garry2-9/+5
It is preferred that drivers use platform_get_irq() instead of irq_of_parse_and_map(), so replace. Signed-off-by: John Garry <john.garry@huawei.com> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-10hisi_sas: fix error codes in hisi_sas_task_prep()Dan Carpenter1-3/+7
There were a couple cases where the error codes weren't set and also I changed the success return to "return 0;" which is the same as "return rc;" but more explicit. Fixes: 42e7a69368a5 ('hisi_sas: Add ssp command functio') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Remove dependency on of_irq_countJohn Garry3-40/+5
Originally the driver would use of_irq_count to calculate how much memory is required for storing the interrupt names, since the number of interrupt sources for the controller is variable. Since of_irq_count cannot be used by the driver, use fixed names. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add fatal irq handlerJohn Garry1-0/+119
Add handlers for fatal interrupts. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add control phy handlerJohn Garry3-0/+55
Add method for lldd_control_phy. Currently link rate control and spinup hold is unsupported. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add tmf methodsJohn Garry1-0/+309
Add function methods for tmf's. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add scan finished and startJohn Garry2-0/+26
Add functions for scsi host template scan_finished and scan_start methods. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add smp protocol supportJohn Garry3-0/+100
Add support for smp function, which allows devices attached by expander to be controlled. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add bcast interrupt handlerJohn Garry1-0/+31
This is for expander broadcast event. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-25hisi_sas: Add abnormal irq handlerJohn Garry3-0/+190
Add abnormal irq handler. This handler is concerned with phy down event. Also add port formed and port deformed handlers. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>