GitHub/LineageOS/android_kernel_samsung_universal7580.git
16 years ago[SCSI] libiscsi, iscsi_tcp: iscsi pool cleanup
Olaf Kirch [Thu, 13 Dec 2007 18:43:25 +0000 (12:43 -0600)]
[SCSI] libiscsi, iscsi_tcp: iscsi pool cleanup

iscsi_pool_init simplified

iscsi_pool_init currently has a lot of duplicate kfree() calls it does
when some allocation fails. This patch simplifies the code a little by
using iscsi_pool_free to tear down the pool in case of an error.

iscsi_pool_init also returns a copy of the item array to the caller.
Not all callers use this array, so we make it optional.

Instead of allocating a second array and return that, allocate just one
array, of twice the size.

Update users of iscsi_pool_{init,free}

This patch drops the (now useless) second argument to
iscsi_pool_free, and updates all callers.

It also removes the ctask->r2ts array, which was never
used anyway. Since the items argument to iscsi_pool_init
is now optional, we can pass NULL instead.

Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libiscsi,iser: patch for AHS support
Boaz Harrosh [Thu, 13 Dec 2007 18:43:24 +0000 (12:43 -0600)]
[SCSI] libiscsi,iser: patch for AHS support

  - The default initialization of hdr_max is the minimum -
    sizeof(struct iscsi_cmd) - Once this patch goes into iser the default
    initialization at libiscsi can be removed.
  - This is not yet full support for AHSs at iser end. But it should be easy.
    Just allocate more space at iser_desc right after iscsi_hdr. Than
    at transmission time use ctask->hdr_len to retrieve the total
    size of all iscsi pdu headers. See previous patch at iscsi_tcp.[ch]

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] iscsi_tcp, libiscsi: initial AHS Support
Boaz Harrosh [Thu, 13 Dec 2007 18:43:23 +0000 (12:43 -0600)]
[SCSI] iscsi_tcp, libiscsi: initial AHS Support

  at libiscsi generic code
  - currently code assumes a storage space of pdu header is allocated
    at llds ctask and is pointed to by iscsi_cmd_task->hdr. Here I add
    a hdr_max field pertaining to that storage, and an hdr_len that
    accumulates the current use of the pdu-header.

  - Add an iscsi_next_hdr() inline which returns the next free space
    to write new Header at. Also iscsi_next_hdr() is used to retrieve
    the address at which to write the header-digest.

  - Add iscsi_add_hdr(length). What the user do is calls iscsi_next_hdr()
    for address of the new header, than calls iscsi_add_hdr(length) with
    the size of the new header. iscsi_add_hdr() will check if space is
    available and update to the new size. length must be padded according
    to standard.

  - Add 2 padding inline helpers thanks to Olaf. Current patch does not
    use them but Following patches will.
    Also moved definition of ISCSI_PAD_LEN to iscsi_proto.h which had
    PAD_WORD_LEN that was never used anywhere.

  - Let iscsi_prep_scsi_cmd_pdu() signal an Error return since now  it is
    possible that it will fail.

  - I was tired of yet again writing a "this is a digest" comment next to
    sizeof(__u32) so I defined a new ISCSI_DIGEST_SIZE. Now I don't need
    any comments. Changed all places that used sizeof(__u32) or "4" in
    connection to a digest.

  iscsi_tcp specific code
  - At struct iscsi_tcp_cmd_task allocate maximum space allowed in
    standard for all headers following the iscsi_cmd header. and mark
    it so in iscsi_tcp_session_create()
  - At iscsi_send_cmd_hdr() retrieve the correct headers size and
    write header digest at iscsi_next_hdr().

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] iscsi: Prettify resid handling and some extra checks
Boaz Harrosh [Thu, 13 Dec 2007 18:43:22 +0000 (12:43 -0600)]
[SCSI] iscsi: Prettify resid handling and some extra checks

  - Check to see that OVERFLOW is not negative indicating
    a bug.
  - Unify handling of UNDERFLOW and OVERFLOW to the same
    code.
  - Also handle BIDI_OVERFLOW.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] iscsi_tcp: rewrite recv path
Olaf Kirch [Thu, 13 Dec 2007 18:43:21 +0000 (12:43 -0600)]
[SCSI] iscsi_tcp: rewrite recv path

Rewrite recv path. Fixes:
- data digest processing and error handling.
- ahs support.

Some fixups by Mike Christie

Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libiscsi, iscsi_tcp: add device support
Mike Christie [Thu, 13 Dec 2007 18:43:20 +0000 (12:43 -0600)]
[SCSI] libiscsi, iscsi_tcp: add device support

This patch adds logical unit reset support. This should work for ib_iser,
but I have not finished testing that driver so it is not hooked in yet.

This patch also temporarily reverts the iscsi_tcp r2t write out patch.
That code is completely rewritten in this patchset.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] make pcmcia directory use obj-y|m instead of subdir-y|m
Tejun Heo [Fri, 7 Dec 2007 13:36:23 +0000 (22:36 +0900)]
[SCSI] make pcmcia directory use obj-y|m instead of subdir-y|m

subdir-y|m isn't supposed to contain modules or built-in components.
Change subdir-$(CONFIG_PCMCIA) to obj-$(CONFIG_PCMCIA).

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ipr: use LIST_HEAD instead of LIST_HEAD_INIT
Denis Cheng [Fri, 14 Dec 2007 00:14:27 +0000 (16:14 -0800)]
[SCSI] ipr: use LIST_HEAD instead of LIST_HEAD_INIT

Signed-off-by: Denis Cheng <crquan@gmail.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] gdth: kill unneeded 'irq' argument
Jeff Garzik [Fri, 14 Dec 2007 00:14:12 +0000 (16:14 -0800)]
[SCSI] gdth: kill unneeded 'irq' argument

Neither gdth_get_status() nor __gdth_interrupt() need their 'irq' argument,
so remove it.

[akpm@linux-foundation.org: coding style fixes]
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] sym53c416: kill pointless irq handler loop and test
Jeff Garzik [Fri, 14 Dec 2007 00:14:13 +0000 (16:14 -0800)]
[SCSI] sym53c416: kill pointless irq handler loop and test

- kill pointless irq handler loop to find base address, it is already
  passed to irq handler via Scsi_Host.

