freebsd-skq/sys/dev
Kenneth D. Merry 28ef82eb7b Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.
The isp(4) driver was changing the tag type for REQUEST SENSE
commands to Head of Queue, when the CAM CCB flag
CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
and when the target has tagged queueing turned on.

In most cases when CAM_TAG_ACTION_VALID is not set, it is because
the target is not doing tagged queueing.  In those cases, trying to
send a Head of Queue tag may cause problems.  Instead, default to
sending a simple tag.

IBM tape drives claim to support tagged queueing in their standard
Inquiry data, but have the DQue bit set in the control mode page
(mode page 10).  CAM correctly detects that these drives do not
support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
on CCBs sent down to the drives.

This caused the isp(4) driver to go down the path of setting the
tag action to a default value, and for Request Sense commands only,
set the tag action to Head of Queue.

If an IBM tape drive does get a Head of Queue tag, it rejects it with
Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
to a Transport Error, which the driver translates to an Unrecoverable
HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
to get a good response from a REQUEST SENSE to an FC-attached IBM
tape drive with the isp(4) driver.

IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
with 4470 firmware) also have a bug in that sending a command with a
non-simple tag attribute breaks the tape drive's Command Reference
Number (CRN) accounting and causes it to ignore all subsequent
commands because it and the initiator disagree about the next
expected CRN.  The drives do reject the initial command with a head
of queue tag with an Invalid Message Error (0x49,0x00), but after that
they ignore any subsequent commands.  IBM confirmed that it is a bug,
and sent me test firmware that fixes the bug.  However tape drives in
the field will still exhibit the bug until they are upgraded.

Request Sense is not often sent to targets because most errors are
reported automatically through autosense in Fibre Channel and other
modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
an error that would crop up frequently.  But Request Sense is useful on
tape devices to report status information, aside from error reporting.

This problem is less serious without FC-Tape features turned on,
specifically precise delivery of commands (which enables Command
Reference Numbers), enabled on the target and initiator.  Without
FC-Tape features turned on, the target would return an error and
things would continue on.

And it also does not cause problems for targets that do tagged
queueing, because in those cases the isp(4) driver just uses the
tag type that is specified in the CCB, assuming the
CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
tag action if it isn't an ordered or head of queue tag.

sys/dev/isp/isp.c:
	In isp_start(), don't try to send Request Sense commands
	with the Head of Queue tag attribute if the CCB doesn't
	have a valid tag action.  The tag action likely isn't valid
	because the target doesn't support tagged queueing.

