aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-15scsi: elx: libefc: Remote node state machine interfacesJames Smart
Add library interface definitions for: - Remote node (aka remote port) allocation, initializaion and destroy routines. Link: https://lore.kernel.org/r/20210601235512.20104-13-jsmart2021@gmail.com Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc: SLI and FC PORT state machine interfacesJames Smart
Add library interface definitions for: - SLI and FC port (aka n_port_id) registration, allocation and deallocation. Link: https://lore.kernel.org/r/20210601235512.20104-12-jsmart2021@gmail.com Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc: FC Domain state machine interfacesJames Smart
Add library interface definitions for: - FC Domain registration, allocation and deallocation sequence Link: https://lore.kernel.org/r/20210601235512.20104-11-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc: Emulex FC discovery library APIs and definitionsJames Smart
Add library interface definitions for: - SLI/Local FC port objects - efc_domain_s: FC domain (aka fabric) objects - efc_node_s: FC node (aka remote ports) objects Link: https://lore.kernel.org/r/20210601235512.20104-10-jsmart2021@gmail.com Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc: Generic state machine frameworkJames Smart
Start the population of the libefc library. The library will contain common tasks usable by a target or initiator driver. The library will also contain a FC discovery state machine interface. Creates the library directory and add definitions for the discovery state machine interface. Link: https://lore.kernel.org/r/20210601235512.20104-9-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: APIs to setup SLI libraryJames Smart
Add APIs to initialize the library, initialize the SLI Port, reset firmware, terminate the SLI Port, and terminate the library. Link: https://lore.kernel.org/r/20210601235512.20104-8-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: BMBX routines and SLI config commandsJames Smart
Add routines to create mailbox commands used during adapter initialization and add APIs to issue mailbox commands to the adapter through the bootstrap mailbox register. Link: https://lore.kernel.org/r/20210601235512.20104-7-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: Populate and post different WQEsJames Smart
Add service routines to create different WQEs and add APIs to issue iread, iwrite, treceive, tsend and other work queue entries. Link: https://lore.kernel.org/r/20210601235512.20104-6-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: Queue create/destroy/parse routinesJames Smart
Add service routines to create mailbox commands and add APIs to create/destroy/parse SLI-4 EQ, CQ, RQ and MQ queues. Link: https://lore.kernel.org/r/20210601235512.20104-5-jsmart2021@gmail.com Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: Data structures and defines for mbox commandsJames Smart
Add definitions for SLI-4 mailbox commands and responses. Link: https://lore.kernel.org/r/20210601235512.20104-4-jsmart2021@gmail.com Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: SLI Descriptors and Queue entriesJames Smart
Continue the libefc_sli SLI-4 library population. Add SLI-4 Data structures and defines for: - Buffer Descriptors (BDEs) - Scatter/Gather List elements (SGEs) - Queues and their Entry Descriptions for: Event Queues (EQs), Completion Queues (CQs), Receive Queues (RQs), and the Mailbox Queue (MQ). Link: https://lore.kernel.org/r/20210601235512.20104-3-jsmart2021@gmail.com Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: elx: libefc_sli: SLI-4 register offsets and field definitionsJames Smart
This is the initial patch for the new Emulex target mode SCSI driver. - Create the new Emulex source level directory drivers/scsi/elx and add the directory to the MAINTAINERS file. - Create the first library subdirectory drivers/scsi/elx/libefc_sli. This library is a SLI-4 interface library. - Start the population of the libefc_sli library with definitions of SLI-4 hardware register offsets and definitions. Link: https://lore.kernel.org/r/20210601235512.20104-2-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: pm8001: Remove unnecessary OOM messageZhen Lei
Fixes scripts/checkpatch.pl warning: WARNING: Possible unnecessary 'out of memory' message Remove it can help us save a bit of memory. Also change the return error code from "-1" to "-ENOMEM". Link: https://lore.kernel.org/r/20210610094605.16672-2-thunder.leizhen@huawei.com Acked-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: qla2xxx: Use list_move_tail() instead of list_del()/list_add_tail()Baokun Li
Using list_move_tail() instead of list_del() + list_add_tail(). Link: https://lore.kernel.org/r/20210609072321.1356896-1-libaokun1@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: ufs-mediatek: Create reset control device_linkPeter Wang
Mediatek UFS reset function relies on Reset Control provided by reset-ti-syscon. To make Mediatek Reset Control work properly, select reset-ti-syscon to ensure it is being built. In addition, establish device_link to wait until reset-ti-syscon initialization is complete during UFS probing. Link: https://lore.kernel.org/r/1622601720-22466-1-git-send-email-peter.wang@mediatek.com Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: qla2xxx: Remove duplicate declarationsShaokun Zhang
qla2x00_post_uevent_work(), qla2x00_free_fcport() and ql2xexlogins are declared multiple times. Remove the duplicates. Link: https://lore.kernel.org/r/1621843402-34828-1-git-send-email-zhangshaokun@hisilicon.com Cc: Nilesh Javali <njavali@marvell.com> Cc: GR-QLogic-Storage-Upstream@marvell.com Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: lpfc: Use list_move_tail() instead of list_del()/list_add_tail()Zou Wei
Using list_move_tail() instead of list_del() + list_add_tail(). Link: https://lore.kernel.org/r/1623113493-49384-1-git-send-email-zou_wei@huawei.com Reported-by: Hulk Robot <hulkci@huawei.com> Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: storvsc: Correctly handle multiple flags in srb_statusMichael Kelley
Hyper-V is observed to sometimes set multiple flags in the srb_status, such as ABORTED and ERROR. Current code in storvsc_handle_error() handles only a single flag being set, and does nothing when multiple flags are set. Fix this by changing the case statement into a series of "if" statements testing individual flags. The functionality for handling each flag is unchanged. Link: https://lore.kernel.org/r/1622827263-12516-3-git-send-email-mikelley@microsoft.com Signed-off-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: storvsc: Update error loggingMichael Kelley
When an I/O error is reported by the underlying Hyper-V host, current code provides details only when the logging level is set to WARN, making it more difficult to diagnose problems in live customer situations. Fix this by reporting details at ERROR level, which is the default. Also add more information, including the Hyper-V error code, and the tag # so that the message can be matched with messages at the SCSI and blk-mq levels. Also, sense information logging is inconsistent and duplicative. The existence of sense info is first logged at WARN level, and then full sense info is logged at ERROR level. Fix this by removing the logging of the existence of sense info, and change the logging of full sense info to WARN level in favor of letting the generic SCSI layer handle such logging. With the change to WARN level, it's no longer necessary to filter out as noise any NOT READY sense info generated by the virtual DVD device. Link: https://lore.kernel.org/r/1622827263-12516-2-git-send-email-mikelley@microsoft.com Signed-off-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: storvsc: Miscellaneous code cleanupsMichael Kelley
As general cleanup and in preparation for subsequent patches: - Use min() instead of open coding. - Use set_host_byte() instead of open coding access to scsi_status field. - Collapse nested "if" statements to reduce indentation. - Fix other indentation. - Remove extra blank lines. No functional changes. [mkp: dropped status_byte() which no longer exists] Link: https://lore.kernel.org/r/1622827263-12516-1-git-send-email-mikelley@microsoft.com Signed-off-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Introduce VMID in I/O pathGaurav Srivastava
Introduce the VMID in the I/O path. Check if the VMID is enabled and if the I/O belongs to a VM or not. Link: https://lore.kernel.org/r/20210608043556.274139-14-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Add QFPA and VMID timeout check in worker threadGaurav Srivastava
Add a periodic check for issuing of QFPA command and VMID timeout in the worker thread. The inactivity timeout check is added via the timer function. Link: https://lore.kernel.org/r/20210608043556.274139-13-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Timeout implementation for VMIDGaurav Srivastava
Implement timeout functionality for the VMID. After the set time period of inactivity, the VMID is deregistered from the switch. Link: https://lore.kernel.org/r/20210608043556.274139-12-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Append the VMID to the wqe before sendingGaurav Srivastava
Add the VMID in wqe before sending out the request. The type of VMID depends on the configured type and is checked before being appended. Link: https://lore.kernel.org/r/20210608043556.274139-11-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Implement CT commands for appidGaurav Srivastava
Implement CT commands for registering and deregistering the appid for the application. Also, a small change in decrementing the ndlp ref counter has been added. Link: https://lore.kernel.org/r/20210608043556.274139-10-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Functions to manage VMIDsGaurav Srivastava
Implement routines to save, retrieve, and remove the VMIDs from the data structure. A hash table is used to save the VMIDs and the corresponding UUIDs associated with the application/VMs. Link: https://lore.kernel.org/r/20210608043556.274139-9-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Implement ELS commands for appidGaurav Srivastava
Implement ELS commands QFPA and UVEM for the priority tagging appid support. Link: https://lore.kernel.org/r/20210608043556.274139-8-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Add support for VMID in mailbox commandGaurav Srivastava
Add supporting datastructures for mailbox command which helps in determining if the firmware supports appid. Allocate resources for VMID at initialization time and clean them up on removal. Link: https://lore.kernel.org/r/20210608043556.274139-7-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: VMID parameter initializationGaurav Srivastava
Initialize parameters such as type of VMID, max number of VMIDs supported and timeout value for the VMID registration based on the user input. Link: https://lore.kernel.org/r/20210608043556.274139-6-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: lpfc: vmid: Add datastructure for supporting VMID in lpfcGaurav Srivastava
Add the primary datastructures needed to implement VMID in the lpfc driver. Maintain the capability, current state, and hash table for the vmid/appid along with other information. This implementation supports the two versions of vmid implementation (app header and priority tagging). Link: https://lore.kernel.org/r/20210608043556.274139-5-muneendra.kumar@broadcom.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Gaurav Srivastava <gaurav.srivastava@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: nvme: Added a new sysfs attribute appid_storeMuneendra Kumar
Add a new sysfs attribute, appid_store, which can be used to set the application identifier in the blkcg associated with a cgroup id. Below is the interface provided to set the app_id: echo "<cgroupid>:<appid>" >> /sys/class/fc/fc_udev_device/appid_store echo "457E:100000109b521d27" >> /sys/class/fc/fc_udev_device/appid_store Link: https://lore.kernel.org/r/20210608043556.274139-4-muneendra.kumar@broadcom.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: blkcg: Add app identifier support for blkcgMuneendra Kumar
Add a unique application identifier (i.e fc_app_id member) in blkcg. This allows identification of traffic belonging to an specific both on the host and in the fabric infrastructure. As an example, this allows the storage stack to uniquely identify traffic belong to particular virtual machine. Link: https://lore.kernel.org/r/20210608043556.274139-3-muneendra.kumar@broadcom.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: cgroup: Add cgroup_get_from_id()Muneendra Kumar
Add a new function, cgroup_get_from_id(), to retrieve the cgroup associated with a cgroup id. Also export the function cgroup_get_e_css() as this is needed in blk-cgroup.h. Link: https://lore.kernel.org/r/20210608043556.274139-2-muneendra.kumar@broadcom.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Muneendra Kumar <muneendra.kumar@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: fc: FDMI enhancementJaved Hasan
Added RHBA and RPA attributes type and length. As per FC_GC_7 document section "Table 400 – Attribute Entry Types and associated Values" ASCII type attributes length can be vary from "4 to 256 byte". If we keep all RHBA ASCII attributes length 256 then total length is going upto 2750, which is far more than 2048 (max frame size). In libfc we do have logic to split FCP commands but not for CT commands. Practically all version/names get covered with in 64 bytes except OS name, for that we need 128 bytes. Hence length of all RBHA ASCII attributes is reduced to 64 bytes and 128 bytes in case of OS name. RPA attributes total length is within frame size. Link: https://lore.kernel.org/r/20210603121623.10084-6-jhasan@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: libfc: FDMI enhancementsJaved Hasan
Add all the attributes for FDMI. Fall back mechanism is added in between FDMI V2 and FDMI V1 attributes. In case FDMI get fails for V2 attributes we fall back to V1 attributes. Link: https://lore.kernel.org/r/20210603121623.10084-5-jhasan@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: libfc: Add FDMI-2 attributesJaved Hasan
Add all attributes for RHBA and RPA registration. Fallback mechanism is added between RBHA V2 and RHBA V1 attributes. In case RHBA get fails for V2 attributes we fall back to V1 attribute registration. Link: https://lore.kernel.org/r/20210603121623.10084-4-jhasan@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: qedf: Add vendor identifier attributeJaved Hasan
Link: https://lore.kernel.org/r/20210603121623.10084-3-jhasan@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-10scsi: libfc: Initialisation of RHBA and RPA attributesJaved Hasan
Initialize RHBA and RPA attributes. Link: https://lore.kernel.org/r/20210603121623.10084-2-jhasan@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: libfc: Correct the condition check and invalid argument passedJaved Hasan
Incorrect condition check was leading to data corruption. Link: https://lore.kernel.org/r/20210603101404.7841-3-jhasan@marvell.com Fixes: 8fd9efca86d0 ("scsi: libfc: Work around -Warray-bounds warning") CC: stable@vger.kernel.org Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: fc: Correct RHBA attributes lengthJaved Hasan
As per the FC-GS-5 specification, attribute lengths of node_name and manufacturer should in range of "4 to 64 Bytes" only. Link: https://lore.kernel.org/r/20210603101404.7841-2-jhasan@marvell.com Fixes: e721eb0616f6 ("scsi: scsi_transport_fc: Match HBA Attribute Length with HBAAPI V2.0 definitions") CC: stable@vger.kernel.org Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Javed Hasan <jhasan@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: hisi_sas: Speed up error handling when internal abort timeout occursLuo Jiaxing
If an internal task abort timeout occurs, the controller has developed a fault, and needs to be reset to be recovered. When this occurs during error handling, the current policy is to allow error handling to continue, and the inevitable nexus ha reset will handle the required reset. However various steps of error handling need to taken before this happens. These also involve some level of HW interaction, which will also fail with various timeouts. Speed up this process by recording a HW fault bit for an internal abort timeout - when this is set, just automatically error any HW interaction, and essentially go straight to clear nexus ha (to reset the controller). Link: https://lore.kernel.org/r/1623058179-80434-6-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: hisi_sas: Reset controller for internal abort timeoutLuo Jiaxing
If an internal task abort timeout occurs, the controller has developed a fault, and needs to be reset to be recovered. However if a timeout occurs during SCSI error handling, issuing a controller reset immediately may conflict with the error handling. To handle internal abort in these two scenarios, only queue the reset when not in an error handling function. In the case of a timeout during error handling, do nothing and rely on the inevitable ha nexus reset to reset the controller. Link: https://lore.kernel.org/r/1623058179-80434-5-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: hisi_sas: Include HZ in timer macrosLuo Jiaxing
Include HZ in timer macros to make the code more concise. Link: https://lore.kernel.org/r/1623058179-80434-4-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: hisi_sas: Run I_T nexus resets in parallel for clear nexus resetLuo Jiaxing
For a clear nexus reset operation, the I_T nexus resets are executed serially for each device. For devices attached through an expander, this may take 2s per device; so, in total, could take a long time. Reduce the total time by running the I_T nexus resets in parallel through async operations. Link: https://lore.kernel.org/r/1623058179-80434-3-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: hisi_sas: Put a limit of link reset retriesLuo Jiaxing
If an OOB event is received but the phy still fails to come up, a link reset will be issued repeatedly at an interval of 20s until the phy comes up. Set a limit for link reset issue retries to avoid printing the timeout message endlessly. Link: https://lore.kernel.org/r/1623058179-80434-2-git-send-email-john.garry@huawei.com Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: qedi: Fix host removal with running sessionsMike Christie
qedi_clear_session_ctx() could race with the in-kernel or userspace driven recovery/removal and we could access a NULL conn or do a double free. We should be using iscsi_host_remove() to start the removal process from the driver. It will start the in-kernel recovery and notify userspace that the driver's scsi_hosts are being removed. iscsid will then drive the session removal like is done when the logout command is run. When the sessions are removed, iscsi_host_remove() will return so qedi can finish knowing there are no running sessions and no new sessions will be allowed. This also fixes an issue where we check for a NULL conn after already accessing it introduced in commit 27e986289e73 ("scsi: iscsi: Drop suspend calls from ep_disconnect") by just removing the function completely. Link: https://lore.kernel.org/r/20210609192709.5094-1-michael.christie@oracle.com Fixes: 27e986289e73 ("scsi: iscsi: Drop suspend calls from ep_disconnect") Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: mpi3mr: Fix error handling in mpi3mr_setup_isr()Dan Carpenter
The pci_alloc_irq_vectors_affinity() function returns negative error codes or it returns a number between the minimum vectors (1 in this case) and max_vectors. It won't return zero. Because "i" is a u16 then the error handling won't work. And also if it did work the error code was not set. Really "max_vectors" can be an int as well because we're doing a min_t() on int type. The other change is that it's better to remove unnecessary initialization so that static checkers can warn us if there are ever uninitialized variable bugs introduced in the future. I changed the error code from -1 (-EPERM) if the kmalloc() failed to -ENOMEM. And on success path I changed it from "return retval;" to "return 0;" which shouldn't affect the compiled code but makes it more readable. Link: https://lore.kernel.org/r/YMCJcnmSI4kOIyv/@mwanda Fixes: 824a156633df ("scsi: mpi3mr: Base driver code") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: mpi3mr: Delete unnecessary NULL checkDan Carpenter
The "mrioc->intr_info" pointer can't be NULL, but if it could then the second iteration through the loop would Oops. Let's delete the confusing and impossible NULL check. Link: https://lore.kernel.org/r/YMCJKgykDYtyvY44@mwanda Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: mpi3mr: Fix a double freeTomas Henzl
Fix a double free, scsi_tgt_priv_data will be freed in mpi3mr_target_destroy() so remove the kfree() from mpi3mr_target_alloc(). I've also removed few unneeded initialisations. Link: https://lore.kernel.org/r/20210608145712.16386-1-thenzl@redhat.com Acked-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-09scsi: ufs: core: Fix a possible use before initialization caseCan Guo
In ufshcd_exec_dev_cmd(), if error happens before lrpb is initialized, then we should bail out instead of letting trace record the error. Link: https://lore.kernel.org/r/1623227044-22635-1-git-send-email-cang@codeaurora.org Fixes: a45f937110fa ("scsi: ufs: Optimize host lock on transfer requests send/compl paths") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>