summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-15scsi: libsas: Remove pcidev referenceJohn Garry
Not all host drivers are PCI drivers - like hisi_sas, which supports a platform driver - so remove reference to "pcidev". Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: libsas: Drop SAS_DPRINTK() and revise logs levelsJohn Garry
Like sas_printk() did previously, SAS_DPRINTK() offers little value now that libsas logs already have the "sas" prefix through pr_fmt(fmt). So it can be dropped. However, after reviewing some logs in libsas, it is noticed that debug level is too low in many instances. So this change drops SAS_DPRINTK() and revises some logs to a more appropriate level. However many stay at debug level, although some are significantly promoted. We add -DDEBUG for compilation so that we keep the debug messages by default, as before. All the pre-existing checkpatch errors for spanning messages across multiple lines are also fixed. Finally, all other references to printk() [apart from special formatting in sas_ata.c] are removed and replaced with appropriate pr_xxx(). Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: libsas: Drop sas_printk()John Garry
The printk wrapper sas_printk() adds little value now that libsas logs already have the "sas" prefix through pr_fmt(fmt), so just use pr_notice() directly. In addition, strings which span multiple lines are reunited. Originally-from: Joe Perches <joe@perches.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: libsas: Use pr_fmt(fmt)John Garry
In preparation for dropping the libsas printk wrappers, use pr_fmt(fmt) declaration to add the framework log prefix - "sas". Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: libsas: Delete sas_dump.{c, h}John Garry
The code in these files is not longer referenced, so delete them. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hisi_sas: change the time of SAS SSP connectionXiang Chen
Currently the time of SAS SSP connection is 1ms, which means the link connection will fail if no IO response after this period. For some disks handling large IO (such as 512k), 1ms is not enough, so change it to 5ms. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hisi_sas: Relocate some codes to avoid an unused checkXiang Chen
In function hisi_sas_task_prep(), we check asd_sas_port, but in function hisi_sas_task_exec(), we already refer to asd_sas_port by using function dev_to_hisi_hba() implicitly. So to avoid this possible invalid dereference, relocate the check to function hisi_sas_task_prep(). Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hisi_sas: Add support for interrupt coalescing for v3 hwXiang Chen
If INT_COAL_EN is enabled, configure time and count of interrupt coalescing. Then if CQ collects count of CQ entries in time, it will report the interrupt. Or if CQ doesn't collect enough CQ entries in time, it will report the interrupt at timeout. As all the registers are not supported to be changed dynamically, we need to config those register between disable and enable PHYs. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hisi_sas: Add support for interrupt converge for v3 hwXiang Chen
If CQ_INT_CONVERGE_EN is enabled, the interrupts of all the 16 CQ queues will be reported by CQ0. So we need to change the process of CQ tasklet for this situation. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hisi_sas: Create separate host attributes per HBAXiang Chen
Currently all the three HBA (v1/v2/v3 HW) share the same host attributes. To support each HBA having separate attributes in future, create per-HBA attributes. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: wd719x: always use generic DMA APIChristoph Hellwig
The wd719x driver currently uses a mix of the legacy PCI DMA and the generic DMA APIs. Switch it over to the generic DMA API entirely. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: wd719x: use per-command private dataChristoph Hellwig
Add the SCB onto the scsi command allocation and use dma streaming mappings for it only when in use. This avoid possibly calling dma_alloc_coherent under a lock or even in irq context, while also making the code simpler. Thanks to Ondrej Zary for testing and various bug fixes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: wd719x: there should be no active SCBs on removalChristoph Hellwig
Warn on that case instead of trying to free them which would be fatal in case we actually had active ones. [mkp: typos] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: sym53c8xx: use dma_set_maskChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: stex: use dma_set_mask_and_coherentChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: mvumi: use dma_set_maskChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: lpfc: use dma_set_mask_and_coherentChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: isci: use dma_set_mask_and_coherentChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. [mkp: s/iscsi/isci/] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: initio: use dma_set_maskChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hptiop: use dma_set_maskChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: hisi_sas: use dma_set_mask_and_coherentChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: esas2r: use dma_set_mask_and_coherentChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Also move the dma_get_required_mask check before actually setting the dma mask so that we don't end up with inconsistent settings in corner cases. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: dpt_i2o: use dma_set_maskChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Also move the dma_get_required_mask check before actually setting the dma mask, so that we don't end up with inconsistent settings in corner cases. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: bfa: use dma_set_mask_and_coherentChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API helper and also ensure we set the coherent mask as well in the resume path. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-15scsi: arcmsr: use dma_set_maskChristoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-09scsi: ufs: Add UFS platform driver for Cadence UFSJanek Kotas
This patch adds a device tree platform driver for Cadence UFS Host Controller. It can be enabled with SCSI_UFS_CDNS_PLATFORM Kconfig option. Signed-off-by: Jan Kotas <jank@cadence.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-09scsi: dt-bindings: ufs: Add bindings for Cadence UFSJanek Kotas
This patch adds a DT binding documentation for Cadence UFS Host Controller. Signed-off-by: Jan Kotas <jank@cadence.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-09scsi: ufs: set the device reference clock settingSubhash Jadavani
UFS host supplies the reference clock to UFS device and UFS device specification allows host to provide one of the 4 frequencies (19.2 MHz, 26 MHz, 38.4 MHz, 52 MHz) for reference clock. Host should set the device reference clock frequency setting in the device based on what frequency it is supplying to UFS device. Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org> Reviewed-by: Evan Green <evgreen@chromium.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: pmcraid: use generic DMA APIChristoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: pmcraid: don't allocate a dma coherent buffer for sense dataChristoph Hellwig
We can just dma map the sense buffer passed with the scsi command, and that gets us out of the nasty business of doing dma coherent allocations from irq context. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: pmcraid: simplify pmcraid_cancel_all a bitChristoph Hellwig
No need for a local cmd_done variable, and pass boolean values as bool type instead of u32. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: qla2xxx: use lower_32_bits and upper_32_bits instead of reinventing themChristoph Hellwig
This also moves the optimization for builds with 32-bit dma_addr_t to the compiler (where it belongs) instead of opencoding it based on incorrect assumptions. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: qla1280: properly handle 64-bit DMAChristoph Hellwig
CONFIG_HIGHMEM is not in fact an indicator for > 32-bit dma addressing Given that the driver is a bit weird and wants a compile time selection switch to checking CONFIG_ARCH_DMA_ADDR_T_64BIT instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: qla1280: use lower_32_bits and upper_32_bits instead of reinventing themChristoph Hellwig
This also moves the optimization for builds with 32-bit dma_addr_t to the compiler (where it belongs) instead of opencoding it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: ips: properly handle 64-bit DMAChristoph Hellwig
CONFIG_HIGHMEM64 is only one (and these days unusual) way to indicate that > 32-bit dma address are possible. Replace it with a check of the dma_addr_t size. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: ips: use lower_32_bits and upper_32_bits instead of reinventing themChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: qla4xxx: remvoe unnecessary condition check for mempool_destroy()Chengguang Xu
mempool_destroy() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling mempool_destroy(). Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: qla4xxx: remove unnecessary condition check for dma_pool_destroy()Chengguang Xu
dma_pool_destroy() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling dma_pool_destroy(). Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: update driver version to 12.0.0.8James Smart
Update the driver version to 12.0.0.8 Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: add Trunking supportJames Smart
Add trunking support to the driver. Trunking is found on more recent asics. In general, trunking appears as a single "port" to the driver and overall behavior doesn't differ. Link speed is reported as an aggregate value, while link speed control is done on a per-physical link basis with all links in the trunk symmetrical. Some commands returning port information are updated to additionally provide trunking information. And new ACQEs are generated to report physical link events relative to the trunk. This patch contains the following modifications: - Added link speed settings of 128GB and 256GB. - Added handling of trunk-related ACQEs, mainly logging and trapping of physical link statuses. - Added additional bsg interface to query trunk state by applications. - Augment link_state sysfs attribtute to display trunk link status Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Implement GID_PT on Nameserver query to support faster failoverJames Smart
The switches seem to respond faster to GID_PT vs GID_FT NameServer queries. Add support for GID_PT to be used over GID_FT to enable faster storage failover detection. Includes addition of new module parameter to select between GID_PT and GID_FT (GID_FT is default). Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Correct loss of fc4 type on remote port address changeJames Smart
An address change for a remote port cause PRLI for the wrong protocol to be sent. The node copy done in the discovery code skipped copying the fc4 protocols supported as well. Fix the copy logic for the address change. Beefed up log messages in this area as well. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Fix odd recovery in duplicate FLOGIs in point-to-pointJames Smart
Testing a point-to-point topology and a case of re-FLOGI without intervening link bouncing, showed an odd interaction with firmware and a resulting scenario where the driver no longer probed after accepting the new FLOGI. Work around the firmware issue by issuing a link bounce if a FLOGI is received after the link is already up and FLOGI's accepted. While debugging the issue, realized that some debug traces should be clarified to help in the future. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Correct LCB RJT handlingJames Smart
When LCB's are rejected, if beaconing was already in progress, the Reason Code Explanation was not being set. Should have been set to command in progress. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: fcoe: Fix link down issue after 1000+ link bouncesJames Smart
On FCoE adapters, when running link bounce test in a loop, initiator failed to login with switch switch and required driver reload to recover. Switch reached a point where all subsequent FLOGIs would be LS_RJT'd. Further testing showed the condition to be related to not performing FCF discovery between FLOGI's. Fix by monitoring FLOGI failures and once a repeated error is seen repeat FCF discovery. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Correct errors accessing fw logJames Smart
This patch corrects two issues: - An oops would occur if reading based on a non-zero offset. Offset calculation was incorrect. - Updates to ras config (logging level) were ignored if change was made while fw logging was enabled. Revise to dynamically update. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Reset link or adapter instead of doing infinite nameserver PLOGI ↵James Smart
retry Currently, PLOGI failures are infinitely delayed/retried. There have been some fabric situations where the PLOGI's were to the nameserver and it stopped responding. The retries would never clear up. A better resolution in this situation is to retry a couple of times, then drop the link and reinit. This brings back connectivity to the nameserver. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Fix LOGO/PLOGI handling when triggerd by ABTS Timeout eventJames Smart
After a LOGO in response to an ABTS timeout, a PLOGI wasn't issued to re-establish the login. An nlp_type check in the LOGO completion handler failed to restart discovery for NVME targets. Revised the nlp_type check for NVME as well as SCSI. While reviewing the LOGO handling a few other issues were seen and were addressed: - Better lock synchronization around ndlp data types - When the ABTS times out, unregister the RPI before sending the LOGO so that all local exchange contexts are cleared and nothing received while awaiting LOGO/PLOGI handling will be accepted. - LOGO handling optimized to: Wait only R_A_TOV for a response. It doesn't need to be retried on timeout. If there wasn't a response, a PLOGI will be sent, thus an implicit logout applies as well when the other port sees it. If there is a response, any kind of response is considered "good" and the XRI quarantined for a exchange qualifier window. - PLOGI is issued as soon a LOGO state is resolved. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Fix lpfc_sli4_read_config return value checkJames Smart
An error is an error - but not to the existing return value check. Revise check to handle any failure, not just EIO. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-06scsi: lpfc: Correct speeds on SFP swapJames Smart
Supported speeds is not updated when SFP is removed or replaced Supported speed is obtained from lmt field in READ_CONFIG mailbox response. Driver updates supported speeds only once from PCI probe path. After that it is never updated. So, supported speeds remains the same till reboot or driver reload. When SFP is removed or inserted, driver gets SLI-Port Event ACQE. If SFP is removed, lmt wil have value 0. If a different SFP is inserted, lmt will have value according to its supported speeds. So, afterr SLI-Port Event ACQE handling path, send READ_CONFIG mailbox and update supported speeds. If READ_CONFIG fails, set supported speeds to unknown and log. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>