linux/drivers
Steffen Maier adbbbd349e scsi: zfcp: trace HBA FSF response by default on dismiss or timedout late response
commit fdb7cee3b9 upstream.

At the default trace level, we only trace unsuccessful events including
FSF responses.

zfcp_dbf_hba_fsf_response() only used protocol status and FSF status to
decide on an unsuccessful response. However, this is only one of multiple
possible sources determining a failed struct zfcp_fsf_req.

An FSF request can also "fail" if its response runs into an ERP timeout
or if it gets dismissed because a higher level recovery was triggered
[trace tags "erscf_1" or "erscf_2" in zfcp_erp_strategy_check_fsfreq()].
FSF requests with ERP timeout are:
FSF_QTCB_EXCHANGE_CONFIG_DATA, FSF_QTCB_EXCHANGE_PORT_DATA,
FSF_QTCB_OPEN_PORT_WITH_DID or FSF_QTCB_CLOSE_PORT or
FSF_QTCB_CLOSE_PHYSICAL_PORT for target ports,
FSF_QTCB_OPEN_LUN, FSF_QTCB_CLOSE_LUN.
One example is slow queue processing which can cause follow-on errors,
e.g. FSF_PORT_ALREADY_OPEN after FSF_QTCB_OPEN_PORT_WITH_DID timed out.
In order to see the root cause, we need to see late responses even if the
channel presented them successfully with FSF_PROT_GOOD and FSF_GOOD.
Example trace records formatted with zfcpdbf from the s390-tools package:

Timestamp      : ...
Area           : REC
Subarea        : 00
Level          : 1
Exception      : -
CPU ID         : ..
Caller         : ...
Record ID      : 1
Tag            : fcegpf1
LUN            : 0xffffffffffffffff
WWPN           : 0x<WWPN>
D_ID           : 0x00<D_ID>
Adapter status : 0x5400050b
Port status    : 0x41200000
LUN status     : 0x00000000
Ready count    : 0x00000001
Running count  : 0x...
ERP want       : 0x02				ZFCP_ERP_ACTION_REOPEN_PORT
ERP need       : 0x02				ZFCP_ERP_ACTION_REOPEN_PORT
|
Timestamp      : ...				30 seconds later
Area           : REC
Subarea        : 00
Level          : 1
Exception      : -
CPU ID         : ..
Caller         : ...
Record ID      : 2
Tag            : erscf_2
LUN            : 0xffffffffffffffff
WWPN           : 0x<WWPN>
D_ID           : 0x00<D_ID>
Adapter status : 0x5400050b
Port status    : 0x41200000
LUN status     : 0x00000000
Request ID     : 0x<request_ID>
ERP status     : 0x10000000			ZFCP_STATUS_ERP_TIMEDOUT
ERP step       : 0x0800				ZFCP_ERP_STEP_PORT_OPENING
ERP action     : 0x02				ZFCP_ERP_ACTION_REOPEN_PORT
ERP count      : 0x00
|
Timestamp      : ...				later than previous record
Area           : HBA
Subarea        : 00
Level          : 5	> default level		=> 3	<= default level
Exception      : -
CPU ID         : 00
Caller         : ...
Record ID      : 1
Tag            : fs_qtcb			=> fs_rerr
Request ID     : 0x<request_ID>
Request status : 0x00001010			ZFCP_STATUS_FSFREQ_DISMISSED
						| ZFCP_STATUS_FSFREQ_CLEANUP
FSF cmnd       : 0x00000005
FSF sequence no: 0x...
FSF issued     : ...				> 30 seconds ago
FSF stat       : 0x00000000			FSF_GOOD
FSF stat qual  : 00000000 00000000 00000000 00000000
Prot stat      : 0x00000001			FSF_PROT_GOOD
Prot stat qual : 00000000 00000000 00000000 00000000
Port handle    : 0x...
LUN handle     : 0x00000000
QTCB log length: ...
QTCB log info  : ...

In case of problems detecting that new responses are waiting on the input
queue, we sooner or later trigger adapter recovery due to an FSF request
timeout (trace tag "fsrth_1").
FSF requests with FSF request timeout are:
typically FSF_QTCB_ABORT_FCP_CMND; but theoretically also
FSF_QTCB_EXCHANGE_CONFIG_DATA or FSF_QTCB_EXCHANGE_PORT_DATA via sysfs,
FSF_QTCB_OPEN_PORT_WITH_DID or FSF_QTCB_CLOSE_PORT for WKA ports,
FSF_QTCB_FCP_CMND for task management function (LUN / target reset).
One or more pending requests can meanwhile have FSF_PROT_GOOD and FSF_GOOD
because the channel filled in the response via DMA into the request's QTCB.

