android_kernel_google_msm/include/scsi
Mike Christie 3fe48d0393 SCSI: add 1024 max sectors black list flag
commit 35e9a9f93994d7f7d12afa41169c7ba05513721b upstream.

This works around a issue with qnap iscsi targets not handling large IOs
very well.

The target returns:

VPD INQUIRY: Block limits page (SBC)
  Maximum compare and write length: 1 blocks
  Optimal transfer length granularity: 1 blocks
  Maximum transfer length: 4294967295 blocks
  Optimal transfer length: 4294967295 blocks
  Maximum prefetch, xdread, xdwrite transfer length: 0 blocks
  Maximum unmap LBA count: 8388607
  Maximum unmap block descriptor count: 1
  Optimal unmap granularity: 16383
  Unmap granularity alignment valid: 0
  Unmap granularity alignment: 0
  Maximum write same length: 0xffffffff blocks
  Maximum atomic transfer length: 0
  Atomic alignment: 0
  Atomic transfer length granularity: 0

and it is *sometimes* able to handle at least one IO of size up to 8 MB. We
have seen in traces where it will sometimes work, but other times it
looks like it fails and it looks like it returns failures if we send
multiple large IOs sometimes. Also it looks like it can return 2 different
errors. It will sometimes send iscsi reject errors indicating out of
resources or it will send invalid cdb illegal requests check conditions.
And then when it sends iscsi rejects it does not seem to handle retries
when there are command sequence holes, so I could not just add code to
try and gracefully handle that error code.

The problem is that we do not have a good contact for the company,
so we are not able to determine under what conditions it returns
which error and why it sometimes works.

So, this patch just adds a new black list flag to set targets like this to
the old max safe sectors of 1024. The max_hw_sectors changes added in 3.19
caused this regression, so I also ccing stable.

Reported-by: Christian Hesse <list@eworm.de>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-09-18 09:20:33 +08:00
..
fc SCSI updates on 20120319 2012-03-22 12:55:29 -07:00
Kbuild
fc_encode.h
fc_frame.h
iscsi_if.h [SCSI] qla4xxx: Removed packed attr from struct iscsi_chap_rec 2012-03-27 08:26:35 +01:00
iscsi_proto.h
libfc.h
libfcoe.h [SCSI] libfcoe: Support extra MAC descriptor to be used as FCoE MAC 2012-03-28 09:05:37 +01:00
libiscsi.h [SCSI] libiscsi_tcp: fix max_r2t manipulation 2012-02-19 08:09:00 -06:00
libiscsi_tcp.h [SCSI] libiscsi_tcp: fix max_r2t manipulation 2012-02-19 08:09:00 -06:00
libsas.h SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf 2012-07-16 09:04:37 -07:00
libsrp.h
osd_attributes.h
osd_initiator.h
osd_ore.h ore: Fix wrong math in allocation of per device BIO 2014-02-13 11:51:11 -08:00
osd_protocol.h
osd_sec.h
osd_sense.h
osd_types.h
sas.h [SCSI] libsas: let libata recover links that fail to transmit initial sig-fis 2012-02-29 15:33:02 -06:00
sas_ata.h [SCSI] libsas, libata: fix start of life for a sas ata_port 2012-04-23 12:11:47 +01:00
scsi.h scsi: update scsi.h with SYNCHRONIZE_CACHE_16 2012-02-25 14:37:46 -08:00
scsi_bsg_fc.h
scsi_bsg_iscsi.h
scsi_cmnd.h SCSI: Fix NULL dereferences in scsi_cmd_to_driver 2012-07-16 09:04:30 -07:00
scsi_dbg.h
scsi_device.h usb-storage/SCSI: Add broken_fua blacklist flag 2015-04-14 17:33:56 +08:00
scsi_devinfo.h SCSI: add 1024 max sectors black list flag 2015-09-18 09:20:33 +08:00
scsi_dh.h
scsi_driver.h [SCSI] Handle disk devices which can not process medium access commands 2012-02-19 10:14:52 -06:00
scsi_eh.h
scsi_host.h
scsi_ioctl.h
scsi_netlink.h headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
scsi_netlink_fc.h
scsi_scan.h
scsi_tcq.h
scsi_tgt.h
scsi_tgt_if.h
scsi_transport.h BUG: headers with BUG/BUG_ON etc. need linux/bug.h 2012-03-04 17:54:34 -05:00
scsi_transport_fc.h
scsi_transport_iscsi.h [SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry 2012-02-29 16:55:59 -06:00
scsi_transport_sas.h [SCSI] libsas: fix sas_find_local_phy(), take phy references 2012-02-29 13:01:06 -06:00
scsi_transport_spi.h
scsi_transport_srp.h
scsicam.h
sg.h
srp.h