Steffen Maier [Thu, 12 Mar 2020 17:44:59 +0000 (18:44 +0100)]
scsi: zfcp: fix fc_host attributes that should be unknown on local link down
When we get an unsolicited notification on local link went down,
zfcp_fsf_status_read_link_down() calls zfcp_fsf_link_down_info_eval().
This only blocks rports, and sets ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED and
ZFCP_STATUS_COMMON_ERP_FAILED. Only the fc_host port_state changes to
"Linkdown", because zfcp_scsi_get_host_port_state() is an active callback
and uses the adapter status.
Other fc_host attributes model, port_id, port_type, speed, fabric_name (and
zfcp device attributes card_version, peer_wwpn, peer_wwnn, peer_d_id) which
depend on a local link, continued to show their last known "good" value.
Only if something triggered an exchange config data, some values were
updated to their unknown equivalent via case
FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE due to local link down. Triggers for
exchange config data are adapter recovery, or reading any of the following
zfcp-specific scsi host sysfs attributes "requests", "megabytes", or
"seconds_active" in /sys/devices/css*/*.*.*/*.*.*/host*/scsi_host/host*/.
The other fc_host attributes active_fc4s and permanent_port_name continued
to show their last known "good" value. Only if something triggered an
exchange port data, some values changed. Active_fc4s became all zeros as
unknown equivalent during link down. Permanent_port_name does not depend
on a local link. But for non-NPIV FCP devices, permanent_port_name
erroneously became whatever value fc_host port_name had at that point in
time (see previous paragraph). Triggers for exchange port data are the
zfcp-specific scsi host sysfs attribute "utilization", or
[{reset,get}_fc_host_stats] write anything into "reset_statistics" or read
any of the other attributes under
/sys/devices/css*/*.*.*/*.*.*/host*/fc_host/host*/statistics/.
(cf. v4.9 commit
bd77befa5bcf ("zfcp: fix fc_host port_type with NPIV"))
This is particularly confusing when using "lszfcp -b <fcpdevbusid> -Ha" or
dbginfo.sh which read fc_host attributes and also scsi_host attributes.
After link down, the first invocation produces (abbreviated):
Class = "fc_host"
active_fc4s = "0x00 0x00 0x01 0x00 ..."
...
fabric_name = "0x10000027f8e04c49"
...
permanent_port_name = "0xc05076e4588059c1"
port_id = "0x244800"
port_state = "Linkdown"
port_type = "NPort (fabric via point-to-point)"
...
speed = "16 Gbit"
Class = "scsi_host"
...
megabytes = "0 0"
...
requests = "0 0 0"
seconds_active = "37"
...
utilization = "0 0 0"
The second and next invocations produce (abbreviated):
Class = "fc_host"
active_fc4s = "0x00 0x00 0x00 0x00 ..."
...
fabric_name = "0x0"
...
permanent_port_name = "0x0"
port_id = "0x000000"
port_state = "Linkdown"
port_type = "Unknown"
...
speed = "unknown"
Class = "scsi_host"
...
megabytes = "0 0"
...
requests = "0 0 0"
seconds_active = "38"
...
utilization = "0 0 0"
Factor out the resetting of local link dependent fc_host attributes from
zfcp_fsf_exchange_config_data_handler() case
FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE into a new helper function
zfcp_fsf_fc_host_link_down(). All code places that detect local link down
(SRB, FSF_PROT_LINK_DOWN, xconf data/port incomplete) call
zfcp_fsf_link_down_info_eval(). Call the new helper from there. This works
because zfcp_fsf_link_down_info_eval() and thus the helper is called before
zfcp_fsf_exchange_{config,port}_evaluate().
Port_name and node_name are always valid, so never reset them.
Get the permanent_port_name from exchange port data unconditionally as it
always has a valid known good value, even during link down.
Note: Rather than hardcode in zfcp_fsf_exchange_config_evaluate(), fc_host
supported_classes could theoretically get its value from
fsf_qtcb_bottom_port.class_of_service in zfcp_fsf_exchange_port_evaluate().
When the link comes back, we get a different notification, perform adapter
recovery, and this triggers an implicit exchange config data followed by
exchange port data filling in the link dependent fc_host attributes with
known good values again.
Link: https://lore.kernel.org/r/20200312174505.51294-5-maier@linux.ibm.com
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Steffen Maier [Thu, 12 Mar 2020 17:44:58 +0000 (18:44 +0100)]
scsi: zfcp: wire previously driver-specific sysfs attributes also to fc_host
Manufacturer, HBA model, firmware version, and hardware version. Use the
same value format as for the driver-specific attributes. Keep the
driver-specific attributes for stable user space sysfs API.
Link: https://lore.kernel.org/r/20200312174505.51294-4-maier@linux.ibm.com
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Steffen Maier [Thu, 12 Mar 2020 17:44:57 +0000 (18:44 +0100)]
scsi: zfcp: expose fabric name as common fc_host sysfs attribute
FICON Express8S or older, as well as card features newer than FICON
Express16S+ have no certain firmware level requirement.
FICON Express16S or FICON Express16S+ have the following
minimum firmware level requirements to show a proper fabric name value:
z13 machine
FICON Express16S , MCL P08424.005 , LIC version 0x00000721
z14 machine
FICON Express16S , MCL P42611.008 , LIC version 0x10200069
FICON Express16S+ , MCL P42625.010 , LIC version 0x10300147
Otherwise, the read value is not the fabric name.
Each FCP channel of these card features might need one SAN fabric re-login
after concurrent microcode update in order to show the proper fabric name.
Possible ways to trigger a SAN fabric re-login are one of: Pull fibres
between FCP channel port and SAN switch port on either side and re-plug,
disable SAN switch port adjacent to FCP channel port and re-enable switch
port, or at Service Element toggle off all CHPIDs of FCP channel over all
LPARs and toggle CHPIDs on again. Zfcp operating subchannels (FCP devices)
on such FCP channel recovers a fabric re-login.
Initialize fabric name for any topology and have it an invalid WWPN 0x0 for
anything but fabric topology. Otherwise for e.g. point-to-point topology
one could see the initial -1 from fc_host_setup() and after a link unplug
our fabric name would turn to 0x0 (with subsequent commit ("zfcp: fix
fc_host attributes that should be unknown on local link down") and stay 0x0
on link replug. I did not initialize to 0x0 somewhere even earlier in the
code path such that it would not flap from real to 0x0 to real on e.g. an
exchange config data with fabric topology.
Link: https://lore.kernel.org/r/20200312174505.51294-3-maier@linux.ibm.com
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Steffen Maier [Thu, 12 Mar 2020 17:44:56 +0000 (18:44 +0100)]
scsi: zfcp: fix missing erp_lock in port recovery trigger for point-to-point
v2.6.27 commit
cc8c282963bd ("[SCSI] zfcp: Automatically attach remote
ports") introduced zfcp automatic port scan.
Before that, the user had to use the sysfs attribute "port_add" of an FCP
device (adapter) to add and open remote (target) ports, even for the remote
peer port in point-to-point topology. That code path did a proper port open
recovery trigger taking the erp_lock.
Since above commit, a new helper function zfcp_erp_open_ptp_port()
performed an UNlocked port open recovery trigger. This can race with other
parallel recovery triggers. In zfcp_erp_action_enqueue() this could corrupt
e.g. adapter->erp_total_count or adapter->erp_ready_head.
As already found for fabric topology in v4.17 commit
fa89adba1941 ("scsi:
zfcp: fix infinite iteration on ERP ready list"), there was an endless loop
during tracing of rport (un)block. A subsequent v4.18 commit
9e156c54ace3
("scsi: zfcp: assert that the ERP lock is held when tracing a recovery
trigger") introduced a lockdep assertion for that case.
As a side effect, that lockdep assertion now uncovered the unlocked code
path for PtP. It is from within an adapter ERP action:
zfcp_erp_strategy[1479] intentionally DROPs erp lock around
zfcp_erp_strategy_do_action()
zfcp_erp_strategy_do_action[1441] NO erp lock
zfcp_erp_adapter_strategy[876] NO erp lock
zfcp_erp_adapter_strategy_open[855] NO erp lock
zfcp_erp_adapter_strategy_open_fsf[806]NO erp lock
zfcp_erp_adapter_strat_fsf_xconf[772] erp lock only around
zfcp_erp_action_to_running(),
BUT *_not_* around
zfcp_erp_enqueue_ptp_port()
zfcp_erp_enqueue_ptp_port[728] BUG: *_not_* taking erp lock
_zfcp_erp_port_reopen[432] assumes to be called with erp lock
zfcp_erp_action_enqueue[314] assumes to be called with erp lock
zfcp_dbf_rec_trig[288] _checks_ to be called with erp lock:
lockdep_assert_held(&adapter->erp_lock);
It causes the following lockdep warning:
WARNING: CPU: 2 PID: 775 at drivers/s390/scsi/zfcp_dbf.c:288
zfcp_dbf_rec_trig+0x16a/0x188
no locks held by zfcperp0.0.17c0/775.
Fix this by using the proper locked recovery trigger helper function.
Link: https://lore.kernel.org/r/20200312174505.51294-2-maier@linux.ibm.com
Fixes:
cc8c282963bd ("[SCSI] zfcp: Automatically attach remote ports")
Cc: <stable@vger.kernel.org> #v2.6.27+
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 13 Mar 2020 20:31:02 +0000 (13:31 -0700)]
scsi: scsi_trace: Use get_unaligned_be24()
This makes the SCSI tracing code slightly easier to read.
Link: https://lore.kernel.org/r/20200313203102.16613-6-bvanassche@acm.org
Fixes:
bf8162354233 ("[SCSI] add scsi trace core functions and put trace points")
Cc: Christoph Hellwig <hch@lst.de>
Cc: James E.J. Bottomley <jejb@linux.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 13 Mar 2020 20:31:01 +0000 (13:31 -0700)]
scsi: st: Use get_unaligned_be24() and sign_extend32()
Use these functions instead of open-coding them.
Link: https://lore.kernel.org/r/20200313203102.16613-5-bvanassche@acm.org
Cc: Kai Makisara <Kai.Makisara@kolumbus.fi>
Cc: James E.J. Bottomley <jejb@linux.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 13 Mar 2020 20:31:00 +0000 (13:31 -0700)]
scsi: treewide: Consolidate {get,put}_unaligned_[bl]e24() definitions
Move the get_unaligned_be24(), get_unaligned_le24() and
put_unaligned_le24() definitions from various drivers into
include/linux/unaligned/generic.h. Add a put_unaligned_be24()
implementation.
Link: https://lore.kernel.org/r/20200313203102.16613-4-bvanassche@acm.org
Cc: Keith Busch <kbusch@kernel.org>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Jens Axboe <axboe@fb.com>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # For drivers/usb
Reviewed-by: Felipe Balbi <balbi@kernel.org> # For drivers/usb/gadget
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 13 Mar 2020 20:30:59 +0000 (13:30 -0700)]
scsi: c6x: Include <linux/unaligned/generic.h> instead of duplicating it
Use the generic __{get,put}_unaligned_[bl]e() definitions instead of
duplicating these. Since a later patch will add more definitions into
<linux/unaligned/generic.h>, this patch ensures that these definitions have
to be added only once. See also commit
a7f626c1948a ("C6X: headers"). See
also commit
6510d41954dc ("kernel: Move arches to use common unaligned
access").
Link: https://lore.kernel.org/r/20200313203102.16613-3-bvanassche@acm.org
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 13 Mar 2020 20:30:58 +0000 (13:30 -0700)]
scsi: linux/unaligned/byteshift.h: Remove superfluous casts
The C language supports implicitly casting a void pointer into a non-void
pointer. Remove explicit void pointer to non-void pointer casts because
these are superfluous.
Link: https://lore.kernel.org/r/20200313203102.16613-2-bvanassche@acm.org
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ryan Attard [Wed, 26 Feb 2020 17:05:19 +0000 (11:05 -0600)]
scsi: core: Allow non-root users to perform ZBC commands
Allow users with read permissions to issue REPORT ZONE commands and users
with write permissions to manage zones on block devices supporting the ZBC
specification.
Link: https://lore.kernel.org/r/20200226170518.92963-2-ryanattard@ryanattard.info
Signed-off-by: Ryan Attard <ryanattard@ryanattard.info>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Luo Jiaxing [Wed, 11 Mar 2020 15:22:24 +0000 (23:22 +0800)]
scsi: hisi_sas: Use dev_err() in read_iost_itct_cache_v3_hw()
The print of pr_err() does not come with device information, so replace it
with dev_err(). Also improve the grammar in the message.
Link: https://lore.kernel.org/r/1583940144-230800-1-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>
Ewan D. Milne [Wed, 11 Mar 2020 14:39:30 +0000 (10:39 -0400)]
scsi: core: avoid repetitive logging of device offline messages
Large queues of I/O to offline devices that are eventually submitted when
devices are unblocked result in a many repeated "rejecting I/O to offline
device" messages. These messages can fill up the dmesg buffer in crash
dumps so no useful prior messages remain. In addition, if a serial console
is used, the flood of messages can cause a hard lockup in the console code.
Introduce a flag indicating the message has already been logged for the
device, and reset the flag when scsi_device_set_state() changes the device
state.
Link: https://lore.kernel.org/r/20200311143930.20674-1-emilne@redhat.com
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:15 +0000 (09:16 +0100)]
scsi: docs: convert arcmsr_spec.txt to ReST
This file had its own peculiar style, not following any other
files inside the Kernel (as far as I saw).
Had to do a number of changes here, starting by removing the two
leading asterisks from each line, adding table and literal
block markups and changing whitespace and blank lines.
The end result is that (IMHO), it is now a lot easier to read
it as a text file, while producing a good html output.
Link: https://lore.kernel.org/r/6f8e4da4ea643adbe048f55504a59427c5e50c97.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:14 +0000 (09:16 +0100)]
scsi: docs: convert wd719x.txt to ReST
Link: https://lore.kernel.org/r/23e5b13d810b7dd8126b126173999c02eac50e74.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:13 +0000 (09:16 +0100)]
scsi: docs: convert ufs.txt to ReST
Link: https://lore.kernel.org/r/052d45576e342a217185e91a83793b384b1592a4.1583136624.git.mchehab+huawei@kernel.org
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:12 +0000 (09:16 +0100)]
scsi: docs: convert tcm_qla2xxx.txt to ReST
Link: https://lore.kernel.org/r/de73fa02f38f67f54f22ef2842f9680c0b34434a.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:11 +0000 (09:16 +0100)]
scsi: docs: convert sym53c8xx_2.txt to ReST
Link: https://lore.kernel.org/r/08202c87294d61d147ec4ac784219d20805cdeb5.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:10 +0000 (09:16 +0100)]
scsi: docs: convert sym53c500_cs.txt to ReST
Link: https://lore.kernel.org/r/eff6166b3442ddb37b934bca46e7f9ef25ebc2a4.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:09 +0000 (09:16 +0100)]
scsi: docs: convert st.txt to ReST
Link: https://lore.kernel.org/r/6b2ddb36983e81e7028de6e5fd0c643c2fb4c6c9.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:08 +0000 (09:16 +0100)]
scsi: docs: convert smartpqi.txt to ReST
Link: https://lore.kernel.org/r/00b398efb7cfc667b046fbef92a84f1d3c33eb64.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:07 +0000 (09:16 +0100)]
scsi: docs: convert sd-parameters.txt to ReST
Link: https://lore.kernel.org/r/8d0b75b0faf13a2e81373570d6ce601b629fb22a.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:06 +0000 (09:16 +0100)]
scsi: docs: convert scsi.txt to ReST
Link: https://lore.kernel.org/r/c617b37769a82901def0fed3d236a25995c4e160.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:05 +0000 (09:16 +0100)]
scsi: docs: convert scsi-parameters.txt to ReST
Link: https://lore.kernel.org/r/f00a5f6f2bf9a2562e0856ee8f45bcf9521d181f.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:04 +0000 (09:16 +0100)]
scsi: docs: convert scsi_mid_low_api.txt to ReST
Link: https://lore.kernel.org/r/881e7741dfed5d6f5f73e1dfc2826b200b8604aa.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:03 +0000 (09:16 +0100)]
scsi: docs: convert scsi-generic.txt to ReST
Link: https://lore.kernel.org/r/f57b8ddf30397c2c7213e49634e5e9cbd4246368.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:02 +0000 (09:16 +0100)]
scsi: docs: convert scsi_fc_transport.txt to ReST
Link: https://lore.kernel.org/r/f75bd9b6512f223847cc4ece8bd7e8e72e434b21.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:01 +0000 (09:16 +0100)]
scsi: docs: convert scsi_eh.txt to ReST
Link: https://lore.kernel.org/r/300314197f2e6a3258200711e825aa04c9e8ceaf.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:16:00 +0000 (09:16 +0100)]
scsi: docs: convert scsi-changer.txt to ReST
Link: https://lore.kernel.org/r/433d073fa982174a19783c2e59412b724e2cf946.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:59 +0000 (09:15 +0100)]
scsi: docs: convert qlogicfas.txt to ReST
Link: https://lore.kernel.org/r/b69f795c781811b9a908abe43485f1dca0ee8ac5.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:58 +0000 (09:15 +0100)]
scsi: docs: convert ppa.txt to ReST
Link: https://lore.kernel.org/r/3db8cd51d77fef6b66632249412969caa29dec40.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:57 +0000 (09:15 +0100)]
scsi: docs: convert NinjaSCSI.txt to ReST
Link: https://lore.kernel.org/r/6385a411d000dad005b78647629e43700580ecf0.1583136624.git.mchehab+huawei@kernel.org
Acked-by: GOTO Masanori <gotom@debian.or.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:56 +0000 (09:15 +0100)]
scsi: docs: convert ncr53c8xx.txt to ReST
Link: https://lore.kernel.org/r/cover.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:55 +0000 (09:15 +0100)]
scsi: docs: convert megaraid.txt to ReST
Link: https://lore.kernel.org/r/b7ee59230c5a33ff6d60edba0d0bcf3e2aeaa88f.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:54 +0000 (09:15 +0100)]
scsi: docs: convert lpfc.txt to ReST
Link: https://lore.kernel.org/r/48c13184b77ba61ed4fd7c235816fdb8e7530664.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:53 +0000 (09:15 +0100)]
scsi: docs: convert link_power_management_policy.txt to ReST
Link: https://lore.kernel.org/r/c56177fdf046d80e0dec6031c4139cb4e8c39d31.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:52 +0000 (09:15 +0100)]
scsi: docs: convert libsas.txt to ReST
Link: https://lore.kernel.org/r/9022cb5551487f774cab16a828fe06b0b6b3add3.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:51 +0000 (09:15 +0100)]
scsi: docs: convert hptiop.txt to ReST
Link: https://lore.kernel.org/r/d189a339bb360b7b397914ee3ddeb75d9a7fd788.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:50 +0000 (09:15 +0100)]
scsi: docs: convert hpsa.txt to ReST
Link: https://lore.kernel.org/r/ea58e04176d43fb7194615b145060aa04c9cf3ad.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:49 +0000 (09:15 +0100)]
scsi: docs: convert g_NCR5380.txt to ReST
Link: https://lore.kernel.org/r/a66e9ea704be6a7aa81b9864ad66a32b75ab808d.1583136624.git.mchehab+huawei@kernel.org
Acked-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:48 +0000 (09:15 +0100)]
scsi: docs: convert FlashPoint.txt to ReST
Link: https://lore.kernel.org/r/e755b9644047eed6be69fcc77eb797f0801fcb99.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:47 +0000 (09:15 +0100)]
scsi: docs: convert dpti.txt to ReST
Link: https://lore.kernel.org/r/212fd7961c134c5bd73d87cd818bcddc30270804.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:46 +0000 (09:15 +0100)]
scsi: docs: convert dc395x.txt to ReST
Link: https://lore.kernel.org/r/3c0876df0045695185f922a0404c497a69de36a9.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:45 +0000 (09:15 +0100)]
scsi: docs: convert cxgb3i.txt to ReST
Link: https://lore.kernel.org/r/0708b62b6ec4f0dddc581e412bb02ba6476f4523.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:44 +0000 (09:15 +0100)]
scsi: docs: convert BusLogic.txt to ReST
Link: https://lore.kernel.org/r/750629b6a5233c85c5391c44d126606b8aabefc8.1583136624.git.mchehab+huawei@kernel.org
Acked-by: Khalid Aziz <khalid@gonehiking.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:43 +0000 (09:15 +0100)]
scsi: docs: convert bnx2fc.txt to ReST
Link: https://lore.kernel.org/r/f239116bd2c36f6fc8deb62e325bb8161da04270.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:42 +0000 (09:15 +0100)]
scsi: docs: convert bfa.txt to ReST
Link: https://lore.kernel.org/r/6660d0f83ddae2ab8efb31c39f9c220fc132e9d4.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:41 +0000 (09:15 +0100)]
scsi: docs: convert aic7xxx.txt to ReST
Link: https://lore.kernel.org/r/dc2b1ffe4bf64cfc4b32328740704a30e8d38a79.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:40 +0000 (09:15 +0100)]
scsi: docs: convert aic79xx.txt to ReST
Link: https://lore.kernel.org/r/e8a40337a2173f028c9ac569d3d71fd880f4fab5.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:39 +0000 (09:15 +0100)]
scsi: docs: convert aha152x.txt to ReST
Link: https://lore.kernel.org/r/097cfcc7f25343676a1fedcefed7e3b91b41b4df.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:38 +0000 (09:15 +0100)]
scsi: docs: convert advansys.txt to ReST
Link: https://lore.kernel.org/r/3c697a046e641c81cdfd0784f037d41d54766931.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:37 +0000 (09:15 +0100)]
scsi: docs: convert aacraid.txt to ReST
Link: https://lore.kernel.org/r/67c60ad88777c91937d49771e2a3f48cbf353e4c.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:36 +0000 (09:15 +0100)]
scsi: docs: convert 53c700.txt to ReST
Link: https://lore.kernel.org/r/a2e5116b70564f36b4fc7f1f1e5da1e693d7dadb.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:35 +0000 (09:15 +0100)]
scsi: docs: include SCSI Transport SRP diagram at the doc body
Instead of having a separate makefile, and be alone, group
it at the SCSI documentation and make it being built as part
of docs makefile.
Link: https://lore.kernel.org/r/419c455fb40c9a1e85cc9a654a7fdb07aeeccf71.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mauro Carvalho Chehab [Mon, 2 Mar 2020 08:15:34 +0000 (09:15 +0100)]
scsi: docs: Add an empty index file for SCSI documents
In preparation for adding the SCSI documents to the documentation
body, add an empty index for it.
The next patches should be adding contents to it, as files get
converted to ReST format.
Link: https://lore.kernel.org/r/4d8c1b7ebe5898ac4a8265ca5e5a9552da3b426f.1583136624.git.mchehab+huawei@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Rajan Shanmugavelu [Thu, 13 Feb 2020 01:29:28 +0000 (17:29 -0800)]
scsi: qla2xxx: add ring buffer for tracing debug logs
Having this log in a ring buffer helps to diagnose qla2xxx driver and
firmware issues instead of having to reproduce the problem with
extended_logging enabled. This saves cycles and helps when it is hard
to reproduce problem.
Link: https://lore.kernel.org/r/1581557368-32080-1-git-send-email-rajan.shanmugavelu@oracle.com
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Rajan Shanmugavelu <rajan.shanmugavelu@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Phong Tran [Mon, 9 Mar 2020 15:53:19 +0000 (22:53 +0700)]
scsi: aacraid: clean up warning cast-function-type
Make the aacraid driver -Wcast-function-type clean
Report by: https://github.com/KSPP/linux/issues/20
drivers/scsi/aacraid/aachba.c:813:23:
warning: cast between incompatible function types from
'int (*)(struct scsi_cmnd *)' to 'void (*)(struct scsi_cmnd *)'
[-Wcast-function-type]
Link: https://lore.kernel.org/r/20200309155319.12658-1-tranmanphong@gmail.com
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stanley Chu [Mon, 2 Mar 2020 13:53:46 +0000 (21:53 +0800)]
scsi: ufs-mediatek: fix HOST_PA_TACTIVATE quirk for Samsung UFS Devices
Device quirk "UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE" is enabled for all
Samsung devices by default currently.
However MediaTek UFS host requires different host PA_TACTIVATE
configuration. Hence clear this quirk first and then apply vendor-specific
value in vops callback.
Link: https://lore.kernel.org/r/20200302135346.16797-1-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Brian King [Mon, 2 Mar 2020 14:39:21 +0000 (08:39 -0600)]
scsi: ibmvfc: Fix NULL return compiler warning
Fix up a compiler warning introduced via
54b04c99d02e
Link: https://lore.kernel.org/r/1583159961-15903-1-git-send-email-brking@linux.vnet.ibm.com
Fixes:
54b04c99d02e ("scsi: ibmvfc: Avoid loss of all paths during SVC node reboot")
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Randy Dunlap [Sun, 8 Mar 2020 05:01:15 +0000 (21:01 -0800)]
scsi: fusion: fix if-statement empty body warning
When driver debugging is not enabled, change the debug print macros
to use the no_printk() macro.
This fixes a gcc warning when -Wextra is set:
../drivers/message/fusion/mptlan.c:266:39: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
I have verified that there is very little object code change (with
gcc 7.5.0). There are a few changes like:
cmp %a,%b
jl $1
to
cmp %b,%a
jg $1
Link: https://lore.kernel.org/r/ff9df31b-c4c1-c942-1cbf-18039e084c8e@infradead.org
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Frank Mayhar [Thu, 27 Feb 2020 19:59:45 +0000 (14:59 -0500)]
scsi: iscsi: Add support for asynchronous iSCSI session destruction
iSCSI session destruction can be arbitrarily slow, since it might require
network operations and serialization inside the SCSI layer. This patch
adds a new user event to trigger the destruction work asynchronously,
releasing the rx_queue_mutex as soon as the operation is queued and before
it is performed. This change allows other operations to run in other
sessions in the meantime, removing one of the major iSCSI bottlenecks for
us.
To prevent the session from being used after the destruction request, we
remove it immediately from the sesslist. This simplifies the locking
required during the asynchronous removal.
Link: https://lore.kernel.org/r/20200227195945.761719-1-krisman@collabora.com
Co-developed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Co-developed-by: Khazhismel Kumykov <khazhy@google.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sagar Biradar [Thu, 13 Feb 2020 00:29:31 +0000 (16:29 -0800)]
scsi: aacraid: Disabling TM path and only processing IOP reset
Fixes the occasional adapter panic when sg_reset is issued with -d, -t, -b
and -H flags. Removal of command type HBA_IU_TYPE_SCSI_TM_REQ in
aac_hba_send since iu_type, request_id and fib_flags are not populated.
Device and target reset handlers are made to send TMF commands only when
reset_state is 0.
Link: https://lore.kernel.org/r/1581553771-25796-1-git-send-email-Sagar.Biradar@microchip.com
Reviewed-by: Sagar Biradar <Sagar.Biradar@microchip.com>
Signed-off-by: Sagar Biradar <Sagar.Biradar@microchip.com>
Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Brian King [Thu, 27 Feb 2020 01:45:43 +0000 (19:45 -0600)]
scsi: ibmvfc: Avoid loss of all paths during SVC node reboot
When an SVC node goes down as part of a node reboot, its WWPNs are moved to
the remaining node. When the node is back online, its WWPNs are moved
back. The result is that the WWPN moves from one NPort_ID to another, then
back again. The ibmvfc driver was forcing the old port to be removed, but
not sending an implicit logout. When the WWPN showed up at the new
location, the PLOGI failed as there was already a login established for the
old scsi id. The patch below fixes this by ensuring we always send an
implicit logout for any scsi id associated with an rport prior to calling
fc_remote_port_delete.
Link: https://lore.kernel.org/r/1582767943-16611-1-git-send-email-brking@linux.vnet.ibm.com
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Gustavo A. R. Silva [Mon, 24 Feb 2020 16:14:06 +0000 (10:14 -0600)]
scsi: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language extension
to the C90 standard, but the preferred mechanism to declare variable-length
types such as these ones is a flexible array member[1][2], introduced in
C99:
struct foo {
int stuff;
struct boo array[];
};
By making use of the mechanism above, we will get a compiler warning in
case the flexible array does not occur last in the structure, which will
help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.
Also, notice that, dynamic memory allocations won't be affected by this
change:
"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]
This issue was found with the help of Coccinelle.
[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit
76497732932f ("cxgb3/l2t: Fix undefined behaviour")
Link: https://lore.kernel.org/r/20200224161406.GA21454@embeddedor
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Thu, 23 Jan 2020 03:56:36 +0000 (19:56 -0800)]
scsi: ufs: Simplify two tests
lrbp->cmd is set only for SCSI commands. Use this knowledge to simplify two
boolean expressions.
Link: https://lore.kernel.org/r/20200123035637.21848-4-bvanassche@acm.org
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Can Guo <cang@codeaurora.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Thu, 23 Jan 2020 03:56:35 +0000 (19:56 -0800)]
scsi: ufs: Introduce ufshcd_init_lrb()
This patch does not change any functionality but makes the next patch in
this series easier to read.
Link: https://lore.kernel.org/r/20200123035637.21848-3-bvanassche@acm.org
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Can Guo <cang@codeaurora.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Thu, 23 Jan 2020 03:56:34 +0000 (19:56 -0800)]
scsi: core: Introduce {init,exit}_cmd_priv()
The current behavior of the SCSI core is to clear driver-private data
before preparing a request for submission to the SCSI LLD. Make it possible
for SCSI LLDs to disable clearing of driver-private data.
These hooks will be used by a later patch, namely "scsi: ufs: Let the SCSI
core allocate per-command UFS data".
Link: https://lore.kernel.org/r/20200123035637.21848-2-bvanassche@acm.org
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Johannes Thumshirn <jth@kernel.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:18 +0000 (08:53 +0100)]
scsi: core: Remove cmd_list functionality
Remove cmd_list functionality; no users left. With that the
scsi_put_command() becomes empty, so remove that one, too.
Link: https://lore.kernel.org/r/20200228075318.91255-14-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:17 +0000 (08:53 +0100)]
scsi: aacraid: use scsi_host_busy_iter() in get_num_of_incomplete_fibs()
Use the SCSI midlayer helper to traverse the number of outstanding
commands. This also eliminates the last usage for the cmd_list
functionality so we can drop it.
Link: https://lore.kernel.org/r/20200228075318.91255-13-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P <balsundar.p@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:16 +0000 (08:53 +0100)]
scsi: aacraid: use scsi_host_busy_iter() to wait for outstanding commands
Instead of traversing the list of possible commands by hands we should be
using scsi_host_busy_iter() to figure out if there are outstanding
commands.
Link: https://lore.kernel.org/r/20200228075318.91255-12-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:15 +0000 (08:53 +0100)]
scsi: core: add scsi_host_busy_iter()
Add an iterator scsi_host_busy_iter() to traverse all busy commands. If
locking against concurrent command completions is required, it has to be
provided by the caller.
Link: https://lore.kernel.org/r/20200228075318.91255-11-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:14 +0000 (08:53 +0100)]
scsi: aacraid: use scsi_host_(block,unblock) to block I/O
Use scsi_host_block() and scsi_host_unblock() instead of
scsi_block_requests()/scsi_unblock_requests() to block and unblock I/O.
This has the advantage that the block layer will stop sending I/O to the
adapter instead of having the SCSI midlayer requeueing I/O internally.
Link: https://lore.kernel.org/r/20200228075318.91255-10-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:13 +0000 (08:53 +0100)]
scsi: core: add scsi_host_(block,unblock) helper function
Add helper functions to call scsi_internal_device_block()/
scsi_internal_device_unblock() for all attached devices on a SCSI host.
Link: https://lore.kernel.org/r/20200228075318.91255-9-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:12 +0000 (08:53 +0100)]
scsi: aacraid: move scsi_(block,unblock)_requests out of _aac_reset_adapter()
_aac_reset_adapter() only has one caller, and that one already calls
scsi_block_requests(). Move the calls out of _aac_reset_adapter() to avoid
calling scsi_block_requests() twice.
Link: https://lore.kernel.org/r/20200228075318.91255-8-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P < Balsundar.P@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:11 +0000 (08:53 +0100)]
scsi: aacraid: replace aac_flush_ios() with midlayer helper
Use the midlayer helper scsi_host_complete_all_commands() to flush all
outstanding commands.
Link: https://lore.kernel.org/r/20200228075318.91255-7-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Balsundar P <balsundar.p@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:10 +0000 (08:53 +0100)]
scsi: aacraid: use scsi_host_complete_all_commands() to terminate outstanding commands
Use scsi_host_complete_all_commands() to terminate all outstanding commands
and change the command result for terminated commands to the more common
'DID_RESET' instead of 'QUEUE_FULL'.
Link: https://lore.kernel.org/r/20200228075318.91255-6-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Balsundar P <balsundar.p@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:09 +0000 (08:53 +0100)]
scsi: aacraid: Do not wait for outstanding write commands on synchronize_cache
There is no need to wait for outstanding write commands on synchronize
cache; the block layer is responsible for I/O scheduling, no need to
out-guess it in the driver layer.
Link: https://lore.kernel.org/r/20200228075318.91255-5-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Balsundar P <balsundar.b@microchip.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:08 +0000 (08:53 +0100)]
scsi: dpt_i2o: use scsi_host_complete_all_commands() to abort outstanding commands
Rather than traversing all outstanding commands manually, use the
scsi_host_complete_all_commands() helper to terminate all commands during
reset. With that we can drop the cmd_list usage from the midlayer.
Link: https://lore.kernel.org/r/20200228075318.91255-4-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:07 +0000 (08:53 +0100)]
scsi: core: add scsi_host_complete_all_commands() helper
Add a helper scsi_host_complete_all_commands() to terminate all outstanding
commands on a SCSI host.
Link: https://lore.kernel.org/r/20200228075318.91255-3-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 28 Feb 2020 07:53:06 +0000 (08:53 +0100)]
scsi: dpt_i2o: rename adpt_i2o_to_scsi() to adpt_i2o_scsi_complete()
Rename the badly named function into adpt_i2o_scsi_complete(), and make it
a void function as the return value is never used. This also fixes a
potential use-after-free as the return value might be evaluated from the
command result after the command has been freed.
Link: https://lore.kernel.org/r/20200228075318.91255-2-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Guosong Su [Tue, 25 Feb 2020 10:04:11 +0000 (18:04 +0800)]
scsi: core: use kobj_to_dev
Use kobj_to_dev to instead of open-coding it.
Link: https://lore.kernel.org/r/20200225100411.10250-1-guosongsu@gmail.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Guosong Su <suguosong@xiaomi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stanley Chu [Thu, 20 Feb 2020 13:48:48 +0000 (21:48 +0800)]
scsi: ufs: ufs-mediatek: add waiting time for reference clock
Some delays may be required either after gating or before ungating
reference clock for device according to vendor requirements.
Note that in UFS 3.0, the delay time after gating reference
clock can be defined by attribute bRefClkGatingWaitTime. Use the
formal value instead if it can be queried from device.
Link: https://lore.kernel.org/r/20200220134848.8807-2-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Can Guo [Mon, 24 Feb 2020 04:09:22 +0000 (20:09 -0800)]
scsi: ufs-qcom: Apply QUIRK_HOST_TACTIVATE for WDC UFS devices
Western Digital UFS devices require host's PA_TACTIVATE to be lower than
device's PA_TACTIVATE, otherwise it may get stuck during hibern8 sequence.
Link: https://lore.kernel.org/r/1582517363-11536-3-git-send-email-cang@codeaurora.org
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Can Guo [Mon, 24 Feb 2020 04:09:21 +0000 (20:09 -0800)]
scsi: ufs: Allow vendor device quirks to be applied early
Currently ufshcd_vops_apply_dev_quirks() comes after all UniPro parameters
have been tuned. Move it up so that vendors have a chance to apply device
quirks in advance.
Link: https://lore.kernel.org/r/1582517363-11536-2-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Christoph Hellwig [Fri, 21 Feb 2020 14:08:12 +0000 (06:08 -0800)]
scsi: ufshcd: use an enum for quirks
Use an enum to specify the various quirks instead of #defines inside the
structure definition.
[mkp: fix typo]
Link: https://lore.kernel.org/r/20200221140812.476338-3-hch@lst.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Christoph Hellwig [Fri, 21 Feb 2020 14:08:11 +0000 (06:08 -0800)]
scsi: ufshcd: remove unused quirks
Remove various quirks that don't have users, as well as the dead code keyed
off them.
Link: https://lore.kernel.org/r/20200221140812.476338-2-hch@lst.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Himanshu Madhani [Wed, 26 Feb 2020 22:40:22 +0000 (14:40 -0800)]
scsi: qla2xxx: Update driver version to 10.01.00.25-k
Link: https://lore.kernel.org/r/20200226224022.24518-19-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:21 +0000 (14:40 -0800)]
scsi: qla2xxx: Set Nport ID for N2N
When transitioning from loop to N2N, stale NPort ID is not
re-assigned. Stale ID can collide with remote device. This patch will
re-assign NPort ID on N2N is detected.
Link: https://lore.kernel.org/r/20200226224022.24518-18-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arun Easi [Wed, 26 Feb 2020 22:40:20 +0000 (14:40 -0800)]
scsi: qla2xxx: Handle NVME status iocb correctly
Certain state flags bit combinations are not checked and not handled
correctly. Plus, do not log a normal underrun situation where there is
no frame drop.
Link: https://lore.kernel.org/r/20200226224022.24518-17-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:19 +0000 (14:40 -0800)]
scsi: qla2xxx: Remove restriction of FC T10-PI and FC-NVMe
T10-PI and FC-NVMe are not mutually exclusive. This patch removes
restrictions where if FC-NVMe is enabled T10-PI defaults to disabled.
Link: https://lore.kernel.org/r/20200226224022.24518-16-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:18 +0000 (14:40 -0800)]
scsi: qla2xxx: Serialize fc_port alloc in N2N
For N2N, fc_port struct is created during report id acquisition. At
later time, the loop resync (fabric, n2n, loop) would trigger the rest
of the login using the created fc_port struct. The loop resync logic
can trigger another fc_port allocation if the 1st allocation was not
able to execute. This patch prevents the 2nd allocation trigger.
Link: https://lore.kernel.org/r/20200226224022.24518-15-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:17 +0000 (14:40 -0800)]
scsi: qla2xxx: Fix NPIV instantiation after FW dump
NPIV re-enable code was blocked after FW had been initialized. The
blocking check was too broad. Reduce the check to make sure if FW is
initialized or not.
Link: https://lore.kernel.org/r/20200226224022.24518-14-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:16 +0000 (14:40 -0800)]
scsi: qla2xxx: Fix RDP respond data format
RPD information failed to display by switch cli command. This is
caused by driver failure to properly format RDP response data with
data descriptor to allow switch to parse it correctly.
Link: https://lore.kernel.org/r/20200226224022.24518-13-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:15 +0000 (14:40 -0800)]
scsi: qla2xxx: Force semaphore on flash validation failure
For single port 28XX adapter, the second core can still run in the
background. The flash semaphore can be held by the non-active core.
This patch tell MPI FW to check for this case and clear the semaphore
from the non-active core.
Link: https://lore.kernel.org/r/20200226224022.24518-12-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:14 +0000 (14:40 -0800)]
scsi: qla2xxx: add more FW debug information
Per FW request, MB 1-7 should be logged for 8002 error.
Link: https://lore.kernel.org/r/20200226224022.24518-11-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Andrew Vasquez [Wed, 26 Feb 2020 22:40:13 +0000 (14:40 -0800)]
scsi: qla2xxx: Update BPM enablement semantics.
commit
e4e3a2ce9556 ("scsi: qla2xxx: Add ability to autodetect SFP
type") takes a heavy handed approach to BPM (Buffer Plus Management)
enablement:
1) During hardware initialization, if an LR-capable transceiver is
recognized, the driver schedules a disruptive post-initialization
chip-reset (ISP-ABORT) to allow the BPM settings to be sent to the
firmware. This chip-reset will result in (short-term) path-loss to
all fc-rports and their attached SCSI devices.
2) LR-detection is triggered during any link-up event, resulting in a
refresh and potential chip-reset
Based on firmware-team guidance, upon LR-capable transceiver
recognition, the driver's hardware initialization code will now
re-execute firmware with the new BPM settings, then continue on with
driver initialization. To address the second issue, the driver
performs LR-capable detection upon the driver receiving a
transceiver-insertion asynchronous event from firmware. No short-term
path loss is needed with this new semantic.
Link: https://lore.kernel.org/r/20200226224022.24518-10-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Andrew Vasquez <andrewv@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:12 +0000 (14:40 -0800)]
scsi: qla2xxx: fix FW resource count values
This patch fixes issue where current and original exchanges count
were swapped for intiator and targets.
Also fix IOCB count for current and original which were swapped.
Link: https://lore.kernel.org/r/20200226224022.24518-9-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Andrew Vasquez [Wed, 26 Feb 2020 22:40:11 +0000 (14:40 -0800)]
scsi: qla2xxx: Use a dedicated interrupt handler for 'handshake-required' ISPs
There's no point checking flags.disable_msix_handshake in the
interrupt handler hot-path. Instead perform the check during
queue-pair instantiation and use the proper interrupt handler.
Link: https://lore.kernel.org/r/20200226224022.24518-8-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Andrew Vasquez <andrewv@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Michael Hernandez [Wed, 26 Feb 2020 22:40:10 +0000 (14:40 -0800)]
scsi: qla2xxx: Return appropriate failure through BSG Interface
This patch ensures flash updates API calls return possible failure
status through BSG interface to the application.
Link: https://lore.kernel.org/r/20200226224022.24518-7-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Michael Hernandez [Wed, 26 Feb 2020 22:40:09 +0000 (14:40 -0800)]
scsi: qla2xxx: Improved secure flash support messages
This patch improved message for Secure Flash support. No
functionality has been changed.
Link: https://lore.kernel.org/r/20200226224022.24518-6-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 26 Feb 2020 22:40:08 +0000 (14:40 -0800)]
scsi: qla2xxx: Fix FCP-SCSI FC4 flag passing error
This patch fixes issue where incorrect flag was used for sending
switch commands.
Link: https://lore.kernel.org/r/20200226224022.24518-5-hmadhani@marvell.com
Fixes:
e8c72ba51a15 ("[SCSI] qla2xxx: Use GFF_ID to check FCP-SCSI FC4 type before logging into Nx_Ports")
Fixes:
a4239945b8ad ("scsi: qla2xxx: Add switch command to simplify fabric discovery")
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>