- kill now-pointless !base test.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] NCR5380: minor irq handler cleanups
Jeff Garzik [Fri, 14 Dec 2007 00:14:14 +0000 (16:14 -0800)]
[SCSI] NCR5380: minor irq handler cleanups

* remove unnecessary cast

* remove unnecessary use of 'irq' function arg

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] sgiwd93: export sgiwd93_reset()
Andrew Morton [Fri, 14 Dec 2007 00:14:23 +0000 (16:14 -0800)]
[SCSI] sgiwd93: export sgiwd93_reset()

mips allmodconfig:

ERROR: "sgiwd93_reset" [drivers/scsi/wd33c93.ko] undefined!

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aacraid: fix driver failure with Dell PowerEdge Expandable RAID Controller...
Salyzyn, Mark [Fri, 14 Dec 2007 00:14:18 +0000 (16:14 -0800)]
[SCSI] aacraid: fix driver failure with Dell PowerEdge Expandable RAID Controller 3/Di

As reported in http://bugzilla.kernel.org/show_bug.cgi?id=3D9133 it was
discovered that the PERC line of controllers lacked a key 64 bit
ScatterGather capable SCSI pass-through function. The adapters are still
capable of 64 bit ScatterGather I/O commands, but these two can not be
mixed. This problem was exacerbated by the introduction of the SCSI
Generic access to the DASD physical devices.

The fix for users before this patch is applied is aacraid.dacmode=3D0 on
the kernel command line to disable 64 bit I/O.

The enclosed patch introduces a new adapter quirk and tries to limp
along by enabling pass-through in situations where memory is 32 bit
addressable on 64 bit machines, or disable the pass-through functions
altogether. I expect that the check for 32 bit addressable memory to be
controversial in that it can be incorrect in non-Dell non-Intel systems
that PERC would never be installed under, the alternative is to disable
pass-through in all cases which could be reported as another regression.

Pass-through is used for SCSI Generic access to the physical devices, or
for the management applications to properly function.

In systems where this patch has disabled pass-through because it is
unsupportable in combination with I/O performance, the user can choose
to enable pass-through by turning off dacmode (aacraid.dacmode=3D0) or
limiting the discovered kernel memory (mem=3D4G) with an associated loss
in runtime performance. If we chose instead to turn off 64 bit dacmode
for the adapters with this quirk, then this would be reported as another
regression.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] hptiop: add more adapter models and other fixes
HighPoint Linux Team [Fri, 14 Dec 2007 00:14:26 +0000 (16:14 -0800)]
[SCSI] hptiop: add more adapter models and other fixes

Most code changes were made to support adapters based on Marvell IOP, plus some
other fixes.

- add more PCI device IDs
- support for adapters based on Marvell IOP
- fix a result code translation error on big-endian systems
- fix resource releasing bug when scsi_host_alloc() fail in hptiop_probe()
- update scsi_cmnd.resid when finishing a request
- correct some coding style issues

[akpm@linux-foundation.org: type fixes]
Signed-off-by: HighPoint Linux Team <linux@highpoint-tech.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic94xx: fix section mismatches
Randy Dunlap [Mon, 29 Oct 2007 18:20:35 +0000 (11:20 -0700)]
[SCSI] aic94xx: fix section mismatches

Fix section mismatch warning:

WARNING: vmlinux.o(.init.text+0x23be6): Section mismatch: reference to .exit.text:asd_unmap_ha (between 'asd_pci_probe' and 'qla4xxx_module_init')
+
WARNING: vmlinux.o(.text+0x1ec8a8): Section mismatch: reference to .exit.text:as
d_unmap_ioport (between 'asd_unmap_ha' and 'asd_remove_dev_attrs')
WARNING: vmlinux.o(.text+0x1ec8b1): Section mismatch: reference to .exit.text:as
d_unmap_memio (between 'asd_unmap_ha' and 'asd_remove_dev_attrs')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ips: handle scsi_add_host() failure, and other err cleanups
Jeff Garzik [Fri, 14 Dec 2007 00:14:10 +0000 (16:14 -0800)]
[SCSI] ips: handle scsi_add_host() failure, and other err cleanups

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ips: PCI API cleanups
Jeff Garzik [Fri, 14 Dec 2007 00:14:09 +0000 (16:14 -0800)]
[SCSI] ips: PCI API cleanups

* pass Scsi_Host to ips_remove_device() via pci_set_drvdata(),
  allowing us to eliminate the ips_ha[] search loop and call
  ips_release() directly.

* call pci_{request,release}_regions() and eliminate individual
  request/release_[mem_]region() calls

* call pci_disable_device(), paired with pci_enable_device()

* s/0/NULL/ in a few places

* check ioremap() return value

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ips: trim trailing whitespace
Jeff Garzik [Fri, 14 Dec 2007 00:14:08 +0000 (16:14 -0800)]
[SCSI] ips: trim trailing whitespace

[akpm@linux-foundation.org: coding style fixes]
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ips: remove ips_ha members that duplicate struct pci_dev members
Jeff Garzik [Fri, 14 Dec 2007 00:14:07 +0000 (16:14 -0800)]
[SCSI] ips: remove ips_ha members that duplicate struct pci_dev members

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] sym2: fix section mismatch warning
Randy Dunlap [Mon, 29 Oct 2007 18:20:40 +0000 (11:20 -0700)]
[SCSI] sym2: fix section mismatch warning

Fix section mismatch warning:

WARNING: vmlinux.o(.text+0x1ff3a2): Section mismatch: reference to .exit.text:sym2_remove (between 'sym2_io_error_detected' and 'sym_xpt_done')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc: minor cleanups
Adrian Bunk [Mon, 5 Nov 2007 17:07:33 +0000 (18:07 +0100)]
[SCSI] lpfc: minor cleanups

