Commit Graph

86 Commits

Author SHA1 Message Date
John Garry cd4d372365 hisi_sas: update driver version to 1.5
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-12 23:16:31 -04:00
John Garry 308d85d176 hisi_sas: fix the inconsistent lock issue reported by CONFIG_PROVE_LOCKING
It is not necessary to surround call to
notify_port_event(, PORTE_BROADCAST_RCVD) by spin_lock_irqsave(),
so remove.
This was causing a warn, as below:

    =================================
    [ INFO: inconsistent lock state ]
    4.4.8+ #12 Not tainted
    ---------------------------------
    inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
    kworker/u64:1/168 [HC0[0]:SC0[0]:HE1:SE1] takes:
     (&(&hisi_hba->lock)->rlock){?.....}, at: [<ffffffc00052c708>] alloc_dev_quirk_v2_hw+0x48/0xec
    {IN-HARDIRQ-W} state was registered at:
      [<ffffffc0000fc764>] mark_lock+0x19c/0x6a0
      [<ffffffc0000fdc14>] __lock_acquire+0xa2c/0x1d00
      [<ffffffc0000ff654>] lock_acquire+0x58/0x7c
      [<ffffffc0008b609c>] _raw_spin_lock_irqsave+0x54/0x6c
      [<ffffffc00052d3c0>] int_chnl_int_v2_hw+0x1c4/0x248
      [<ffffffc0001098e8>] handle_irq_event_percpu+0x9c/0x144
      [<ffffffc0001099d4>] handle_irq_event+0x44/0x74
      [<ffffffc00010cd68>] handle_fasteoi_irq+0xb4/0x188
      [<ffffffc000108ea8>] generic_handle_irq+0x24/0x38
      [<ffffffc0001091fc>] __handle_domain_irq+0x60/0xac
      [<ffffffc00008261c>] gic_handle_irq+0xcc/0x168
      [<ffffffc0000855ac>] el1_irq+0x6c/0xe0
      [<ffffffc0000f7414>] default_idle_call+0x1c/0x34
      [<ffffffc0000f7654>] cpu_startup_entry+0x1d4/0x228
      [<ffffffc0008aecd8>] rest_init+0x150/0x160
      [<ffffffc000c4b95c>] start_kernel+0x3a4/0x3b8
      [<00000000008bb000>] 0x8bb000
    irq event stamp: 32661
    hardirqs last  enabled at (32661): [<ffffffc0008b41a8>] __mutex_unlock_slowpath+0x108/0x18c
    hardirqs last disabled at (32660): [<ffffffc0008b40e4>] __mutex_unlock_slowpath+0x44/0x18c
    softirqs last  enabled at (25114): [<ffffffc0000bde68>] __do_softirq+0x210/0x27c
    softirqs last disabled at (25095): [<ffffffc0000be224>] irq_exit+0x9c/0xe8

    other info that might help us debug this:
     Possible unsafe locking scenario:

           CPU0
           ----
      lock(&(&hisi_hba->lock)->rlock);
      <Interrupt>
        lock(&(&hisi_hba->lock)->rlock);

     *** DEADLOCK ***

    2 locks held by kworker/u64:1/168:
     #0:  ("%s"shost->work_q_name){++++.+}, at: [<ffffffc0000d2980>] process_one_work+0x134/0x3cc
     #1:  ((&sw->work)#2){+.+.+.}, at: [<ffffffc0000d2980>] process_one_work+0x134/0x3cc

    stack backtrace:
    CPU: 4 PID: 168 Comm: kworker/u64:1 Not tainted 4.4.8+ #12
    Hardware name: Huawei Technologies Co., Ltd. D03/D03, BIOS 1.12 01/01/1900
    Workqueue: scsi_wq_1 sas_discover_domain
    Call trace:
    [<ffffffc000089988>] dump_backtrace+0x0/0x114
    [<ffffffc000089ab0>] show_stack+0x14/0x1c
    [<ffffffc00035ac50>] dump_stack+0xb4/0xf0
    [<ffffffc0000fc524>] print_usage_bug+0x210/0x2b4
    [<ffffffc0000fcbc4>] mark_lock+0x5fc/0x6a0
    [<ffffffc0000fd9e8>] __lock_acquire+0x800/0x1d00
    [<ffffffc0000ff654>] lock_acquire+0x58/0x7c
    [<ffffffc0008b5edc>] _raw_spin_lock+0x44/0x58
    [<ffffffc00052c708>] alloc_dev_quirk_v2_hw+0x48/0xec
    [<ffffffc000528214>] hisi_sas_dev_found+0x48/0x1b8
    [<ffffffc00051a9b8>] sas_notify_lldd_dev_found+0x34/0xe0
    [<ffffffc00051e5e8>] sas_discover_root_expander+0x58/0x128
    [<ffffffc00051b38c>] sas_discover_domain+0x4bc/0x564
    [<ffffffc0000d29ec>] process_one_work+0x1a0/0x3cc
    [<ffffffc0000d2d50>] worker_thread+0x138/0x438
    [<ffffffc0000d9494>] kthread+0xdc/0xf0
    [<ffffffc000085c50>] ret_from_fork+0x10/0x40

Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-12 23:16:31 -04:00
John Garry 50408712b5 hisi_sas: add v2 hw ACPI support
Add support in v2 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: Wei Xu <xuwei5@hisilicon.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-12 23:16:31 -04:00
Hannes Reinecke 661ce1f0c4 libata/libsas: Define ATA_CMD_NCQ_NON_DATA
Define the NCQ NON DATA command and update libsas to handle it
correctly.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2016-05-09 12:36:44 -04:00
Hannes Reinecke ef026b18bb libsas: enable FPDMA SEND/RECEIVE
Update libsas and dependent drivers to handle FPDMA
SEND/RECEIVE correctly.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2016-05-09 12:36:44 -04:00
John Garry b2bdaf2bde hisi_sas: add alloc_dev_quirk_v2_hw()
Add custom version of function to allocate device,
alloc_dev_quirk_v2_hw().  For sata devices the device id bit0 should be
0.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:23 -04:00
John Garry 330fa7f314 hisi_sas: add slot_index_alloc_quirk_v2_hw()
Add v2 hw custom function slot_index_alloc_quirk_v2_hw().  SAS devices
should have IPTT bit0 equal to 1.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:23 -04:00
John Garry 685b6d6e67 hisi_sas: add device and slot alloc hw methods
Add methods to use HW specific versions of functions to allocate slot
and device.  HW specific methods are permitted to workaround device id
vs IPTT collision issue in v2 hw.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:22 -04:00
John Garry 33e56e48ea hisi_sas: update driver version to 1.4
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:17 -04:00
John Garry f76a0b4940 hisi_sas: for v2 hw only set ITCT qw2 for SAS device
This patch fixes the ITCT table setup as it should be configured
differently for SAS and SATA devices.  For SATA disks there is no need
to set qw2 (already zeroed).  Also, link parameters for Bus inactive
limit, max connection time limit, and reject to open limit timers
parameters are changed to match global config register,
MAX_CON_TIME_LIMIT_TIME, as recommended by hw team.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:17 -04:00
John Garry 11826e5dc7 hisi_sas: add v2 hw support for >4 SATA phys
This patch adds support for directly attaching SATA disks to phy
4-8. The problem was that only registers concerned with phy 0-3 were
being considered in sata_int_v2_hw().  The issue was not detected
previously as the development board only exposed phy 0-3; the new board
provides access to 8 phys.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:16 -04:00
John Garry 3a429d5ab6 hisi_sas: fix v2 hw multiple SATA disk issue
Intermittently it is found that when multiple SATA disks are directly
connected to the host that some disks are not detected.  The problem is
that all set bitfields in ENT_INT_SRC1 are cleared for all phys in
sata_int_v2_hw() - it should clear the set bit for the phy being
serviced.