In a theroretical case, inject code can create an erroneous FSF request
on purpose. If data router is enabled, it uses deferred error reporting.
A READ SCSI command can succeed with FSF_PROT_GOOD, FSF_GOOD, and
SAM_STAT_GOOD. But on writing the read data to host memory via DMA,
it can still fail, e.g. if an intentionally wrong scatter list does not
provide enough space. Rather than getting an unsuccessful response,
we get a QDIO activate check which in turn triggers adapter recovery.
One or more pending requests can meanwhile have FSF_PROT_GOOD and FSF_GOOD
because the channel filled in the response via DMA into the request's QTCB.
Example trace records formatted with zfcpdbf from the s390-tools package:

Timestamp      : ...
Area           : HBA
Subarea        : 00
Level          : 6	> default level		=> 3	<= default level
Exception      : -
CPU ID         : ..
Caller         : ...
Record ID      : 1
Tag            : fs_norm			=> fs_rerr
Request ID     : 0x<request_ID2>
Request status : 0x00001010			ZFCP_STATUS_FSFREQ_DISMISSED
						| ZFCP_STATUS_FSFREQ_CLEANUP
FSF cmnd       : 0x00000001
FSF sequence no: 0x...
FSF issued     : ...
FSF stat       : 0x00000000			FSF_GOOD
FSF stat qual  : 00000000 00000000 00000000 00000000
Prot stat      : 0x00000001			FSF_PROT_GOOD
Prot stat qual : ........ ........ 00000000 00000000
Port handle    : 0x...
LUN handle     : 0x...
|
Timestamp      : ...
Area           : SCSI
Subarea        : 00
Level          : 3
Exception      : -
CPU ID         : ..
Caller         : ...
Record ID      : 1
Tag            : rsl_err
Request ID     : 0x<request_ID2>
SCSI ID        : 0x...
SCSI LUN       : 0x...
SCSI result    : 0x000e0000			DID_TRANSPORT_DISRUPTED
SCSI retries   : 0x00
SCSI allowed   : 0x05
SCSI scribble  : 0x<request_ID2>
SCSI opcode    : 28...				Read(10)
FCP rsp inf cod: 0x00
FCP rsp IU     : 00000000 00000000 00000000 00000000
                                         ^^	SAM_STAT_GOOD
                 00000000 00000000

Only with luck in both above cases, we could see a follow-on trace record
of an unsuccesful event following a successful but late FSF response with
FSF_PROT_GOOD and FSF_GOOD. Typically this was the case for I/O requests
resulting in a SCSI trace record "rsl_err" with DID_TRANSPORT_DISRUPTED
[On ZFCP_STATUS_FSFREQ_DISMISSED, zfcp_fsf_protstatus_eval() sets
ZFCP_STATUS_FSFREQ_ERROR seen by the request handler functions as failure].
However, the reason for this follow-on trace was invisible because the
corresponding HBA trace record was missing at the default trace level
(by default hidden records with tags "fs_norm", "fs_qtcb", or "fs_open").

On adapter recovery, after we had shut down the QDIO queues, we perform
unsuccessful pseudo completions with flag ZFCP_STATUS_FSFREQ_DISMISSED
for each pending FSF request in zfcp_fsf_req_dismiss_all().
In order to find the root cause, we need to see all pseudo responses even
if the channel presented them successfully with FSF_PROT_GOOD and FSF_GOOD.

Therefore, check zfcp_fsf_req.status for ZFCP_STATUS_FSFREQ_DISMISSED
or ZFCP_STATUS_FSFREQ_ERROR and trace with a new tag "fs_rerr".

It does not matter that there are numerous places which set
ZFCP_STATUS_FSFREQ_ERROR after the location where we trace an FSF response
early. These cases are based on protocol status != FSF_PROT_GOOD or
== FSF_PROT_FSF_STATUS_PRESENTED and are thus already traced by default
as trace tag "fs_perr" or "fs_ferr" respectively.