This patch contains the following minor cleanups:
- make the following needlessly global functions static:
  - lpfc_els.c: lpfc_register_new_vport()
  - lpfc_els.c: lpfc_issue_els_fdisc()
  - lpfc_els.c: lpfc_issue_fabric_iocb()
  - lpfc_els.c: lpfc_fabric_abort_vport()
  - lpfc_hbadisc.c: lpfc_dev_loss_tmo_handler()
  - lpfc_hbadisc.c: lpfc_mbx_cmpl_clear_la()
  - lpfc_hbadisc.c: lpfc_disc_flush_list()
  - lpfc_hbadisc.c: __lpfc_find_node()
  - lpfc_init.c: lpfc_hb_timeout()
  - lpfc_init.c: lpfc_block_mgmt_io()
  - lpfc_sli.c: __lpfc_sli_release_iocbq()
  - lpfc_sli.c: lpfc_sli_next_hbq_slot()
  - lpfc_sli.c: lpfc_sli_hbqbuf_init_hbqs()
  - lpfc_sli.c: lpfc_sli_hbqbuf_find()
  - lpfc_sli.c: __lpfc_sli_issue_iocb()
- #if 0 the following unused global functions:
  - lpfc_els.c: lpfc_fabric_abort_flogi()
  - lpfc_hbadisc.c: lpfc_find_node()
  - lpfc_hbadisc.c: lpfc_findnode_rpi()
- remove the unused exports

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] sd,sr: add early detection of medium not present
James Bottomley [Sun, 2 Dec 2007 17:10:40 +0000 (19:10 +0200)]
[SCSI] sd,sr: add early detection of medium not present

The current scsi_test_unit_ready() is updated to return sense code
information (in struct scsi_sense_hdr).  The sd and sr drivers are
changed to interpret the sense code return asc 0x3a as no media and
adjust the device status accordingly.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] BUG_ON() impossible condition in sg list counting
Rusty Russell [Mon, 19 Nov 2007 00:28:48 +0000 (11:28 +1100)]
[SCSI] BUG_ON() impossible condition in sg list counting

If blk_rq_map_sg wrote more than was allocated in the scatterlist,
BUG_ON() is probably the right thing to do.

[jejb: rejections fixed up]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] tgt: fix build when dprintk is defined
Randy Dunlap [Thu, 15 Nov 2007 09:53:25 +0000 (11:53 +0200)]
[SCSI] tgt: fix build when dprintk is defined

Fix scsi_tgt_lib build when dprintk is defined:
Also fix accessors problem when dprintk is defined

drivers/scsi/scsi_tgt_lib.c: In function 'scsi_tgt_cmd_destroy':
drivers/scsi/scsi_tgt_lib.c:183: warning: format '%lu' expects type 'long unsigned int', but argument 6 has type 'unsigned int'
drivers/scsi/scsi_tgt_lib.c: In function 'scsi_tgt_cmd_done':
drivers/scsi/scsi_tgt_lib.c:330: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'unsigned int'
drivers/scsi/scsi_tgt_lib.c: In function 'scsi_tgt_transfer_response':
drivers/scsi/scsi_tgt_lib.c:345: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'unsigned int'
drivers/scsi/scsi_tgt_lib.c: In function 'scsi_tgt_init_cmd':
drivers/scsi/scsi_tgt_lib.c:368: warning: format '%lu' expects type 'long unsigned int', but argument 6 has type 'unsigned int'
drivers/scsi/scsi_tgt_lib.c: In function 'scsi_tgt_kspace_exec':
drivers/scsi/scsi_tgt_lib.c:499: warning: format '%lu' expects type 'long unsigned int', but argument 9 has type 'unsigned int'
drivers/scsi/scsi_tgt_lib.c: In function 'scsi_tgt_kspace_it_nexus_rsp':
drivers/scsi/scsi_tgt_lib.c:620: error: 'mid' undeclared (first use in this function)
drivers/scsi/scsi_tgt_lib.c:620: error: (Each undeclared identifier is reported only once
drivers/scsi/scsi_tgt_lib.c:620: error: for each function it appears in.)
make[2]: *** [drivers/scsi/scsi_tgt_lib.o] Error 1

[tomo:
> -     dprintk("%d %d %llx\n", host_no, result, (unsigned long long) mid);
> +     dprintk("%d %d\n", host_no, result);

'mid' is a typo. I wanted to do:

        dprintk("%d %d %llx\n", host_no, result, (unsigned long long)itn_id);

The rest looks ok. Thanks,
]

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aacraid: don't assign cpu_to_le32(int) to u8
Christoph Hellwig [Thu, 8 Nov 2007 17:27:47 +0000 (17:27 +0000)]
[SCSI] aacraid: don't assign cpu_to_le32(int) to u8

On Wed, Nov 07, 2007 at 01:51:44PM -0500, Salyzyn, Mark wrote:
> Christoph Hellwig [mailto:hch@infradead.org] sez:
> > Did anyone run the driver through sparse to see if we have
> > more issues like this?
>
> There are some warnings from sparse, none like this one. I will deal
> with the warnings ...

Actually there are a lot of endianess warnings, fortunately most of them
harmless.  The patch below fixes all of them up (including the ones in
the patch I replied to), except for aac_init_adapter which is really odd
and I don't know what to do.

[jejb fixed up rejections and checkpatch issues]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Update version number to 8.02.00-k6.
Andrew Vasquez [Mon, 12 Nov 2007 18:31:00 +0000 (10:31 -0800)]
[SCSI] qla2xxx: Update version number to 8.02.00-k6.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Properly handle Vport state-change-notifications.
Shyam Sundar [Mon, 12 Nov 2007 18:30:59 +0000 (10:30 -0800)]
[SCSI] qla2xxx: Properly handle Vport state-change-notifications.

Drivers do SCRs for each Vport. When something changes in the
fabric, firmware generates one interrupt for each RSCN. Based on
the current implementation, in each case, we make recursive calls
to handle RSCN for physical and each subsequent virtual ports.
The fix is to also take into consideration the vp_idx, which is
set by the firmware to indicate the vport the RSCN was meant for.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Correct NPIV support for recent ISPs.
Andrew Vasquez [Mon, 12 Nov 2007 18:30:58 +0000 (10:30 -0800)]
[SCSI] qla2xxx: Correct NPIV support for recent ISPs.

Firmware will export to software the maximum number of vports
supported for any given firmware version and ISP type.  Use this
information rather than the current hardcoding of limitations
within the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qla2xxx: Don't explicitly read mbx registers while processing a system-error.
Andrew Vasquez [Mon, 12 Nov 2007 18:30:57 +0000 (10:30 -0800)]
[SCSI] qla2xxx: Don't explicitly read mbx registers while processing a system-error.