Also unnecessary double-write to ENT_INT_SRC1 and ENT_INT_SRC_MSK1 is
removed (remaining writes are done at end label).

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:16 -04:00
John Garry 7524926826 hisi_sas: use device linkrate in MCR for v2 hw
Contrary to the field name, the MCR (max connection rate) in the ITCT
should hold the device linkrate (linkrate of the connected phy), and not
the max linkrate.

This fixes an issue seen where some SATA drives connected through an
expander which would not attach.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:15 -04:00
Ming Lin 65e8617fba scsi: rename SCSI_MAX_{SG, SG_CHAIN}_SEGMENTS
Rename SCSI_MAX_SG_SEGMENTS to SG_CHUNK_SIZE, which means the amount
we fit into a single scatterlist chunk.

Rename SCSI_MAX_SG_CHAIN_SEGMENTS to SG_MAX_SEGMENTS.

Will move these 2 generic definitions to scatterlist.h later.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Bart Van Assche <bart.vanassche@sandisk.com> (for ib_srp changes)
Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-04-15 16:53:14 -04:00
John Garry 268d11e9ef hisi_sas: update driver version to 1.3
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-29 21:00:03 -05:00
John Garry 31eec8a6c0 hisi_sas: add hisi_sas_slave_configure()
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-29 21:00:03 -05:00
John Garry 9c8ee657cf hisi_sas: use slot abort in v2 hw
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-29 21:00:03 -05:00
John Garry 91b2bb92fe hisi_sas: use slot abort in v1 hw
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-29 21:00:03 -05:00
John Garry cac9b2a217 hisi_sas: add hisi_sas_slot_abort()
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-29 21:00:03 -05:00
John Garry 1af1b80889 hisi_sas: change tmf func complete check
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-29 21:00:03 -05:00
John Garry de983561e6 hisi_sas: update driver version to 1.2
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-23 21:27:02 -05:00
John Garry 37ffee4a0b hisi_sas: add v1 hw ACPI support
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-23 21:27:02 -05:00
John Garry 4d558c7774 hisi_sas: use Unified Device Properties API
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-23 21:27:02 -05:00
John Garry bd8d859a21 hisi_sas: update driver version to 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-23 21:27:02 -05:00
John Garry 63fb11b878 hisi_sas: add v2 tmf functions
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-23 21:27:02 -05:00
John Garry e8fed0e9a9 hisi_sas: add v2 slot error 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-23 21:27:02 -05:00
John Garry 6f2ff1a131 hisi_sas: add v2 path to send ATA command
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-23 21:27:02 -05:00
John Garry 85b2c3c040 hisi_sas: add v2 code for itct setup and free
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-23 21:27:02 -05:00
John Garry c2d8939275 hisi_sas: add v2 code to send smp command
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-23 21:27:02 -05:00
John Garry 8c36e31d6e hisi_sas: add v2 path to send ssp frame
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-23 21:27:02 -05:00
John Garry 31a9cfa6f7 hisi_sas: add v2 cq interrupt handler
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-23 21:27:02 -05:00
John Garry d43f9cdb7f hisi_sas: add v2 SATA interrupt 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-23 21:27:02 -05:00
John Garry d3bf3d84d3 hisi_sas: add v2 channel interrupt handler
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-23 21:27:02 -05:00
John Garry 5473c06081 hisi_sas: add v2 phy down 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-23 21:27:02 -05:00
John Garry 7911e66f1f hisi_sas: add v2 int init and phy up 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-23 21:27:02 -05:00
John Garry 29a2042863 hisi_sas: add v2 phy init code
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-23 21:27:02 -05:00
John Garry 806bb768a2 hisi_sas: add init_id_frame_v2_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-23 21:27:02 -05:00
John Garry 94eac9e1ab hisi_sas: add v2 hw init
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-23 21:27:02 -05:00
John Garry 45c901b848 hisi_sas: add v2 register definitions
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-23 21:27:02 -05:00
John Garry 3417ba8abd hisi_sas: add bare v2 hw driver
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-23 21:27:02 -05:00
John Garry 281e3bf6d3 hisi_sas: rename some fields in hisi_sas_itct
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-23 21:27:02 -05:00
John Garry 8d1eee7d3f hisi_sas: add hisi_sas_err_record_v1
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-23 21:27:02 -05:00
John Garry 5560e9fb2e hisi_sas: reduce max itct entries
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-23 21:27:02 -05:00
John Garry a8d547bd93 hisi_sas: set max commands as configurable
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-23 21:27:02 -05:00
John Garry 98bf39fca9 hisi_sas: relocate DEV_IS_EXPANDER
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-23 21:27:02 -05:00
James Bottomley 12ffbbe94d Merge remote-tracking branch 'mkp-scsi/4.5/scsi-fixes' into fixes 2016-02-04 21:37:52 -08:00
John Garry 0f28ede906 hisi_sas: fix v1 hw check for slot error
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-26 21:19:08 -05:00
John Garry 0f92db53c1 hisi_sas: add dependency for HAS_IOMEM
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-26 21:17:59 -05:00
James Bottomley 6344a5cd3e Merge remote-tracking branch 'mkp-scsi/4.5/scsi-fixes' into fixes 2016-01-26 17:44:42 -08:00
Geert Uytterhoeven c142ce0d3c hisi_sas: Restrict SCSI_HISI_SAS to arm64
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-20 19:51:04 -05:00