Commit graph

692686 commits

Author SHA1 Message Date
Shivasharan S 2d2c233167 scsi: megaraid_sas: modified few prints in OCR and IOC INIT path
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-24 22:29:16 -04:00
Shivasharan S ba1477aa70 scsi: megaraid_sas: replace internal FALSE/TRUE definitions with false/true
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-24 22:29:15 -04:00
Shivasharan S eb3fe263a4 scsi: megaraid_sas: Return pended IOCTLs with cmd_status MFI_STAT_WRONG_STATE in case adapter is dead
After a kill adapter, since the cmd_status is not set, the IOCTLs will
be hung in driver resulting in application hang.  Set cmd_status
MFI_STAT_WRONG_STATE when completing pended IOCTLs.

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-24 22:29:14 -04:00
Shivasharan S def3e8dfe9 scsi: megaraid_sas: use vmalloc for crash dump buffers and driver's local RAID map
Driver's local RAID map is accessed frequently. We will first try to get
memory from __get_free_pages. If this fails, fall back to using vmalloc.
For crash dump buffers always prefer vmalloc.

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-24 22:29:14 -04:00
Shivasharan S 28661c885c scsi: megaraid_sas: Use SMID for Task abort case only
In TM code, smid_task is valid only in case of task aborts.

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-24 22:29:13 -04:00
Shivasharan S 91b3d9f006 scsi: megaraid_sas: Check valid aen class range to avoid kernel panic
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-24 22:29:13 -04:00
Shivasharan S 8823abeddb scsi: megaraid_sas: Fix endianness issues in DCMD handling
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-24 22:29:12 -04:00
Shivasharan S 690e9c3885 scsi: megaraid_sas: Do not re-fire shutdown DCMD after OCR
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-24 22:29:12 -04:00
Shivasharan S 14298cf320 scsi: megaraid_sas: Call megasas_complete_cmd_dpc_fusion every 1 second 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-24 22:29:11 -04:00
Shivasharan S bdb5c55fff scsi: megaraid_sas: Use synchronize_irq in target reset case
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-24 22:29:11 -04:00
Shivasharan S e636a7a430 scsi: megaraid_sas: set minimum value of resetwaittime to be 1 secs
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-24 22:29:10 -04:00
Shivasharan S ed2983f458 scsi: megaraid_sas: mismatch of allocated MFI frame size and length exposed 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-24 22:29:10 -04:00
Gustavo A. R. Silva 44ed33e6c5 scsi: lpfc: remove useless code in lpfc_sli4_bsg_link_diag_test
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-24 22:29:09 -04:00
Todd Poynor 6a8dadcca8 scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE
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-24 22:29:09 -04:00
Todd Poynor 8d26f49111 scsi: sg: recheck MMAP_IO request length with lock held
Commit 1bc0eb0446 ("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-24 22:29:08 -04:00
Dan Carpenter 55e1f9f088 scsi: hpsa: fix the device_id in hpsa_update_device_info()
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-24 22:29:08 -04:00
Arvind Yadav 78453a31d5 scsi: aha1542: constify pnp_device_id
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-24 22:29:07 -04:00
weiping zhang 92227b8d3d scsi: scsi-sysfs: Adjust error returned for adapter reset request
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-24 22:29:06 -04:00
Hannes Reinecke 085e56766f scsi: ch: add refcounting
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-24 22:29:06 -04:00
Gustavo A. R. Silva db269932b9 scsi: pmcraid: fix duplicated code for different branches
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-24 22:29:05 -04:00
Arvind Yadav 60747936bd scsi: ncr5380: constify pnp_device_id
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-24 22:29:05 -04:00
Chad Dupuis b7fa2cbda5 scsi: qedf: Update driver version to 8.20.5.0.
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-24 22:29:04 -04:00
Chad Dupuis 0516abdf2d scsi: qedf: Fix up modinfo parameter name for 'debug' in modinfo output.
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-24 22:29:04 -04:00
Chad Dupuis 428ca6423e scsi: qedf: Covert single-threaded workqueues to regular workqueues.
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-24 22:29:03 -04:00
Chad Dupuis cf29116375 scsi: qedf: Corrent VLAN tag insertion in fallback VLAN case.
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-24 22:29:03 -04:00
Chad Dupuis a3cd42a9d6 scsi: qedf: Use granted MAC from the FCF for the FCoE source address if it 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-24 22:29:02 -04:00
Chad Dupuis 01fd76a765 scsi: qedf: Set WWNN and WWPN based on values from qed.
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-24 22:29:02 -04:00
Colin Ian King b4a028a570 scsi: qla2xxx: fix spelling mistake of variable sfp_additonal_info
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-24 22:29:01 -04:00
Dan Carpenter 59e3da5870 scsi: osst: silence underflow warning in osst_verify_frame()
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-24 22:29:01 -04:00
Colin Ian King 32690e0b56 scsi: osst: add missing indent on a for loop statement
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-24 22:29:00 -04:00
Colin Ian King bbaf61e2e9 scsi: mpt3sas: fix pr_info message continuation
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-24 22:28:59 -04:00
Hannes Reinecke dc56ce12d5 scsi: ses: make page2 support optional
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-24 22:28:59 -04:00
Hannes Reinecke 81b59d7565 scsi: ses: Fixup error message 'failed to get diagnostic page 0xffffffea'
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-24 22:28:58 -04:00
Hannes Reinecke acf8ab9a85 scsi: ses: check return code from ses_recv_diag()
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-24 22:28:58 -04:00
Hannes Reinecke c8cd71f1f3 scsi: hpsa: Remove 'hpsa_allow_any' module option
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-24 22:28:57 -04:00
Hannes Reinecke 253d2464df scsi: cciss: Drop obsolete driver
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-24 22:28:57 -04:00
Hannes Reinecke 45f769b2f8 scsi: hpsa: do not print errors for unsupported report luns format
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-24 22:28:56 -04:00
Hannes Reinecke 65e8697ee6 scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page
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-24 22:28:56 -04:00
Hannes Reinecke 4d17944a47 scsi: hpsa: disable volume status check for legacy boards
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-24 22:28:55 -04:00
Hannes Reinecke 135ae6edeb scsi: hpsa: add support for legacy boards
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-24 22:28:55 -04:00
Christophe JAILLET 9ff870417e scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'
'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-24 22:28:54 -04:00
Helge Deller c0e8ed04b3 scsi: sym53c8xx: Avoid undefined behaviour
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-24 22:28:54 -04:00
Hannes Reinecke 8a97712e53 scsi: make 'state' device attribute pollable
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-24 22:28:53 -04:00
Hannes Reinecke 8cd1ec78ca scsi: scsi_lib: rework scsi_internal_device_unblock_nowait()
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-24 22:28:53 -04:00
Arvind Yadav fe083323bb scsi: esas2r: constify pci_device_id.
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-24 22:28:52 -04:00
Richard W.M. Jones 582b0ab200 scsi: virtio: virtio_scsi: Set can_queue to the length of the virtqueue.
Since switching to blk-mq as the default in commit 5c279bd9e4
("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-24 22:28:51 -04:00
Richard W.M. Jones 44ed8089e9 scsi: virtio: Reduce BUG if total_sg > virtqueue size to WARN.
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-24 22:28:51 -04:00
Manish Rangankar 42d7c10f23 scsi: qedi: Limit number for CQ queues.
[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-24 22:28:50 -04:00
John Garry 30b67de31b scsi: hisi_sas: remove driver versioning
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-24 22:28:50 -04:00
John Garry 76aae5f60b scsi: hisi_sas: replace kfree with scsi_host_put
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-24 22:28:49 -04:00