Callers of qla2x00_async_event() already populate the mb[] array
upon invocation, doing so via the appropriate mailbox register
accessors.  The stale codes removed are leftover-bits kept during
the FWI2 transition.  Though relatively benign, the extra-reads
are not valid for FWI2 boards (ISP24xx and above) and peek into
the incorrect regions of registers.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ibmvscsi: requeue while CRQ closed
Robert Jennings [Mon, 12 Nov 2007 15:00:23 +0000 (09:00 -0600)]
[SCSI] ibmvscsi: requeue while CRQ closed

CRQ send errors that return with H_CLOSED should return with
SCSI_MLQUEUE_HOST_BUSY until firmware alerts the client of a CRQ
transport event.  The transport event will either reinitialize and
requeue the requests or fail and return IO with DID_ERROR.

To avoid failing the eh_* functions while re-attaching to the server
adapter this will retry for a period of time while ibmvscsi_send_srp_event
returns SCSI_MLQUEUE_HOST_BUSY.

In ibmvscsi_eh_abort_handler() the loop includes the search of the
event list.  The lock on the hostdata is dropped while waiting to try
again after failing ibmvscsi_send_srp_event.  The event could have been
purged if a login was in progress when the function was called.

In ibmvscsi_eh_device_reset_handler() the loop includes the call to
get_event_struct() because a failing call to ibmvscsi_send_srp_event()
will have freed the event struct.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] docbook and kernel-doc updates
Randy Dunlap [Thu, 15 Nov 2007 23:42:30 +0000 (15:42 -0800)]
[SCSI] docbook and kernel-doc updates

- Change title to remove "Mid-Layer" since the doc is about all of the
SCSI layers.
- Use "SCSI" instead of "scsi" in docbook text.
- Use "*/" to end kernel-doc notation blocks.
- A few other minor typo fixes.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] kernel-doc: use correct function name
Randy Dunlap [Fri, 16 Nov 2007 01:07:28 +0000 (17:07 -0800)]
[SCSI] kernel-doc: use correct function name

Use correct function name in kernel-doc.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] boot options: correct option name and tell where to find docs for it
Randy Dunlap [Thu, 15 Nov 2007 00:52:25 +0000 (16:52 -0800)]
[SCSI] boot options: correct option name and tell where to find docs for it

Minor corrections and additions to 'scsi_logging_level', as pointed out
by Chuck Ebbert.
Also point out the IBM S390-tools 'scsi_logging_level' script.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] move single_lun flag from scsi_device to scsi_target
Tony Battersby [Mon, 12 Nov 2007 15:00:44 +0000 (10:00 -0500)]
[SCSI] move single_lun flag from scsi_device to scsi_target

Some SCSI tape medium changers that need the BLIST_SINGLELUN flag have
the medium changer at one LUN and the tape drive at a different LUN.
The inquiry string of the tape drive may be different from that of the
medium changer.  In order for single_lun to be effective, every
scsi_device under a given scsi_target must have it set.  This means that
there needs to be a blacklist entry for BOTH the medium changer AND the
tape drive, which is impractical because some medium changers may be
paired with a variety of different tape drive models.  It makes more
sense to put the single_lun flag in scsi_target instead of scsi_device,
which causes every device at a given target ID to inherit the single_lun
flag from one LUN.  This makes it possible to blacklist just the medium
changer and not the tape drive.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: Update version and changelog
bo yang [Fri, 9 Nov 2007 09:44:56 +0000 (04:44 -0500)]
[SCSI] megaraid_sas: Update version and changelog

Update version and changelog

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: support for poll_mode_io (reduced interrupt)
bo yang [Fri, 9 Nov 2007 09:40:16 +0000 (04:40 -0500)]
[SCSI] megaraid_sas: support for poll_mode_io (reduced interrupt)

Added module parameter "poll_mode_io" to support for "polling"
(reduced interrupt operation).  In this mode, IO completion interrupts
are delayed. At the end of initiating IOs, the driver schedules for
cmd completion if there are pending cmds.  A timer-based interrupt has
also been added to prevent IO completion from being delayed
indefinitely in the case that no new IOs are initiated.  Some
formatting issues in resume, suspend comment block also corrected

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: call cmd completion from reset
bo yang [Fri, 9 Nov 2007 09:35:44 +0000 (04:35 -0500)]
[SCSI] megaraid_sas: call cmd completion from reset

Driver will call cmd completion routine from Reset path without waiting for cmd completion from isr context.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: use unsigned long for sense_buff ptr
bo yang [Fri, 9 Nov 2007 09:28:47 +0000 (04:28 -0500)]
[SCSI] megaraid_sas: use unsigned long for sense_buff ptr

MegaRAID utilities expect sense_buff to be of type unsigned long.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: check max_sgl reported by FW for setting max_sectors_per_req
bo yang [Fri, 9 Nov 2007 09:14:00 +0000 (04:14 -0500)]
[SCSI] megaraid_sas: check max_sgl reported by FW for setting max_sectors_per_req

1. Setting the max_sectors_per_req based on max SGL supported by the
   FW. Prior versions calculated this value from controller info's
   max_sectors_1, max_sectors_2. For certain controllers/FW, this was
   resulting in a value greater than max SGL supported by the FW. Now
   we take the min of max sgl from FW and max_sectors calculation.

2. Increased MFI_POLL_TIMEOUT_SECS to 60 seconds from 10. FW may take
   a max of 60 seconds to respond to the INIT cmd.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: add hibernation support
bo yang [Wed, 7 Nov 2007 17:09:50 +0000 (12:09 -0500)]
[SCSI] megaraid_sas: add hibernation support

Adding hibernation support. suspend, resume routine implemented.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] 3w-9xxx: fix abysmal write performance on some motherboards
Tony Battersby [Fri, 9 Nov 2007 18:04:35 +0000 (13:04 -0500)]
[SCSI] 3w-9xxx: fix abysmal write performance on some motherboards

The 3ware 9500S-8 SATA RAID controller exhibits terrible write
performance when PCI memory-write-and-invalidate is disabled.  This is
easy to demonstrate by replacing pci_try_set_mwi() in the patch below
with pci_clear_mwi().  My benchmarks show the following:

