aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-04-15scsi: libsas: Do discovery on empty PHY to update PHY infoJohn Garry1-0/+5
When we discover the PHY is empty in sas_rediscover_dev(), the PHY information (like negotiated linkrate) is not updated. As such, for a user examining sysfs for that PHY, they would see incorrect values: root@(none)$ cd /sys/class/sas_phy/phy-0:0:20 root@(none)$ more negotiated_linkrate 3.0 Gbit root@(none)$ echo 0 > enable root@(none)$ more negotiated_linkrate 3.0 Gbit So fix this, simply discover the PHY again, even though we know it's empty; in the above example, this gives us: root@(none)$ more negotiated_linkrate Phy disabled We must do this after unregistering the device associated with the PHY (in sas_unregister_devs_sas_addr()). Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-15scsi: libsas: Inject revalidate event for root port eventJohn Garry2-3/+28
According to the SAS spec, an expander device shall transmit BROADCAST (CHANGE) from at least one phy in each expander port other than the expander port that is the cause for transmitting BROADCAST (CHANGE). As such, for when the link is lost for a root PHY attached to an expander PHY, we get no broadcast event. This causes an issue for libsas, in that we will not revalidate the domain for these events. As a solution, for when a root PHY is formed or deformed from a root port, insert a broadcast event to trigger a domain revalidation. Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-15scsi: libsas: Improve vague log in SAS rediscoveryJohn Garry1-6/+14
When an expander PHY which was part of a wideport disconnects, we would see a log like this from sas_rediscover(): [ 39.695554] sas: phy20 part of wide port with phy16 Here, phy20 is the PHY that disconnected, and phy16 is the lowest indexed member PHY of the wideport. The log implies the phy20 is still part of the wideport with phy16, so is misleading or, at least, vague. Improve the logs in SAS rediscovery by removing this log and adding a log in sas_rediscover_dev() to tell what's really going on. While we're at it, also make the logs in sas_find_bcast_dev() more informative (and more consistent with the reset of the expander logs). Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-15scsi: libsas: Try to retain programmed min linkrate for SATA min pathway ↵John Garry1-1/+6
unmatch fixing Currently for fixing the linkrate matching during discovery such that the linkrate of a SATA PHY does not exceed min pathway to initiator, we set the SATA PHY programmed min linkrate to the same value as the programmed max linkrate. This is unnecessary, and we should be able to keep the same programmed min linkrate if it is already lower than this new max programmed linkrate. This patch makes that change. In effect, this will not make much difference since we generally will negotiate a linkrate at the programmed max linkrate, and the programmed min linkrate will have no impact. Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-15scsi: libsas: Stop hardcoding SAS address lengthJohn Garry3-29/+32
Many times we use 8 for SAS address length, while we already have a macro for this - SAS_ADDR_SIZE. Replace instances of this with the macro. However, don't touch the SAS address array sizes sas.h, as these are defined according to the SAS spec. Some missing whitespaces are also added, and whitespace indentation in sas_hash_addr() is also fixed (see sas_hash_addr()). Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Some misc tidy-upXiang Chen4-53/+38
Do some minor tidy-up. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Don't fail IT nexus reset for Open Reject timeoutLuo Jiaxing1-11/+14
Currently we call hisi_sas_softreset_ata_disk() in hisi_sas_I_T_nexus_reset(). If this fails for open reject reason, there is no reason to fail the IT nexus reset, so only fail for TMF_RESP_FUNC_FAILED. Some other strings spilled over multiple lines are reunited. Signed-off-by: Luo Jiaxing <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Don't hard reset disk during controller resetLuo Jiaxing1-1/+2
In the function of hisi_sas_init_device(), we added ops->hardreset() to clear affiliation of STP target port or handle [STP pending] state. Function hisi_sas_init_device() will be called when a device is found or during controller reset. At controller reset, we call hisi_sas_init_device() to re-init the disks, so calling hardreset() is unnecessary and it also will cause some delay at controller reset. Signed-off-by: Luo Jiaxing <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Support all RAS events with MSI interruptsXiaofei Tan1-178/+259
This patch is to switch HW all error handling from PCI AER to MSI interrupt due to non-standard PCI implementation. All HW errors which were being reported through PCI AER can be reported through MSI interrupt also. Do two things to complete the switch: 1. Notify FW to switch to MSI handling through ACPI DSM. 2. Add MSI handling for some hw errors, ECC errors and poison errors (we also call some of them AXI reuser error). They were handled only through PCI AER before. For old FW reporting PCI AER events, the PCI AER handler will see that the driver on longer support AER, and will leave the device in offlined state, which is safe. Signed-off-by: Xiaofei Tan <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: allocate different SAS address for directly attached situationXiang Chen1-0/+2
In commit 8b8d66531555 ("scsi: hisi_sas: make SAS address of SATA disks unique"), we ensured that each SATA disk in the system has a unique SAS address, even if it is fake. That was for v2 hw. Add this for v3 hw. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Adjust the printk format of functions hisi_sas_init_device()Xiang Chen1-2/+1
In function hisi_sas_init_device(), the log is as follows when error for hardreset: hisi_sas_v3_hw 0000:74:02.0: SATA disk hardreset fail: 0xffffffed Actually if hardreset failed, its return value is negative, so change the print format from %x to %d. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Fix for setting the PHY linkrate when disconnectedJohn Garry5-23/+46
In commit efdcad62e7b8 ("scsi: hisi_sas: Set PHY linkrate when disconnected"), we use the sas_phy_data.enable flag to track whether the PHY was enabled or not, so that we know if we should set the PHY negotiated linkrate at SAS_LINK_RATE_UNKNOWN or SAS_PHY_DISABLED. However, it is not proper to use sas_phy_data.enable, since it is only set when libsas attempts to set the PHY disabled/enabled; hence, it may not even have an initial value. As a solution to this problem, introduce hisi_sas_phy.enable to track whether the PHY is enabled or not, so that we can set the negotiated linkrate properly when the PHY comes down. Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: Remedy inconsistent PHY down state in softwareXiang Chen1-2/+2
Currently there are two scenarioes which may cause PHY state of hardware (which is 0) is inconsistent with the state held in software: - Unplug SAS wire before get_phys_state when SAS controller reset, then the interrupts of phy down are ignored, phy state is 0 before reset, and it also gets 0 after reset, so phy down doesn't occur even if unplugged SAS wire; - For v3 hw later version, it will close bus when 2 bit ECC error occurs. So if unplug SAS wire at that time, interrupts of phy down also not occur. So at last it will cause host reset. It also get phy state 0 before and after reset, the same issue occurs. To solve it, use hisi_sas_phy_down() directly in rescan topology function. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: hisi_sas: add host reset interface for testXiang Chen4-0/+16
Add host reset interface to make it easier for testing the host reset feature. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12Merge branch '5.1/scsi-fixes' into 5.2/mergeMartin K. Petersen25-52/+188
We have a few submissions for 5.2 that depend on fixes merged post 5.1-rc1. Merge the fixes branch into queue. Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/iscsi: Make sure PDU processing continues if parsing a command ↵Bart Van Assche1-21/+18
fails Currently the iSCSI target driver sends a CHECK CONDITION code back to the initiator if the immediate data buffer is too large but it does not discard that immediate data buffer. The result is that the iSCSI target driver attempts to parse the immediate data itself as iSCSI PDUs and that all further iSCSI communication fails. Fix this by receiving and discarding too large immediate data buffers. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/iscsi: Make iscsit_map_iovec() more robustBart Van Assche1-14/+36
Make the code for mapping an iovec more robust by checking the bounds of the allocated iovec. This patch avoids that the following crash occurs if a map attempt is made that exceeds the bounds of the iovec that is being mapped: BUG: unable to handle kernel NULL pointer dereference at 00000000 00000014 RIP: 0010:iscsit_map_iovec+0x120/0x190 [iscsi_target_mod] Call Trace: iscsit_get_rx_pdu+0x8a2/0xe00 [iscsi_target_mod] iscsi_target_rx_thread+0x6e/0xa0 [iscsi_target_mod] kthread+0x109/0x140 Cc: Mike Christie <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/iscsi: Handle too large immediate data buffers correctlyBart Van Assche3-3/+26
Since target_alloc_sgl() and iscsit_allocate_iovecs() allocate buffer space for se_cmd.data_length bytes and since that number can be smaller than the iSCSI Expected Data Transfer Length (EDTL), ensure that the iSCSI target driver does not attempt to receive more bytes than what fits in the receive buffer. Always receive the full immediate data buffer such that the iSCSI target driver does not attempt to parse immediate data as an iSCSI PDU. Note: the current code base only calls iscsit_get_dataout() if the size of the immediate data buffer does not exceed the buffer size derived from the SCSI CDB. See also target_cmd_size_check(). Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/iscsi: Only send R2T if neededBart Van Assche2-0/+8
If an initiator submits more immediate data than the size derived from the SCSI CDB, do not send any R2T to the initiator. This scenario is triggered by the libiscsi test ALL.iSCSIResiduals.WriteVerify16Residuals if the iSCSI target driver is modified to discard too large immediate data buffers instead of trying to parse these as an iSCSI PDU. This patch avoids that a negative xfer_len value is passed to iscsit_add_r2t_to_list() if too large immediate data buffers are handled correctly. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/iscsi: Detect conn_cmd_list corruption earlyBart Van Assche1-0/+2
Certain behavior of an initiator can cause the target driver to send both a reject and a SCSI response. If that happens two target_put_sess_cmd() calls will occur without the command having been removed from conn_cmd_list. In other words, conn_cmd_list will get corrupted once the freed memory is reused. Although the Linux kernel can detect list corruption if list debugging is enabled, in this case the context in which list corruption is detected is not related to the context that caused list corruption. Hence add WARN_ON() statements that report the context that is causing list corruption. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/core: Make the XCOPY setup code easier to read by inlining two ↵Bart Van Assche1-27/+23
functions The target_xcopy_setup_pt_port() and target_xcopy_init_pt_lun() functions obfuscate what is really going on. Hence inline these two functions. This patch does not change any functionality. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/core: Simplify LUN initialization in XCOPY implementationBart Van Assche1-40/+3
Other than removing a few pr_debug() statements, this patch does not change any functionality. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/core: Remove a set-but-not-used member variable from the XCOPY ↵Bart Van Assche1-7/+2
implementation This patch does not change any functionality. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/core: Rework the SPC-2 reservation handling codeBart Van Assche6-19/+27
Instead of tracking the initiator that established an SPC-2 reservation, track the session through which the SPC-2 reservation has been established. This patch does not change any functionality. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: target/core: Fix a race condition in the LUN lookup codeBart Van Assche1-2/+2
The rcu_dereference(deve->se_lun) expression occurs twice in the LUN lookup functions. Since these expressions are not serialized against deve->se_lun assignments each of these expressions may yield a different result. Avoid that the wrong LUN pointer is stored in se_cmd by reading deve->se_lun only once. Cc: Mike Christie <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Nicholas Bellinger <[email protected]> Fixes: 29a05deebf6c ("target: Convert se_node_acl->device_list[] to RCU hlist") # v4.10 Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: scsi_transport_fc: nvme: display FC-NVMe port rolesHannes Reinecke8-15/+37
Currently the FC-NVMe driver is leverating the SCSI FC transport class to access the remote ports. Which means that all FC-NVMe remote ports will be visible to the fc transport layer, but due to missing definitions the port roles will always be 'unknown'. This patch adds the missing definitions to the fc transport class to that the port roles are correctly displayed. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: James Smart <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Reviewed-by: Giridhar Malavali <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-12scsi: cxgbi: remove redundant __kfree_skb call on skb and free cst->atidColin Ian King1-8/+6
The error return path via label rel_resource checks for a non-null skb before free'ing it. However, skb is always null at this exit path, so the null check and the free are redundant and can be removed. Removing this allows the original goto's to rel_resource to be cleaned up; the first can be replaced by a return of -EINVAL, the second can be replaced by a more appropriate -ENOMEM return and fix a memory leak by freeing csk->atid. Addresses-Coverity: ("Logically Dead Code") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-09scsi: tcm_qla2xxx: Minimize #include directivesBart Van Assche1-6/+0
Only include those header files that are needed by the code in this source file. [mkp: include build fix from Bart for SPARC] Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: csiostor: fix missing data copy in csio_scsi_err_handler()Varun Prakash1-1/+4
If scsi cmd sglist is not suitable for DDP then csiostor driver uses preallocated buffers for DDP, because of this data copy is required from DDP buffer to scsi cmd sglist before calling ->scsi_done(). Signed-off-by: Varun Prakash <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Unregister resources in the opposite order of the ↵Bart Van Assche1-4/+5
registration order Make sure that resources are only unregistered after the users of these resources have been unregistered. Only unregister the character device if registration of it succeeded. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Unregister chrdev if module initialization failsBart Van Assche1-13/+21
If module initialization fails after the character device has been registered, unregister the character device. Additionally, avoid duplicating error path code. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Fixes: 6a03b4cd78f3 ("[SCSI] qla2xxx: Add char device to increase driver use count") # v2.6.35. Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Use get/put_unaligned where appropriateBart Van Assche3-15/+12
This patch makes the code easier to read but does not change any functionality. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Make qla2x00_process_response_queue() easier to readBart Van Assche1-38/+47
Make qla2x00_process_response_queue() easier to read by splitting this function. This patch does not change any functionality. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Reduce the number of forward declarationsBart Van Assche1-46/+31
Move the SCSI host template definition after the definition of the functions that it references. Remove the forward declarations that became unnecessary by that change. This patch does not change any functionality. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Declare local symbols staticBart Van Assche1-2/+2
This patch avoids that sparse complains that a declaration is missing. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Use ARRAY_SIZE() in the definition of QLA_LAST_SPEEDBart Van Assche1-1/+1
Make the code easier to read by avoiding to use a hard-coded constant. This patch does not change any functionality. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Remove a comment that refers to the SCSI host lockBart Van Assche1-3/+0
Since qla2xxx_queuecommand() no longer takes the SCSI host lock, remove a comment that refers to the host lock. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: Change a stack variable into a static const variableBart Van Assche1-2/+3
Make qla2x00_get_host_fabric_name() slightly faster by changing a stack array into a static array. Declare that array const now that the wwn_to_u64() argument pointer has been declared const. Cc: Himanshu Madhani <[email protected]> Cc: Giridhar Malavali <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: scsi_transport_fc: Declare wwn_to_u64() argument constBart Van Assche1-1/+1
Since the wwn_to_u64() function does not change its input, make its argument const. Cc: James Smart <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Johannes Thumshirn <[email protected]> Cc: Steffen Maier <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: qla2xxx: fix spelling mistake "alredy" -> "already"Colin Ian King1-1/+1
There is a spelling mistake in a ql_log message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: lpfc: add support for posting FC events on FPIN receptionJames Smart2-0/+12
This patch adds support to recognize FPIN ELS's that are received. When one is received, the fc transport will be called to handle the the FPIN. Signed-off-by: James Smart <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: scsi_transport_fc: Add FPIN fc event codesJames Smart2-0/+20
Add a new event type - an FPIN event. Add a new routine, fc_host_fpin_rcv(), that lldd's call when an FPIN is received. The routine processes the fpin payload. For now, the routine only logs an FPIN event. Signed-off-by: Muneendra <[email protected]> Signed-off-by: James Smart <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: scsi_transport_fc: refactor event posting routinesJames Smart2-62/+49
There are two routines generating transport events that do the same thing with only a couple of values set differently. Refactor so there's a single routine doing the netlink operations to send the event. All the differences are passed as arguments. Export the symbol so the generic routine can be called by llds. Modify the existing two event routines to use the helper. Signed-off-by: James Smart <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: fc: add FPIN ELS definitionJames Smart1-0/+33
T11 has introduced a new Fabric Notifications mechanism whereby the fabric can notify a port of events occurring in the fabric. The notifications are given by the FPIN ELS. Add the FPIN ELS definitions to the kernel. Signed-off-by: James Smart <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-08scsi: lpfc: Fix a recently introduced compiler warningBart Van Assche1-2/+2
This patch avoids that the following compiler warning is reported with CONFIG_NVME_FC=n: drivers/scsi/lpfc/lpfc_nvme.c:2140:1: warning: 'lpfc_nvme_lport_unreg_wait' defined but not used [-Wunused-function] lpfc_nvme_lport_unreg_wait(struct lpfc_vport *vport, ^~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 3999df75bccb ("scsi: lpfc: Declare local functions static") Cc: James Smart <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Acked-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-03scsi: qla2xxx: Remove useless set memory to zero use memset()YueHaibing1-1/+0
The memory return by kzalloc() has already be set to zero, so remove useless memset(0). Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-03scsi: mptscsih: Mark expected switch fall-throughsGustavo A. R. Silva1-0/+2
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/message/fusion/mptscsih.c: In function mptscsih_io_done : drivers/message/fusion/mptscsih.c:741:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if ( ioc->bus_type == SAS ) { ^ drivers/message/fusion/mptscsih.c:790:3: note: here case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ ^~~~ drivers/message/fusion/mptscsih.c:884:4: warning: this statement may fall through [-Wimplicit-fallthrough=] scsi_set_resid(sc, 0); ^~~~~~~~~~~~~~~~~~~~~ drivers/message/fusion/mptscsih.c:885:3: note: here case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-03scsi: dt-bindings: ufs: Add VCC capability on MediaTek UFS driverStanley Chu1-0/+3
Add VCC supply for ufs-mediatek driver to provide power-saving operation during low-power modes. For example VCC can be turned-off during system suspend and turned-on after system is resumed. Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-03scsi: dt-bindings: ufs: Remove custom property "<name>-fixed-regulator"Stanley Chu1-2/+0
Custom device tree property "<name>-fixed-regulator" can be removed because, 1) It is not used anywhere in tree. 2) All handlings for "<name>-fixed-regulator" have been removed in UFS driver. 3) There is no issue if an existed regulator defined "<name>-fixed-regulator" property in device tree. Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-04-03scsi: ufs-cdns: Add support for UFSHCI with M31 PHYJan Kotas1-10/+64
This patch adds an additional PHY initialization, required for M31 PHY when used with Cadence UFS HC. A new compatible string has been added for this purpose. [mkp: nuke superfluous status return] Signed-off-by: Jan Kotas <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>