NB: The trace record with tag "fssrh_1" for status read buffers on dismiss
all remains. zfcp_fsf_req_complete() handles this and returns early.
All other FSF request types are handled separately and as described above.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Fixes: 8a36e4532e ("[SCSI] zfcp: enhancement of zfcp debug features")
Fixes: 2e261af84c ("[SCSI] zfcp: Only collect FSF/HBA debug data for matching trace levels")
Reviewed-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-09-27 14:39:22 +02:00
..
accessibility printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
acpi ACPI: EC: Fix regression related to wrong ECDT initialization order 2017-08-30 10:21:56 +02:00
amba ARM: 8596/1: amba: Support clk parents and rates assigned in DT 2016-08-12 16:47:07 +01:00
android ANDROID: binder: fix proc->tsk check. 2017-08-30 10:21:53 +02:00
ata cs5536: add support for IDE controller variant 2017-09-09 17:39:41 +02:00
atm atm: fix improper return value 2016-12-05 14:53:46 -05:00
auxdisplay auxdisplay: img-ascii-lcd: add missing sentinel entry in img_ascii_lcd_matches 2017-03-30 09:41:27 +02:00
base driver core: bus: Fix a potential double free 2017-09-09 17:39:38 +02:00
bcma bcma: use (get|put)_device when probing/removing device driver 2017-03-12 06:41:52 +01:00
block skd: Submit requests to firmware before triggering the doorbell 2017-09-27 14:39:21 +02:00
bluetooth Bluetooth: Add support of 13d3:3494 RTL8723BE device 2017-09-09 17:39:40 +02:00
bus bus: vexpress-config: fix device reference leak 2017-01-19 20:18:07 +01:00
cdrom cdrom: support read sub-channel command in LBA format 2016-07-12 08:24:50 -07:00
char ipmi/watchdog: fix watchdog timeout set on reboot 2017-08-06 18:59:43 -07:00
clk clk/samsung: exynos542x: mark some clocks as critical 2017-08-11 08:49:35 -07:00
clocksource clocksource/drivers/arm_arch_timer: Don't assume clock runs in suspend 2017-04-12 12:41:16 +02:00
connector connector: make cn_proc explicitly non-modular 2016-07-05 11:40:47 -07:00
cpufreq cpufreq: s3c2416: double free on driver init error path 2017-07-05 14:40:30 +02:00
cpuidle Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-10-15 09:26:12 -07:00
crypto crypto: ccp - Fix XTS-AES-128 support on v5 CCPs 2017-09-27 14:39:20 +02:00
dax device-dax: fix sysfs duplicate warnings 2017-08-06 18:59:43 -07:00
dca dmaengine: ioatdma: constify dca_ops structures 2015-11-16 09:27:32 +05:30
devfreq PM / devfreq: Fix wrong trans_stat of passive devfreq device 2017-03-12 06:41:44 +01:00
dio m68k: don't export static inline functions 2009-12-06 11:18:28 +01:00
dma dmaengine: ti-dma-crossbar: Add some 'of_node_put()' in error path. 2017-08-06 18:59:46 -07:00
dma-buf dma-buf: add support for compat ioctl 2017-04-18 07:11:50 +02:00
edac * Altera Arria10 enablement of NAND, DMA, USB, QSPI and SD-MMC FIFO 2016-10-04 12:06:26 -07:00
eisa Revert "EISA: Initialize device before its resources" 2014-01-17 14:57:29 -07:00
extcon extcon: return error code on failure 2017-01-19 20:18:03 +01:00
firewire firewire: net: fix fragmented datagram_size off-by-one 2016-11-03 14:46:39 +01:00
firmware efi/libstub: Skip GOP with PIXEL_BLT_ONLY format 2017-04-21 09:31:20 +02:00
fmc Merge 3.14-rc5 into char-misc-next 2014-03-02 19:53:09 -08:00
fpga fpga manager: Add hardware dependency to Zynq driver 2016-09-08 17:31:44 +02:00
gpio gpiolib: skip unwanted events, don't convert them to opposite edge 2017-08-11 08:49:30 -07:00
gpu drm/sun4i: Implement drm_driver lastclose to restore fbdev console 2017-09-27 14:39:18 +02:00
hid HID: ignore Petzl USB headlamp 2017-08-06 18:59:49 -07:00
hsi HSI: omap_ssi: drop pm_runtime_irq_safe 2016-06-28 00:40:08 +02:00
hv Drivers: hv: vmbus: Don't leak memory when a channel is rescinded 2017-03-30 09:41:27 +02:00
hwmon hwmon: (it87) Fix pwm4 detection for IT8620 and IT8628 2017-05-14 14:00:13 +02:00
hwspinlock hwspinlock: qcom_hwspinlock: add missing of_node_put after calling of_parse_phandle 2016-07-06 12:20:34 -07:00
hwtracing intel_th: pci: Add Cannon Lake PCH-LP support 2017-09-09 17:39:39 +02:00
i2c i2c: ismt: Return EMSGSIZE for block reads with bogus length 2017-09-07 08:35:39 +02:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide 2016-07-29 13:29:06 -07:00
idle x86/intel_idle: Add CPU model 0x4a (Atom Z34xx series) 2017-04-12 12:41:17 +02:00
iio iio: adc: ti-ads1015: add adequate wait time to get correct conversion 2017-09-09 17:39:38 +02:00
infiniband IB/addr: Fix setting source address in addr6_resolve() 2017-09-27 14:39:18 +02:00
input Input: i8042 - add Gigabyte P57 to the keyboard reset table 2017-09-27 14:39:19 +02:00
iommu iommu/amd: Enable ga_log_intr when enabling guest_mode 2017-08-11 08:49:30 -07:00
ipack ipack: print a hex number after a 0x prefix 2016-10-27 18:43:43 -07:00
irqchip irqchip: mips-gic: SYNC after enabling GIC region 2017-09-07 08:35:39 +02:00
isdn isdn/i4l: fix buffer overflow 2017-08-06 18:59:42 -07:00
leds Revert "leds: handle suspend/resume in heartbeat trigger" 2017-08-30 10:21:51 +02:00
lguest Merge branch 'x86/urgent' into x86/asm to pick up dependent fixes 2016-04-13 11:36:44 +02:00
lightnvm Merge branch 'for-4.9/block' of git://git.kernel.dk/linux-block 2016-10-07 14:42:05 -07:00
macintosh powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
mailbox mailbox: handle empty message in tx_tick 2017-08-06 18:59:42 -07:00
mcb MCB: add support for SC31 to mcb-lpc 2017-09-09 17:39:41 +02:00
md md/bitmap: disable bitmap_resize for file-backed bitmaps. 2017-09-27 14:39:21 +02:00
media saa7164: fix double fetch PCIe access condition 2017-08-11 08:49:31 -07:00
memory memory/atmel-ebi: Fix ns <-> cycles conversions 2017-03-15 10:02:45 +08:00
memstick memstick: rtsx_usb_ms: Manage runtime PM when accessing the device 2016-10-17 15:43:05 +02:00
message scsi: fusion: Fix error return code in mptfc_probe() 2016-09-14 14:26:19 -04:00
mfd mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode 2017-06-24 07:11:14 +02:00
misc scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails. 2017-07-27 15:07:59 -07:00
mmc mmc: mmc: correct the logic for setting HS400ES signal voltage 2017-08-16 13:43:17 -07:00
mtd mtd: nand: qcom: fix config error for BCH 2017-09-13 14:13:36 -07:00
net gianfar: Fix Tx flow control deactivation 2017-09-20 08:19:56 +02:00
nfc nfc: fdp: fix NULL pointer dereference 2017-08-06 18:59:42 -07:00
ntb ntb: transport shouldn't disable link due to bogus values in SPADs 2017-08-30 10:21:55 +02:00
nubus nubus: Remove superfluous interrupt disable/restore 2014-10-27 11:03:19 +01:00
nvdimm libnvdimm: fix badblock range handling of ARS range 2017-07-27 15:08:02 -07:00
nvme nvme-fabrics: generate spec-compliant UUID NQNs 2017-09-13 14:13:36 -07:00
nvmem nvmem: imx-ocotp: Fix wrong register size 2017-08-06 18:59:48 -07:00
of of: device: Export of_device_{get_modalias, uvent_modalias} to modules 2017-07-27 15:08:08 -07:00
oprofile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-10 20:16:43 -07:00
parisc parisc: pci memory bar assignment fails with 64bit kernels on dino/cujo 2017-08-24 17:12:18 -07:00
parport parisc, parport_gsc: Fixes for printk continuation lines 2017-06-17 06:41:54 +02:00
pci PCI/PM: Restore the status of PCI devices across hibernation 2017-07-27 15:08:00 -07:00
pcmcia pcmcia: fix return value of soc_pcmcia_regulator_set 2016-11-11 08:45:08 -08:00
perf perf: xgene: Remove bogus IS_ERR() check 2016-10-17 15:50:07 +01:00
phy phy: qcom-usb-hs: Add depends on EXTCON 2017-05-14 14:00:19 +02:00
pinctrl pinctrl/amd: save pin registers over suspend/resume 2017-09-27 14:39:19 +02:00
platform platform/x86: ideapad-laptop: handle ACPI event 1 2017-07-05 14:40:23 +02:00
pnp PNP: isapnp: make core more explicitly non-modular 2016-08-16 22:53:59 +02:00
power power: supply: bq24190_charger: Handle fault before status on interrupt 2017-05-14 14:00:15 +02:00
powercap powercap/intel_rapl: fix and tidy up error handling 2017-01-19 20:18:07 +01:00
pps pps: kc: fix non-tickless system config dependency 2016-10-11 15:06:32 -07:00
ps3 powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
ptp drivers/ptp: Fix kernel memory disclosure 2016-10-13 10:20:06 -04:00
pwm pwm: rockchip: State of PWM clock should synchronize with PWM enabled state 2017-04-21 09:31:22 +02:00
rapidio mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
ras x86/ras: Move AMD MCE injector to arch/x86/ras/ 2015-08-13 10:12:54 +02:00
regulator regulator: tps65086: Fix DT node referencing in of_parse_cb 2017-07-05 14:40:29 +02:00
remoteproc remoteproc: qcom: mdt_loader: Don't overwrite firmware object 2017-03-12 06:41:50 +01:00
reset reset: uniphier: rename MIO reset to SD reset for Pro5, PXs2, LD20 SoCs 2016-10-22 18:31:42 +09:00
rpmsg rpmsg: virtio_rpmsg_bus: fix channel creation 2017-01-26 08:24:44 +01:00
rtc rtc: tegra: Implement clock handling 2017-04-21 09:31:24 +02:00
s390 scsi: zfcp: trace HBA FSF response by default on dismiss or timedout late response 2017-09-27 14:39:22 +02:00
sbus openprom: fix warning 2016-05-20 18:33:37 -07:00
scsi scsi: sg: recheck MMAP_IO request length with lock held 2017-09-09 17:39:42 +02:00
sfi SFI: fix compiler warnings 2014-12-03 18:49:20 -05:00
sh drivers: sh: Stop using the legacy clock domain on ARM 2016-05-30 09:41:11 +09:00
sn Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
soc soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe() 2017-01-26 08:24:45 +01:00
spi spi: spi-axi: Free resources on error path 2017-08-11 08:49:35 -07:00
spmi spmi: Include OF based modalias in device uevent 2017-07-27 15:08:08 -07:00
ssb ssb: Fix error routine when fallback SPROM fails 2017-01-09 08:32:16 +01:00
staging staging/rts5208: fix incorrect shift to extract upper nybble 2017-09-09 17:39:37 +02:00
target target: Fix node_acl demo-mode + uncached dynamic shutdown regression 2017-08-16 13:43:17 -07:00
tc TC: Error handling clean-ups 2014-11-24 07:45:25 +01:00
thermal thermal: cpu_cooling: Avoid accessing potentially freed structures 2017-07-27 15:07:55 -07:00
thunderbolt thunderbolt: Don't declare Falcon Ridge unsupported 2016-08-31 13:25:02 +02:00
tty tty: fix __tty_insert_flip_char regression 2017-09-27 14:39:19 +02:00
uio uio: fix dmem_region_start computation 2016-08-31 13:07:30 +02:00
usb USB: core: Avoid race of async_completed() w/ usbdev_release() 2017-09-09 17:39:37 +02:00
uwb uwb: fix device quirk on big-endian hosts 2017-05-25 15:44:46 +02:00
vfio vfio-pci: Handle error from pci_iomap 2017-08-06 18:59:48 -07:00
vhost vhost_net: correctly check tx avail during rx busy polling 2017-09-20 08:19:56 +02:00
video video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap 2017-08-06 18:59:48 -07:00
virt mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
virtio virtio_balloon: init 1st buffer in stats vq 2017-03-31 10:31:45 +02:00
vlynq drivers/vlynq/vlynq.c: fix another resource size off by 1 error 2014-01-23 16:36:55 -08:00
vme VME: restore bus_remove function causing incomplete module unload 2017-03-12 06:41:50 +01:00
w1 w1: ds2490: USB transfer buffers need to be DMAable 2017-03-12 06:41:48 +01:00
watchdog watchdog: bcm281xx: Fix use of uninitialized spinlock. 2017-07-05 14:40:28 +02:00
xen xen: fix bio vec merging 2017-08-24 17:12:20 -07:00
zorro zorro: Use kobj_to_dev() 2016-01-25 09:42:23 +01:00
Kconfig libnvdimm for 4.7 2016-05-23 11:18:01 -07:00
Makefile usb: Make sure usb/phy/of gets built-in 2017-05-20 14:28:35 +02:00