MWI disabled: 15 MB/s write, 330 MB/s read
MWI enabled:  240 MB/s write, 330 MB/s read

Most motherboards will enable MWI without the driver having to set it
explicitly, so most people probably wouldn't encounter this problem.
For the few motherboards that don't enable it, this patch could give a
16x performance improvement for writing.

This issue does not seem to affect the 9550SX controller, but the patch
doesn't hurt it either.  I haven't tested any of the other 3ware
controllers.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Acked-by: adam radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: Fix various sparse complaints
Darrick J. Wong [Mon, 5 Nov 2007 19:52:14 +0000 (11:52 -0800)]
[SCSI] libsas: Fix various sparse complaints

Annotate sas_queuecommand with locking details, and clean up a few
more sparse warnings about static/non-static declarations.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] libsas: Convert sas_proto users to sas_protocol
Darrick J. Wong [Mon, 5 Nov 2007 19:51:17 +0000 (11:51 -0800)]
[SCSI] libsas: Convert sas_proto users to sas_protocol

sparse complains about the mixing of enums in libsas.  Since the
underlying numeric values of both enums are the same, combine them
to get rid of the warning.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] megaraid_sas: Convert aen_mutex to the mutex API
Matthias Kaehlcke [Sat, 27 Oct 2007 07:48:46 +0000 (09:48 +0200)]
[SCSI] megaraid_sas: Convert aen_mutex to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Acked-by: Bo Yang <Bo.Yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] imm: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:13:42 +0000 (21:13 +0300)]
[SCSI] imm: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup
 - Not ready for sg-chaining

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ppa: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:16:58 +0000 (21:16 +0300)]
[SCSI] ppa: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] DocBook scsi_midlayer.tmpl->scsi.tmpl
James Bottomley [Thu, 15 Nov 2007 00:01:21 +0000 (18:01 -0600)]
[SCSI] DocBook scsi_midlayer.tmpl->scsi.tmpl

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] Add Documentation and integrate into docbook build
Rob Landley [Sat, 3 Nov 2007 18:30:39 +0000 (13:30 -0500)]
[SCSI] Add Documentation and integrate into docbook build

Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update
lots of kerneldoc comments in drivers/scsi/*.

Updated with comments from Stefan Richter, Stephen M. Cameron,
 James Bottomley and Randy Dunlap.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Reduce flood on hba trace
Christof Schmitt [Mon, 5 Nov 2007 11:37:48 +0000 (12:37 +0100)]
[SCSI] zfcp: Reduce flood on hba trace

Remove tracing for request with a "qualifier" field set in the
response.  The protocol status qualifier now contains measurement
data for "good" commands, so this check would trace every response
by default.

The fix is to simply remove the "qual" tracing: The responses with an
interesting status are also traced as "ferr" or "perr" and all
responses can be traced as "norm" with a higher trace level.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Fix deadlock when adding invalid LUN
Christof Schmitt [Mon, 5 Nov 2007 11:37:47 +0000 (12:37 +0100)]
[SCSI] zfcp: Fix deadlock when adding invalid LUN

When adding an invalid LUN, there is a deadlock between the add
via scsi_scan_target and the slave_destroy handler: The handler
waits for the scan to complete, but for an invalid unit,
scsi_scan_target directly calls the slave_destroy handler.

Fix the deadlock by removing the wait in the slave_destroy
handler, it was not necessary anyway.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Remove SCSI devices when removing complete adapter
Christof Schmitt [Mon, 5 Nov 2007 11:37:46 +0000 (12:37 +0100)]
[SCSI] zfcp: Remove SCSI devices when removing complete adapter

The common I/O layer can call remove a handler to inform zfcp
that a device disappeared. The handler zfcp_ccw_remove then
removes all unit, port and the adapter data structures. Removing
the units requires that the SCSI devices are removed first.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Specify waiting times in ERP in seconds
Christof Schmitt [Mon, 5 Nov 2007 11:37:45 +0000 (12:37 +0100)]
[SCSI] zfcp: Specify waiting times in ERP in seconds

It is not necessary to use jiffies or milliseconds to specify
waiting times that last a couple of seconds.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Use also port and adapter to identify unit in messages.
Christof Schmitt [Mon, 5 Nov 2007 11:37:44 +0000 (12:37 +0100)]
[SCSI] zfcp: Use also port and adapter to identify unit in messages.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] zfcp: Remove unnecessary eh_bus_reset_handler callback
Christof Schmitt [Mon, 5 Nov 2007 11:37:43 +0000 (12:37 +0100)]
[SCSI] zfcp: Remove unnecessary eh_bus_reset_handler callback

The callback function used by zfcp always returns success,
which is an indication for the SCSI midlayer to stop error
handling. Remove the bus_reset callback, since the same
function will be called via the host_reset callback.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aacraid: forced reset override
Salyzyn, Mark [Tue, 30 Oct 2007 19:50:49 +0000 (15:50 -0400)]
[SCSI] aacraid: forced reset override

Some of our vendors have requested that our adapters ignore the hardware
reset attempts during recovery and have enforced this with changes in
Adapter Firmware. Some of our customers have requested the option to be
able to reset the adapter under adverse adapter failure, we even had a
few defects reported here considering it a regression that the Adapter
could not be reset. This patch addresses this dichotomy. The user can
force the adapter to be reset if it supports the IOP_RESET_ALWAYS
command, in cases where the adapter has been programmed to ignore the
reset, by setting the aacraid.check_reset parameter to a value of -1.

The driver will not reset an Adapter that does not support the reset
command(s).

This patch also fixes and cleans up some of the logic associated with
resetting the adapter.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] NCR5380 family: convert to accessors & !use_sg cleanup
Boaz Harrosh [Mon, 5 Nov 2007 09:23:35 +0000 (11:23 +0200)]
[SCSI] NCR5380 family: convert to accessors & !use_sg cleanup

  - This patch depends on:
      NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
  - convert to accessors and !use_sg cleanup
  - FIXME: Not sg-chain ready look for ++cmd->SCp.buffer

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] wd7000: proper fix for boards without sg support
Boaz Harrosh [Mon, 5 Nov 2007 09:21:40 +0000 (11:21 +0200)]
[SCSI] wd7000: proper fix for boards without sg support

  - code used to set sg_tablesize to zero for board revision
    less than 6. This is no longer supported, therefore I
    use sg_tablesize=1 and open code the sg handling for that case.
  - Get rid of use of SG_NONE which will be removed soon.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] atp870u: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:06:23 +0000 (21:06 +0300)]
[SCSI] atp870u: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup
 - Probably not ready for sg-chaining

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Christoph Hellwig <hch@infradead.org>
Cc: jameshsu <jameshsu@acard.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] scsi_debug: convert to use the data buffer accessors
Boaz Harrosh [Thu, 6 Sep 2007 21:50:20 +0000 (06:50 +0900)]
[SCSI] scsi_debug: convert to use the data buffer accessors

  - remove the unnecessary map_single path.
  - convert to use the new accessors for the sg lists and the
    parameters.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] isd200: use one-element sg list in issuing commands
Boaz Harrosh [Wed, 22 Aug 2007 16:10:45 +0000 (19:10 +0300)]
[SCSI] isd200: use one-element sg list in issuing commands

  - This patch should be commited before:
    usb: transport - convert to accessors and !use_sg code path removal

  - isd200_action() was still using direct liniar pointers in issuing
    commands to the USB transport level. This is no longer supported,
    use one-element scatterlist instead.
  - Adjustment of command's length in the case of scsi-to-ata translation
    is now restored before return to queuecommand, since other wise it can
    leak BIOs.
  - isd200_action() return Error on unknown requests. Used to print an error
    but still try to send garbage cdb.
  - convert few places to scsi data accessors.
  - Todo: This file will need to be changed when scsi_cmnd changes to
    scsi_data_buffer or any other solution.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] usb: transport - convert to accessors and !use_sg code path removal
Boaz Harrosh [Mon, 10 Sep 2007 15:01:08 +0000 (18:01 +0300)]
[SCSI] usb: transport - convert to accessors and !use_sg code path removal

  - This patch depends on:
    usb: transport.c use scsi_eh API in REQUEST_SENSE execution

  - Use scsi data accessors and remove of !use_sg code path.
  - New usb_stor_bulk_srb() for use by drivers

[jejb: updated with corrective fix.

had a bug in residual handling in the new usb_stor_bulk_srb()
function.  Found by Gabriel C. in -mm tree.

Tested-by: Gabriel C <nix.or.die@googlemail.com>
]

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] usb: shuttle_usbat - convert to accessors and !use_sg code path removal
Boaz Harrosh [Sun, 9 Sep 2007 17:40:56 +0000 (20:40 +0300)]
[SCSI] usb: shuttle_usbat - convert to accessors and !use_sg code path removal

 - functions that received char* but where passed scatterlist* mostly
   were changed to receive void*
 - Use scsi data accessors and remove of !use_sg code path

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] usb: freecom & sddr09 - convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 17:47:26 +0000 (20:47 +0300)]
[SCSI] usb: freecom & sddr09 - convert to accessors and !use_sg cleanup

 - Use scsi data accessors and remove of !use_sg code path
 - This patch is dependent on cleanup patch to usb transport.c/h

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] usb: protocol - convert to accessors and !use_sg code path removal
Boaz Harrosh [Sun, 9 Sep 2007 17:22:23 +0000 (20:22 +0300)]
[SCSI] usb: protocol - convert to accessors and !use_sg code path removal

 - Use scsi data accessors and remove of !use_sg code path

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] seagate: Remove driver
Boaz Harrosh [Wed, 17 Oct 2007 08:43:20 +0000 (10:43 +0200)]
[SCSI] seagate: Remove driver

  - Apparently no one wonts this driver, and no one
    is willing to fix it for future changes to SCSI.
    So remove it, and if someone wants it in the future
    He can revive it with the needed fixes.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] psi240i: remove driver
Boaz Harrosh [Thu, 12 Jul 2007 16:49:15 +0000 (19:49 +0300)]
[SCSI] psi240i: remove driver

The psi240i driver is still written for cmnd->request_buffer
as a char pointer to actual data. There was never any attempt
to use the scatterlist option.

  - remove all source files (3) from drivers/scsi
  - Remove from Makefile and Kconfig

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] in2000: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:14:41 +0000 (21:14 +0300)]
[SCSI] in2000: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] qlogicpti: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:21:35 +0000 (21:21 +0300)]
[SCSI] qlogicpti: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] wd33c93: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:25:11 +0000 (21:25 +0300)]
[SCSI] wd33c93: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] fd_mcs: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:12:24 +0000 (21:12 +0300)]
[SCSI] fd_mcs: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup
 - Not ready for sg-chaining

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aha1542: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:02:45 +0000 (21:02 +0300)]
[SCSI] aha1542: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] a3000: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 17:59:32 +0000 (20:59 +0300)]
[SCSI] a3000: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] a2091: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 17:57:05 +0000 (20:57 +0300)]
[SCSI] a2091: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] eata_pio: convert to accessors and !use_sg cleanup
Boaz Harrosh [Sun, 9 Sep 2007 18:10:27 +0000 (21:10 +0300)]
[SCSI] eata_pio: convert to accessors and !use_sg cleanup

 - convert to accessors and !use_sg cleanup

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] nsp_cs: convert to data accessors and !use_sg cleanup
Boaz Harrosh [Thu, 16 Aug 2007 10:01:05 +0000 (13:01 +0300)]
[SCSI] nsp_cs: convert to data accessors and !use_sg cleanup

  - use scsi data accessors
  - cleanup !use_sg code paths
  - TODO: use next_sg() for Jens's sglist branch. Look for 2
    places with "SCp.buffer++"

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aha152x: Use scsi_eh API for REQUEST_SENSE invocation
Boaz Harrosh [Thu, 1 Nov 2007 16:54:44 +0000 (18:54 +0200)]
[SCSI] aha152x: Use scsi_eh API for REQUEST_SENSE invocation

  - Use new scsi_eh_prep/restor_cmnd() for synchronous
    REQUEST_SENSE invocation.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] add DID_REQUEUE string to scsi_show_result host table
Mike Christie [Thu, 1 Nov 2007 01:59:56 +0000 (20:59 -0500)]
[SCSI] add DID_REQUEUE string to scsi_show_result host table

I was working on patches which add new transport error values, when I
noticed that DID_REQUEUE was not in the hostbyte_table. I do not think
there is any way to hit the code path where scsi_show_result is called
and where you return DID_REQUEUE, because DID_REQUEUE causes scsi-ml to
always requeue the command. However, for completeness and because I want
to one day send a patch that tries to add new host bytes values, I am
sending this patch.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Change version number to 8.2.3
James Smart [Sat, 27 Oct 2007 17:38:20 +0000 (13:38 -0400)]
[SCSI] lpfc 8.2.3 : Change version number to 8.2.3

Change version number to 8.2.3

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Temperature handling fix
James Smart [Sat, 27 Oct 2007 17:38:11 +0000 (13:38 -0400)]
[SCSI] lpfc 8.2.3 : Temperature handling fix

Temperature handling fix - return proper error code indicator for applications

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Internal loopback fixes
James Smart [Sat, 27 Oct 2007 17:38:00 +0000 (13:38 -0400)]
[SCSI] lpfc 8.2.3 : Internal loopback fixes

Internal loopback fixes:
- Use HBQs rather than Q_RING_BUFF
- Correct HBQs continuation entries
- Update CT handler to SLI3 iocbs

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 2
James Smart [Sat, 27 Oct 2007 17:37:53 +0000 (13:37 -0400)]
[SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 2

Miscellaneous Small Fixes - part 2

- Fix ndlp left in PLOGI state after link up
- Fix cannot rcv unsol ELS frames after running HBA resets for a few minutes
- Fix HBQ buffer_count implemention
- Fix RPI leak
- Fix crash while deleting vports while HBA is reset
- Revert the FCP Fbits offset back to 7
- Fix panic when deleting vports
- Remove unused code in switch statement outside of a case
- Reject PLOGI from invalid PName or NName of 0
- Ignore PLOGI responses from WWPName or WWNName of 0
- Fix debugfs hbqinfo display for ppc
- Added 8G to list of supported speeds for sysfs parameter
- Defer ndlp cleanup to dev-loss timeout handler
- Added support for WRITE_VPARMS mailbox command by applications

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : FC Discovery Fixes
James Smart [Sat, 27 Oct 2007 17:37:43 +0000 (13:37 -0400)]
[SCSI] lpfc 8.2.3 : FC Discovery Fixes

FC Discovery Fixes:
- Fix up lpfc_drop_node() vs lpfc_nlp_not_used() usage
- Clear ADISC flag when unregistering RPI and REMOVE ndlps if in recovery.
- Fix usage of UNUSED list and ndlps
- Fix PLOGI race conditions
- Reset link if NameServer PLOGI errors occur
- Synchronize GID_FT queries with PLOGI receptions

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 1
James Smart [Sat, 27 Oct 2007 17:37:33 +0000 (13:37 -0400)]
[SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 1

Miscellaneous Small Fixes - part 1
- Fix typo kmzlloc -> kzalloc
- Fix discovery ndlp use after free panic
- Fix link event causing flood of 0108 messages
- Relieve some mbox congestion on link up with 100 vports
- Fix broken vport parameters
- Prevent lock recursion in logo_reglogin_issue
- Split uses of error variable in lpfc_pci_probe_one into retval and error
- Remove completion code related to dev_loss_tmo
- Remove unused LPFC_MAX_HBQ #define
- Don't compare pointers to 0 for sparse
- Make 2 functions static for sparse
- Fix default rpi cleanup code causing rogue ndlps to remain on the NPR list
- Remove annoying ELS messages when driver is unloaded
- Fix Cannot issue Register Fabric login problems on link up
- Remove LPFC_EVT_DEV_LOSS_DELAY
- Fix FC port swap test leads to device going offline
- Fix vport CT flags to only be set when accepted
- Add code to handle signals during vport_create
- Fix too many retries in FC-AL mode
- Pull lpfc_port_link_failure out of lpfc_linkdown_port

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Remove flawed MBX_STOP_IOCB logic
James Smart [Sat, 27 Oct 2007 17:37:25 +0000 (13:37 -0400)]
[SCSI] lpfc 8.2.3 : Remove flawed MBX_STOP_IOCB logic

Remove flawed MBX_STOP_IOCB logic

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : NPIV bug fixes
James Smart [Sat, 27 Oct 2007 17:37:17 +0000 (13:37 -0400)]
[SCSI] lpfc 8.2.3 : NPIV bug fixes

NPIV bug fixes:
- Remove vport params on physical hba when npiv is disabled
- Implement new DA_ID CT command to remove vport information from
  the switch after delete. Some switches didn't clean this up unless
  the physical link dropped.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] lpfc 8.2.3 : Added support for ASICs that report temperature
James Smart [Sat, 27 Oct 2007 17:37:05 +0000 (13:37 -0400)]
[SCSI] lpfc 8.2.3 : Added support for ASICs that report temperature

Added support for ASICs that report temperature. Temperature notices are
 reported as events and logged. Temperature can be read via sysfs.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] ibmvscsi: Set default command timeout
Brian King [Thu, 25 Oct 2007 21:06:34 +0000 (16:06 -0500)]
[SCSI] ibmvscsi: Set default command timeout

Set the default command timeout for ibmvscsi disks to 60 seconds
to ensure we don't prematurely timeout commands. This fixes a problem
seen where the default 30 seconds was not long enough due to
congestion on the server.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] 53c7xx: fix removal fallout
Adrian Bunk [Wed, 24 Oct 2007 16:26:22 +0000 (18:26 +0200)]
[SCSI] 53c7xx: fix removal fallout

This patch does some additional cleanups after the 53c7xx removal.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] tgt: convert to use the data buffer accessors
FUJITA Tomonori [Wed, 24 Oct 2007 16:21:30 +0000 (01:21 +0900)]
[SCSI] tgt: convert to use the data buffer accessors

- convert to use the new accessors for the sg lists and the
parameters.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] aic94xx: update BIOS image from user space.
Gilbert Wu [Mon, 22 Oct 2007 22:19:11 +0000 (15:19 -0700)]
[SCSI] aic94xx: update BIOS image from user space.

 1. Create a file "update_bios" in sysfs to allow user to update bios
    from user space.

 2. The BIOS image file can be downloaded from web site

"http://www.adaptec.com/en-US/downloads/bios_fw/bios_fw_ver?productId=SAS-48300&dn=Adaptec+Serial+Attached+SCSI+48300"
    and copy the BIOS image into /lib/firmware folder.

 3. The aic994xx will accept "update bios_file" and "verify bios_file"
    commands to perform update and verify BIOS image .

    For example:

     Type "echo "update asc483c01.ufi" > /sys/devices/.../update_bios"
          to update BIOS image from /lib/firmware/as483c01.ufi file into
          HBA's flash memory.

     Type "echo "verify asc483c01.ufi" > /sys/devices/.../update_bios"
          to verify BIOS image between /lib/firmware/asc48c01.ufi file
and
          HBA's flash memory.

 4. Type "cat  /sys/devices/.../update_bios" to view the status or
result
    of updating BIOS.

Signed-off-by: Gilbert Wu <gilbert_wu@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years ago[SCSI] sr,sd: send media state change modification events
Kay Sievers [Tue, 14 Aug 2007 12:10:39 +0000 (14:10 +0200)]
[SCSI] sr,sd: send media state change modification events

This will send for a card reader slot (remove/add media):
  UEVENT[1187091572.155884] change   /devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)
  UEVENT[1187091572.162314] remove   /block/sdb/sdb1 (block)
  UEVENT[1187091572.172464] add      /block/sdb/sdb1 (block)
  UEVENT[1187091572.175408] change   /devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)

and for a DVD drive (add/eject media):
  UEVENT[1187091590.189159] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)
  UEVENT[1187091590.957124] add      /module/isofs (module)
  UEVENT[1187091604.468207] change   /devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0 (scsi)

Userspace gets events, even for unpartitioned media. This unifies
the event handling for asynchronoous events (AN) and events caused by
perodical polling the device from userspace.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
[jejb: modified for new event API]

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
Linus Torvalds [Fri, 11 Jan 2008 21:46:46 +0000 (13:46 -0800)]
Merge git://git./linux/kernel/git/mchehab/v4l-dvb

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (7001): av7110: fix section mismatch
  V4L/DVB (6999): ivtv: stick to udelay=10 after all

16 years agoMerge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
Linus Torvalds [Fri, 11 Jan 2008 19:49:31 +0000 (11:49 -0800)]
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
  [XFS] fix unaligned access in readdir

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.24
Linus Torvalds [Fri, 11 Jan 2008 19:48:59 +0000 (11:48 -0800)]
Merge git://git./linux/kernel/git/lethal/sh-2.6.24

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.24:
  sh: Force __access_ok() to obey address space limit.
  sh: Fix argument page dcache flushing regression.

16 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Fri, 11 Jan 2008 19:48:00 +0000 (11:48 -0800)]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Replace 40c7869b693b18412491fdcff64682215b739f9e kludge
  [MIPS] Lasat: Fix built in separate object directory.
  [MIPS] Malta: Fix software reset on big endian
  [MIPS] pnx8xxx: move to clocksource
  [MIPS] Wrong CONFIG option prevents setup of DMA zone.

16 years agops3fb: fix deadlock on kexec()
Jeremy Kerr [Fri, 11 Jan 2008 13:28:04 +0000 (14:28 +0100)]
ps3fb: fix deadlock on kexec()

Since the introduction of the acquire_console_sem calls in
0333d83509c7d8496c8965b5ba9bc0c98e83c259, kexecing can cause the
kernel to deadlock:

 ps3fb_shutdown()
  -> unregister_framebuffer()
  -> fb_notifier_call_chain(FB_EVENT_FB_UNBIND)
  -> fbcon_fb_unbind()
  -> unbind_con_driver()
  -> bind_con_driver()
[ acquires console_sem ]
  -> fbcon_deinit()
  -> fbops->fb_release(newinfo, 0)
  -> ps3fb_release()
  -> ps3fb_sync()
[ acquires console_sem ]

This change avoids the deadlock by moving the acquire_console_sem()
out of ps3fb_sync(), and puts it into the two other callsites, leaving
ps3fb_release() to call ps3fb_sync() without the console semaphore.

[Geert]
  - Corrected call sequence above
  - ps3fb_release() may be called with and without console_sem held. This is an
    inconsistency that should be fixed at the fb level, but for now, try to
    acquire console_sem in ps3fb_release().

    I think it's safer to let ps3fb_release() try to acquire console_sem and
    not refresh the screen if it fails, than to call ps3fb_sync() without
    holding console_sem, as ps3fb_par may be modified at the same time, causing
    crashes or lockups.

    Besides, ps3fb_release() only calls ps3fb_sync() to refresh the screen
    when display flipping is disabled, which is an uncommon case (except during
    shutdown/kexec).

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agops3fb: prevent use after free of fb_info
Jeremy Kerr [Fri, 11 Jan 2008 13:27:10 +0000 (14:27 +0100)]
ps3fb: prevent use after free of fb_info

In ps3fb_shutdown, freeing the framebuffer will cause fb_info (in
dev->core.driver_data) to be free()ed, which we potentially access
from the ps3fbd kthread.

This change frees the framebuffer after stopping the ps3fbd kthread.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 11 Jan 2008 19:44:59 +0000 (11:44 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  blktrace: kill the unneeded initcall
  block: fix blktrace timestamps
  loop: fix bad bio_alloc() nr_iovec request
  Don't blatt first element of prv in sg_chain()

16 years agocache invalidation error for buffered write
Massimo Cirillo [Fri, 11 Jan 2008 10:24:11 +0000 (10:24 +0000)]
cache invalidation error for buffered write

The bug causes corruptions of data read from flash.

The original code performs cache invalidation from "adr" to "adr + len"
in do_write_buffer().  Since len and adr could be updated in the code
before invalidation - it causes improper setting of cache invalidation
regions.

Signed-off-by: Massimo Cirillo <maxcir@gmail.com>
Signed-off-by: Giuseppe D'Eliseo <giuseppedeliseo@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Jörn Engel <joern@logfs.org>
Signed-off-by: David Woohouse <dwmw2@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoIDE: terminate ACPI DMI list
Jeff Garzik [Fri, 11 Jan 2008 04:59:18 +0000 (23:59 -0500)]
IDE: terminate ACPI DMI list

Fix oops reported by Trond.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>