summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-24scsi: megaraid_sas: Fix endianness issues in DCMD handlingShivasharan S
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: megaraid_sas: Do not re-fire shutdown DCMD after OCRShivasharan S
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: megaraid_sas: Call megasas_complete_cmd_dpc_fusion every 1 second ↵Shivasharan S
while there are pending commands megasas_wait_for_outstanding_fusion checks for pending commands every 1 second. But megasas_complete_cmd_dpc_fusion is only called every 5 seconds. If the commands are already completed by firmware, there is an additional delay of 5 seconds before driver will process completion for these commands. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: megaraid_sas: Use synchronize_irq in target reset caseShivasharan S
Similar to task abort case, use synchronize_irq API in target reset case. Also, remove redundant call to megasas_complete_cmd_dpc_fusion after calling megasas_sync_irqs in task abort case. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: megaraid_sas: set minimum value of resetwaittime to be 1 secsShivasharan S
Setting resetwaittime to 0 during a FW fault will result in driver not calling the OCR. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Cc: stable@vger.kernel.org Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: megaraid_sas: mismatch of allocated MFI frame size and length exposed ↵Shivasharan S
in MFI MPT pass through command Driver allocated 256 byte MFI frames bytes but while sending MFI frame (embedded inside chain frame of MPT frame) to firmware, driver sets the length as 4k. This results in DMA read error messages during boot. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Cc: stable@vger.kernel.org Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_testGustavo A. R. Silva
Remove variable assignments. The value stored in local variable _rc_ is overwritten at line 2448:rc = lpfc_sli4_bsg_set_link_diag_state(phba, 0); before it can be used. Addresses-Coverity-ID: 1226935 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: James Smart <james.smart@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZETodd Poynor
Take f_mutex around mmap() processing to protect against races with the SG_SET_RESERVED_SIZE ioctl. Ensure the reserve buffer length remains consistent during the mapping operation, and set the "mmap called" flag to prevent further changes to the reserved buffer size as an atomic operation with the mapping. [mkp: fixed whitespace] Signed-off-by: Todd Poynor <toddpoynor@google.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: sg: recheck MMAP_IO request length with lock heldTodd Poynor
Commit 1bc0eb044615 ("scsi: sg: protect accesses to 'reserved' page array") adds needed concurrency protection for the "reserve" buffer. Some checks that are initially made outside the lock are replicated once the lock is taken to ensure the checks and resulting decisions are made using consistent state. The check that a request with flag SG_FLAG_MMAP_IO set fits in the reserve buffer also needs to be performed again under the lock to ensure the reserve buffer length compared against matches the value in effect when the request is linked to the reserve buffer. An -ENOMEM should be returned in this case, instead of switching over to an indirect buffer as for non-MMAP_IO requests. Signed-off-by: Todd Poynor <toddpoynor@google.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hpsa: fix the device_id in hpsa_update_device_info()Dan Carpenter
The parentheses are in the wrong place so we specify the length as "sizeof(this_device->device_id) < 0" which is zero. Fixes: 988b87edd231 ("scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: aha1542: constify pnp_device_idArvind Yadav
pnp_device_id are not supposed to change at runtime. All functions working with pnp_device_id provided by <linux/pnp.h> work with const pnp_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: scsi-sysfs: Adjust error returned for adapter reset requestweiping zhang
If scsi_host_template->host_reset is NULL and the user requests an adapter reset through echo adapter > /sys/class/scsi_host/hostx/host_reset -EINVAL will be returned even though the "adapter" argument is perfectly valid. Change this so that we only return -EINVAL if the provided string is invalid. If the host does not implement a ->host_reset function we'll return -EOPNOTSUPP. [mkp: tweaked patch description] Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: ch: add refcountingHannes Reinecke
struct scsi_changer needs refcounting as the device might be removed while the fd is still open. [mkp: whitespace] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: pmcraid: fix duplicated code for different branchesGustavo A. R. Silva
Refactor code in order to avoid identical code for different branches. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: ncr5380: constify pnp_device_idArvind Yadav
pnp_device_id are not supposed to change at runtime. All functions working with pnp_device_id provided by <linux/pnp.h> work with const pnp_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedf: Update driver version to 8.20.5.0.Chad Dupuis
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedf: Fix up modinfo parameter name for 'debug' in modinfo output.Chad Dupuis
Because we were passing 'qedf_debug' instead of 'debug' to the MODULE_PARM_DESC() macro, modinfo listed the parameter name as 'qedf_debug' instead of it's proper name 'debug'. Correct the parameter name. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedf: Covert single-threaded workqueues to regular workqueues.Chad Dupuis
There is no ordering required for the various workqueues the driver uses so they can be converted to regular workqueues. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedf: Corrent VLAN tag insertion in fallback VLAN case.Chad Dupuis
Currently in the driver the qedf_ctx attribute vlan_hw_insert is used to which whether to insert a VLAN tag in FIP frames (except for FIP VLAN request which is explicitly sent out untagged at least from the driver's point of view). When we receive a FIP VLAN response, we set qedf->vlan_hw_insert to 0 which makes the qedf_fip_send function insert the VLAN. However when we exhaust our FIP VLAN retries, we do not set qedf->vlan_hw_insert to 0 which means that the driver will not tag the FIP frame with the correct VLAN ID. The result that was observed on the wire is that some entity either in the LL2 or L2 firmware is adding a NULL VLAN tag which can cause FIP solicitation to fail. The offload FCoE frame function, qedf_xmit, does not use the vlan_hw_insert attribute to decide whether to tag frames with the FIP/FCoE VLAN. Instead it unilaterially tags the offload frames with the VLAN ID stored in qedf->vlan_id. This is the correct behavior so the driver can guarantee that non-offload FIP frames go out with the correct VLAN ID. Also use the Linux network layer helpers instead of doing the VLAN insert manually. Also fix setting the fallback VLAN so that it used the module parameter and is not hardcoded to 1002 (though 1002 is the default). [mkp: fixed typo] Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedf: Use granted MAC from the FCF for the FCoE source address if it ↵Chad Dupuis
is available. Currently in the driver we've been using the fc_fcoe_set_mac() function to set the source MAC for FCoE traffic. This works well in most cases as it uses the spec. default FCF-MAC. However, if the administrator changes the FCF-MAC switch, then any FCoE traffic we send will be dropped by the switch. Instead we should check the granted MAC from the FLOGI payload and use that address if it is present. Otherwise, fall back to using the the default FCF-MAC and the fabric ID of the port as the FCoE MAC address. Once this address is known we need to set it when doing non-offload traffic, offload traffic and setting the data_src_address libfcoe uses for FIP keep alive messages. Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedf: Set WWNN and WWPN based on values from qed.Chad Dupuis
If dev_info.wwpn and dev_info.wwnn are set by qed use these values to set the WWNs of the port. Otherwise fall back to the old method using fcoe_wwn_from_mac(). Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qla2xxx: fix spelling mistake of variable sfp_additonal_infoColin Ian King
Trivial fix to variable name, sfp_additonal_info should be sfp_additional_info (add in missing i). Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: osst: silence underflow warning in osst_verify_frame()Dan Carpenter
The code looks like this: i = ntohl(aux->filemark_cnt); if (STp->header_cache != NULL && i < OS_FM_TAB_MAX && (i > STp->filemark_cnt || STp->first_frame_position - 1 != ntohl(STp->header_cache->dat_fm_tab.fm_tab_ent[i]))) { If i is negative then it's less than OS_FM_TAB_MAX so we read before the start of the STp->header_cache->dat_fm_tab.fm_tab_ent[] array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: osst: add missing indent on a for loop statementColin Ian King
The for loop is statement is missing an indent, add it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: mpt3sas: fix pr_info message continuationColin Ian King
An optional discovery status should be printed with a pr_cont and needs a leading space to make it more readable. The final new line should also be a pr_cont and the indentation is out by one, so fix that too. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: ses: make page2 support optionalHannes Reinecke
Simple subenclosures do not need to support SES page 2, so make it optional. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: ses: Fixup error message 'failed to get diagnostic page 0xffffffea'Hannes Reinecke
The printk was using the result as argument, leading to a slightly confusing log message. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: ses: check return code from ses_recv_diag()Hannes Reinecke
We should be checking the return code from ses_recv_diag() to avoid accessing invalid data. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hpsa: Remove 'hpsa_allow_any' module optionHannes Reinecke
As the cciss driver has been removed there are no overlapping PCI IDs anymore, and the 'hpsa_allow_any' flag can be removed. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: cciss: Drop obsolete driverHannes Reinecke
The hpsa driver now has support for all boards the cciss driver used to support, so this patch removes the cciss driver and make hpsa an alias to cciss. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hpsa: do not print errors for unsupported report luns formatHannes Reinecke
Legacy boards might not support the 'extended' report luns format, but as this is to be expected we don't need to print out an error here. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD pageHannes Reinecke
Legacy boards might not support the LV_DEVICE_ID VPD page, so we shouldn't print out an error message here. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hpsa: disable volume status check for legacy boardsHannes Reinecke
Legacy boards might not support volume status, so assume the volume is online here. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hpsa: add support for legacy boardsHannes Reinecke
Add support for legacy boards, ensuring to enable the driver for those boards only when 'hpsa_allow_any' is set. The attribute 'legacy_board' is set to '1' if the device is a legacy board, and '0' otherwise. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'Christophe JAILLET
'rc' is known to be 0 at this point. If 'create_context()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: sym53c8xx: Avoid undefined behaviourHelge Deller
On parisc I see this UBSAN warning with a sym53c896: UBSAN: Undefined behaviour in ./drivers/scsi/sym53c8xx_2/sym_hipd.c:762:24 index -1903078336 is out of range for type 'u32 [7]' Avoid this warning by switching to div64_ul(). [mkp: fix typo] Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: make 'state' device attribute pollableHannes Reinecke
While the 'state' attribute can (and will) change occasionally, calling 'poll()' or 'select()' on it fails as sysfs is never notified that the state has changed. With this patch calling 'poll()' or 'select()' will work properly. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: scsi_lib: rework scsi_internal_device_unblock_nowait()Hannes Reinecke
Rework scsi_internal_device_unblock_nowait() into using a switch statement. No functional changes. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: esas2r: constify pci_device_id.Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by <linux/pci.h> work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: virtio: virtio_scsi: Set can_queue to the length of the virtqueue.Richard W.M. Jones
Since switching to blk-mq as the default in commit 5c279bd9e406 ("scsi: default to scsi-mq"), virtio-scsi LUNs consume about 10x as much kernel memory. qemu currently allocates a fixed 128 entry virtqueue. can_queue currently is set to 1024. But with indirect descriptors, each command in the queue takes 1 virtqueue entry, so the number of commands which can be queued is equal to the length of the virtqueue. Note I intend to send a patch to qemu to allow the virtqueue size to be configured from the qemu command line. Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: virtio: Reduce BUG if total_sg > virtqueue size to WARN.Richard W.M. Jones
If using indirect descriptors, you can make the total_sg as large as you want. If not, BUG is too serious because the function later returns -ENOSPC. Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: qedi: Limit number for CQ queues.Manish Rangankar
[qed_sp_iscsi_func_start:189(host_7-0)]Cannot satisfy CQ amount. Queues requested 8, CQs available 4. Aborting function start Above condition will resolve as management firmware is capable of telling us the number of CQs available for a given PF, qed will communicate the same number to qedi, So that qedi will know how much CQs are allowed. Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hisi_sas: remove driver versioningJohn Garry
The driver version is not updated with changes to the driver, so it has no value, so just get rid of it. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hisi_sas: replace kfree with scsi_host_putJohn Garry
Instances of kfree(shost) should be replaced with scsi_host_put(). In addition, a missing scsi_host_put() is added for error path in hisi_sas_shost_alloc_pci() and v3 driver removal. Signed-off-by: Pan Bian <bianpan2016@163.com> # For main.c changes Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hisi_sas: remove phy_down_v3_hw() res variableJohn Garry
Variable res only holds value 0, so remove it. This cleans up a coccicheck warning. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24scsi: hisi_sas: add phy_set_linkrate_v3_hw()Xiang Chen
Add function to set linkrate for v3 hw. 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>
2017-08-24scsi: hisi_sas: update some v3 register init settingsXiang Chen
This patch updates some register setting according to recommendation from HW designer and experiment. 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>
2017-08-24scsi: hisi_sas: add reset handler for v3 hwXiang Chen
Use ACPI "_RST" method to reset the controller, since FLR is not supported. Function hisi_sas_stop_phys() is introduced to remove some code duplication. 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>
2017-08-10scsi: hisi_sas: kill tasklet when destroying irq in v3 hwXiang Chen
This patch adds calls to kill CQ takslets v3 hw during probe failure. 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>
2017-08-10scsi: hisi_sas: fix v3 hw channel interrupt processingXiang Chen
The channel interrupt is to process all the interrupts except PHY UP/DOWN and broadcast interrupt. So we need to clear all the interrupts except those 3 interrupts after processing channel interrupts. 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>