Sponsored by:	Spectra Logic
MFC after:	3 days
2017-02-10 22:02:45 +00:00
..
aac
aacraid
acpi_support Hide unneeded message under bootverbose. 2017-01-27 14:17:48 +00:00
acpica Ensure the idle thread's loop services interrupts in a timely way when 2017-02-08 16:46:57 +00:00
adb Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned. 2017-01-30 02:32:33 +00:00
adlink
advansys
ae
age
agp
aha
ahb
ahci Partially workaround ASMedia HBA error recovery. 2017-01-25 18:16:17 +00:00
aic Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
aic7xxx
al_eth
alc
ale
alpm
altera Merge enhancements to the ALTERA Avalon bus generic device attachment 2017-01-28 13:25:06 +00:00
amdpm
amdsbwd
amdsmb
amdtemp
amr
an
arcmsr
asmc
ata Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
ath [ath] sigh, how'd I miss this. 2017-02-10 07:16:56 +00:00
atkbdc
auxio
bce
beri
bfe
bge
bhnd
bktr
bm
bnxt
buslogic
bvm
bwi
bwn
bxe
cadence
cardbus
cas
ce
cesa Remove remaining ifdefs from CESA header 2017-02-02 06:07:39 +00:00
cfe
cfi
chromebook_platform
ciss
cm
cmx
coretemp
cp
cpuctl
cpufreq
cs
ctau
cx
cxgb
cxgbe cxgbe/t4_tom: Fix CLIP entry refcounting on the passive side. Every 2017-02-06 17:48:25 +00:00
cy
cyapa
dc
dcons
de Remove dangling DE425 EISA card references in the de driver. They 2017-02-02 04:50:20 +00:00
digi
dme
dpaa
dpms
dpt
drm
drm2 Really revert 312923 this time 2017-01-28 16:40:51 +00:00
dwc
e1000 Add support for the Intel 82572EI back to em(4), it seems it was dropped 2017-02-09 17:48:33 +00:00
ed Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
efidev
eisa
en
ep Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
esp
et
etherswitch
evdev
ex
exca Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
extres
fatm
fb Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
fdc Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
fdt Make fdt_pm_mask_table internal to the Marvell code, it's unued anywhere 2017-01-26 13:04:14 +00:00
fe Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
ffec
filemon
firewire
flash
fxp
gem
glxiic
glxsb
gpio
gxemul gxemul: 2017-02-06 11:37:20 +00:00
hatm
hdmi
hifn
hme
hpt27xx Clean redundant MIN/MAX declarations in some HighPoint drivers. 2017-02-10 15:18:41 +00:00
hptiop
hptmv
hptnr Clean redundant MIN/MAX declarations in some HighPoint drivers. 2017-02-10 15:18:41 +00:00
hptrr Clean redundant MIN/MAX declarations in some HighPoint drivers. 2017-02-10 15:18:41 +00:00
hwpmc
hyperv hyperv/hn: add devctl_notify for VF_UP/DOWN events 2017-01-24 09:27:13 +00:00
ic - Remove i8255.h because it's pc98 device. 2017-01-29 03:34:49 +00:00
ichiic
ichsmb
ichwd
ida
if_ndis
iicbus
iir
intel
intpm
io
ioat
ipmi
ips
ipw
isci
iscsi
iscsi_initiator
iser
isl
ismt
isp Change the isp(4) driver to not adjust the tag type for REQUEST SENSE. 2017-02-10 22:02:45 +00:00
ispfw
iwi
iwm [iwm] Remove 1s delay after fw loading. Can't reproduce issues on AC8260. 2017-02-08 07:09:10 +00:00
iwn
ixgb
ixgbe Fix reference to free memory in ixgbe/if_media.c 2017-01-20 17:16:48 +00:00
ixl ixl(4): Update to 1.7.12-k 2017-02-10 01:04:11 +00:00
jedec_ts
jme
joy
kbd Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
kbdmux
ksyms
le Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
led
lge
lmc
malo
mbox
mc146818
mca
md
mdio
mem
mfi
mge
mii
mk48txx
mlx
mlx4 Change mlx4 QP allocation scheme. 2017-02-10 15:28:18 +00:00
mlx5 Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry 2017-01-30 08:35:15 +00:00
mly
mmc Fix some more overly long lines, whitespace and other bugs according to 2017-02-04 19:35:38 +00:00
mn
mpr Initialize a stack variable in mprsas_get_sas_address_for_sata_disk 2017-01-30 19:49:08 +00:00
mps
mpt
mrsas Fix a typo introduced in r306024. 2017-01-23 21:09:27 +00:00
mse Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
msk
mvs
mwl
mxge
my
nand
ncr
nctgpio
ncv
netfpga10g/nf10bmac
netmap
nfe
nfsmb
nge
nmdm
nsp
ntb
null
nvd
nvme Ensure that the passthrough request will fit in MAXPHYS bytes after it 2017-02-02 23:04:06 +00:00
nvram
nvram2env
nxge
oce
ofw Expand OpenFirmware API with ofw_bus_node_status_okay 2017-01-25 10:28:21 +00:00
otus
ow
patm
pbio
pccard
pccbb Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
pcf
pci PCIe HotPlug: remove tests for DL active link capability 2017-02-04 00:34:00 +00:00
pcn
pdq
pms
powermac_nvram
ppbus
ppc Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
proto
psci
pst
pty
puc
qlxgb
qlxgbe Added support for if_transmit and if_qflush 2017-01-25 00:23:38 +00:00
qlxge
quicc
ral
random
rc
rccgpio
re
rl
rndtest
rp
rt Set GDMA1 Frames Destination Port to Port 0 (CPU) 2017-02-09 07:29:07 +00:00
rtwn Sort REALTEK section and remove duplicate entry for RTL8192CU. 2017-01-24 03:00:22 +00:00
safe
sbni
scc
sdhci Fix some more overly long lines, whitespace and other bugs according to 2017-02-04 19:35:38 +00:00
sec
sf
sfxge sfxge(4): compact the first hot part of RxQ control 2017-01-27 11:59:02 +00:00
sge
siba
siis
sio Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
sis
sk
smbus
smc
sn
snp
sound Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
speaker
spibus
ste
stg
stge
streams
sym
syscons Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
tdfx
terasic
ti
tl
tpm
trm
tsec
twa
twe
tws
tx
txp
uart Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
ubsec
usb Add tsw_busy support to usb_serial (ucom). 2017-02-05 15:45:31 +00:00
utopia
vge
viapm
viawd
videomode
virtio
vkbd
vmware/vmxnet3
vnic Add the folowing set accessor functions for recently-added members of ifnet 2017-01-31 16:12:31 +00:00
vr
vt o Reset mouse selection when new lines reach selection lines. 2017-02-10 13:28:30 +00:00
vte
vx
vxge
watchdog
wb
wbwd
wi
wpi
wtap
xdma
xe
xen
xilinx
xl