Change scsi.c scsi_log_completion() to print strings for QUEUED,

SOFT_ERROR, SCSI_RETURN_NOT_HANDLED, and FAST_IO_FAIL rather
than "UNKNOWN".

Signed-off-by: Robert Elliott <elliott@hp.com>
Set scsi_logging_level to be more verbose to get better messages

while booting
hpsa: remove dev_warn prints from RAID-1ADM

RAID-1ADM is unusable with dev_warn called on every command.

Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: fix a couple pci id table mistakes

Subdevice ID 0x3323 was missing from product[] table (another name for HP Smart Storage 1210m)
Bogus 0x1925 subdevice id removed from hpsa_pci_device_id[] (no such thing.)

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: fix a string constant broken into two lines

Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: correct off-by-one sizing of chained SG block

Signed-off-by: Webb Scales <webbnh@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: remove 'action required' phrasing

In the case of LUN data changing, the driver will
auto rescan and so it's not even true that "action" is
"required".

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
hpsa: fix allocation sizes for CISS_REPORT_LUNs commands

We were allocating roughly double the amount of memory
we should be due to ReportLUNdata and ExtendedReportLUNdata
containing a non-zero sized array but adding extra memory
to allocate as if the array were zero sized.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: fix endianness issue with scatter gather elements

The hardware needs little endian scatter gather addresses and
lengths but we were not bothering to convert from cpu byte
order as we should have been.  On Intel, this is all just
a bunch of no-ops macros, but it makes the code endian-clean(er).

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: get rid of type/attribute/direction bit field where possible

Using bit fields for hardware command fields isn't portable and
relies on assumptions about how the compiler lays out the bits.
We can fix this in the driver's internal command structure, but the
ioctl interface we can't change because it is part of the
userland ABI.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: use atomics for commands_outstanding instead of protecting with spin locks

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
hpsa: do not be so noisy about check conditions

We were printing a lot of useless information before ultimately
just passing things up to the SCSI mid layer.  Just let the
midlayer handle it without LLD chatter.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Joe Handzik <joseph.t.handzik@hp.com>
Reviewed-by: Scott Teel <scott.teel@hp.com>
hpsa: Convert SCSI LLD ->queuecommand() for host_lock less operation

There isn't anything in hpsa that requires the host lock to be held
during queuecommand.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: remove spin lock around command allocation

It is already using atomic test_and_set_bit to do the
allocation.

There is some microscopic chance of starvation, but it is
so microscopic that it should never happen in reality.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: reserve some commands for use by driver

We need to reserve some commands for device rescans,
aborts, and the pass through ioctls, etc. so we cannot
give them all to the scsi mid layer.

This is in preparation for removing cmd_special_alloc and
cmd_special_free so that we can stop queuing commands internally
in the driver so that we can remove the locks thta protect the
queue that we will no longer have.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: get rid of cmd_special_alloc and cmd_special_free

Always use cmd_alloc and cmd_free instead, we should have
reserved enough commands that we should not need to ever
dynamically allocate any and should always have enough.

This is laying the groundwork for removing the internal
queue of commands from the driver so that the locks that
protect that queue may be removed.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: do not queue commands internally in driver

By not doing this, we can eliminate some spin locking
in the main i/o path and gain significant improvement
in IOPS.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: remove unused interrupt handler code

Now that we never use "non-indexed" method for completing
commands we can remove the code to handle that from the
interrupt handler

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: remove direct lookup bit from command tags

Now that every commmand is "direct lookup" we don't
need a bit to tell us whether it is "direct lookup"

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: fix race between abort handler and main i/o path

This means changing the allocator to reference count commands.
The reference count is now the authoritative indicator of whether a
command is allocated or not.  The h->cmd_pool_bits bitmap is now
only a heuristic hint to speed up the allocation process, it is no
longer the authoritative record of allocated commands.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>