android_kernel_xiaomi_sm8350/drivers
Michael Reed 52aeeca900 [SCSI] stale residual returned on write following BUSY retry
A BUSY status returned on a write request results in a stale residual
being returned when the write ultimately successfully completes.

This can be reproduced as follows:

1) issue immediate mode rewind to scsi tape drive
2) issue write request

The tape drive returns busy.  The low level driver detects underrun and
sets the residual into the scsi command.  The low level driver responds
with (DID_OK << 16) | scsi_status.  scsi_status is 8, hence
status_byte(result) == 4, i.e., BUSY.

scsi_softirq_done() calls scsi_decide_disposition() which returns
ADD_TO_MLQUEUE.  scsi_softirq_done() then calls scsi_queue_insert()
which, on the way to resubmitting the request to the driver, calls
scsi_init_cmd_errh().

The attached patch modifies scsi_init_cmd_errh() to clear the resid
field.  This prevents a "stale" residual from being returned when the
scsi command finally completes without a BUSY status.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:04 -04:00
..
acorn/char Remove the arm26 port 2007-07-31 15:39:39 -07:00
acpi ACPI: EC: Fix "no battery" regression 2007-08-14 01:03:42 -04:00
amba
ata [ARM] pata_icside: fix the FIXMEs 2007-08-06 16:10:54 +01:00
atm [ATM] drivers/atm/iphase.c: mostly kmalloc + memset conversion to kzalloc 2007-08-13 22:52:13 -07:00
auxdisplay
base CPU online file permission 2007-07-31 15:39:39 -07:00
block sysace: HDIO_GETGEO has it's own method for ages 2007-08-11 22:34:48 +02:00
bluetooth
cdrom [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00
char pull asus sony thinkpad into release branch 2007-08-12 00:17:12 -04:00
clocksource x86_64: fix typo in acpi_pm.c 2007-07-21 18:37:12 -07:00
connector
cpufreq
crypto
dio
dma [NET_DMA]: remove unused dma_memcpy_to_kernel_iovec 2007-07-31 02:28:03 -07:00
edac drivers/edac: fix pasemi kconfig depends 2007-07-26 11:35:18 -07:00
eisa
fc4 [SCSI] fc4: convert to use the data buffer accessors 2007-10-12 14:40:00 -04:00
firewire firewire: fw-core: make two variables static 2007-08-02 20:34:17 +02:00
firmware
hid HID: Never call hid_free_buffers() when usbhid_device has been freed 2007-08-02 13:48:04 +02:00
hwmon hwmon: fscher read control bugfix 2007-07-30 21:14:00 -04:00
i2c i2c-s3c2410: Build fix 2007-08-14 18:37:15 +02:00
ide scc_pata: PIO fixes 2007-08-01 23:46:46 +02:00
ieee1394 ieee1394: sbp2: more correct Kconfig dependencies 2007-08-02 20:34:16 +02:00
infiniband [SCSI] transport_srp: add rport roles attribute 2007-10-12 14:37:46 -04:00
input [MIPS] Fixup secure computing stuff. 2007-07-31 21:35:21 +01:00
isdn Remove 'isdn_* is defined but unused' warnings 2007-07-31 15:39:44 -07:00
kvm KVM: x86 emulator: fix debug reg mov instructions 2007-08-06 17:54:41 -07:00
leds
lguest i386: Make patching more robust, fix paravirt issue 2007-08-11 15:58:13 -07:00
macintosh [POWERPC] Clean up duplicate includes in drivers/macintosh/ 2007-07-22 21:31:00 +10:00
mca
md Fix remap handling by blktrace 2007-08-11 22:34:48 +02:00
media V4L/DVB (5939): dvb-pll: make struct dvb_pll_fcv1236d static 2007-07-30 16:26:37 -03:00
message [SCSI] mpt fusion: bump version to 3.04.06 2007-10-12 14:48:57 -04:00
mfd
misc pull asus sony thinkpad into release branch 2007-08-12 00:17:12 -04:00
mmc mmc: at91_mci: remove whitespace at the end of lines 2007-08-09 16:13:44 +02:00
mtd mtdchar build fix 2007-08-11 15:47:41 -07:00
net Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2007-08-14 09:31:19 -07:00
nubus
of
oprofile [CELL] oprofile: add support to OProfile for profiling CELL BE SPUs 2007-07-20 21:42:24 +02:00
parisc
parport parport_pc locking fix 2007-07-31 15:39:37 -07:00
pci pci: rename __pci_reenable_device() to pci_reenable_device() 2007-08-01 10:00:56 -04:00
pcmcia pcmcia: give socket time to power down 2007-07-31 15:39:38 -07:00
pnp ACPI: restore CONFIG_ACPI_SLEEP 2007-07-29 16:53:59 -07:00
power Don't compile the PMU power driver on 64-bit PowerPC 2007-07-23 12:42:45 +01:00
ps3
rapidio
rtc rtc-m48t59 driver NO_IRQ mode fixup 2007-07-31 15:39:44 -07:00
s390 [SCSI] zfcp: whitespace cleanup 2007-10-12 14:47:21 -04:00
sbus Videopix Frame Grabber: Fix unreleased lock in vfc_debug() 2007-07-31 15:39:43 -07:00
scsi [SCSI] stale residual returned on write following BUSY retry 2007-10-12 14:49:04 -04:00
serial serial: fix 8250 early console setup 2007-08-03 15:02:56 -07:00
sh
sn
spi spidev warning fix 2007-08-11 15:47:42 -07:00
tc
telephony
uio
usb [SCSI] microtek: use data accessors and !use_sg cleanup 2007-10-12 14:38:21 -04:00
video matroxfb: rectify jitter (G450/G550) 2007-08-11 15:47:40 -07:00
w1 drivers/ misc __iomem annotations 2007-07-26 11:11:57 -07:00
xen xenbus_xs.c: fix a use-after-free 2007-07-26 11:35:17 -07:00
zorro
Kconfig
Makefile [WATCHDOG] Fix pcwd_init_module crash 2007-07-29 18:58:39 +00:00