History log of /drivers/scsi/aic7xxx/aic7xxx_osm.c
Revision Date Author Comments
970e2486492aa1eb47a436a5a4c81e92558986a9 30-Mar-2012 Lucas De Marchi <lucas.demarchi@profusion.mobi> Documentation: remove references to /etc/modprobe.conf

Usage of /etc/modprobe.conf file was deprecated by module-init-tools and
is no longer parsed by new kmod tool. References to this file are
replaced in Documentation, comments and Kconfig according to the
context.

There are also some references to the old /etc/modules.conf from 2.4
kernels that are being removed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
f281233d3eba15fb225d21ae2e228fd4553d824a 16-Nov-2010 Jeff Garzik <jeff@garzik.org> SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
48813cf989eb8695fe84df30207fc8ff5f15783c 14-Jul-2010 Pekka Enberg <penberg@cs.helsinki.fi> [SCSI] aic7xxx: Remove OS utility wrappers

This patch removes malloc(), free(), and printf() wrappers from the aic7xxx
SCSI driver. I didn't use pr_debug for printf because of some 'clever' uses of
printf don't compile with the pr_debug. I didn't fix the overeager uses of
GFP_ATOMIC either because I wanted to keep this patch as simple as possible.

[jejb:fixed up checkpatch errors and fixed up missed conversion]
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
b71a8eb0fa64ec6d00175f479e3ef851703568af 06-Oct-2009 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> tree-wide: fix typos "selct" + "slect" -> "select"

This patch was generated by

git grep -E -i -l 's(le|el)ct' | xargs -r perl -p -i -e 's/([Ss])(le|el)ct/$1elect/

with only skipping net/netfilter/xt_SECMARK.c and
include/linux/netfilter/xt_SECMARK.h which have a struct member called
selctx.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
980b306a297725d4f25c779ca15086de757acadf 25-Apr-2008 Denys Vlasenko <vda.linux@googlemail.com> [SCSI] aic7xxx: add const

This patch adds more const keywords where appropriate.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
d1d7b19d433188e94fc87cc7ca66363cd77a0bba 25-Apr-2008 Denys Vlasenko <vda.linux@googlemail.com> [SCSI] aic7xxx: add static

This patch adds static (and sometimes const) keywords where appropriate.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
be0d67680d524981dd65c661efe3c9cbd52a684f 23-Mar-2008 Denys Vlasenko <vda.linux@googlemail.com> [SCSI] aic7xxx, aic79xx: deinline functions

Deinlines and moves big functions from .h to .c files.
Adds prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
647b24256241e144fe8369244da1730b577211e9 09-Mar-2008 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> [SCSI] aic7xxx: fix IOMMU mapping failure handling

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
b1c118121ae37285ddc0a7a908999196bb35fb0b 03-Feb-2008 Joe Perches <joe@perches.com> drivers/scsi/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: James Smart <james.smart@emulex.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: David Somayajulu <david.somayajulu@qlogic.com>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
d3f46f39b7092594b498abc12f0c73b0b9913bde 15-Jan-2008 James Bottomley <James.Bottomley@HansenPartnership.com> [SCSI] remove use_sg_chaining

With the sg table code, every SCSI driver is now either chain capable
or broken (or has sg_tablesize set so chaining is never activated), so
there's no need to have a check in the host template.

Also tidy up the code by moving the scatterlist size defines into the
SCSI includes and permit the last entry of the scatterlist pools not
to be a power of two.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
969ceffb6696ac361db9dbc33c83f855dbdb1528 25-Jan-2008 David Milburn <dmilburn@redhat.com> [SCSI] aic7xxx: fix ahc_done check SCB_ACTIVE for tagged transactions

The driver only needs to check the SCB_ACTIVE flag if the SCB is not
in the untagged queue.

If the driver is in error recovery, you may end panic'ing on a TUR
that is in the untagged queue.

Attempting to queue an ABORT message
CDB: 0x0 0x0 0x0 0x0 0x0 0x0
SCB 3 done'd twice

This patch is included in Adaptec's 6.3.11 driver on their website.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
b80ca4f7ee36c26d300c5a8f429e73372d153379 13-Jan-2008 FUJITA Tomonori <tomof@acm.org> [SCSI] replace sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE

This replaces sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE in
several LLDs. It's a preparation for the future changes to remove
sense_buffer array in scsi_cmnd structure.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
64624d4f46d5e439906bcd3a99a688c833506124 19-Oct-2007 Hannes Reinecke <hare@suse.de> [SCSI] aic7xxx: Update Maintainer information

Might as well take the blame officially.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
9cb83c7529d929c00f37d821daed1942a1b20602 16-Oct-2007 FUJITA Tomonori <tomof@acm.org> [SCSI] add use_sg_chaining option to scsi_host_template

This option is true if a low-level driver can support sg
chaining. This will be removed eventually when all the drivers are
converted to support sg chaining. q->max_phys_segments is set to
SCSI_MAX_SG_SEGMENTS if false.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
0f82cb9211f800f77636af11f0670e5fc6de6256 26-Jul-2007 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic79xx, aic7xxx: Fix incorrect width setting

Wide transfers are required for every setting of PPR apart from QAS.
It seems the DV code starts at the minimum, which turns on DT and Wide
regardless of the setting of max_width. Redo the PPR and period
setting routines to respect max_width (i.e. start at period = 10 if it
is zero).

This fixes bugzilla 8366

Acked-by: "Freels, James D." <freelsjd@ornl.gov>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3a57c4a5aaee8d9d61b05d95d96f3fc4068b0518 25-May-2007 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> [SCSI] aic7xxx: 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: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
9080063f523b09af63234a21816c825133d48c44 23-Oct-2006 Hannes Reinecke <hare@suse.de> [SCSI] aic7xxx: Remove slave_destroy

This is a cross-port from aic79xx; we still hit the occasional
BUG_ON in slave_destroy. And again we don't really need the
slave_destroy callback nor the ahc_linux_target structure
at all.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
289fe5b1f99c5e61ed32796cbed0a1ecc3589041 20-Oct-2006 Adrian Bunk <bunk@stusta.de> [SCSI] aic7xxx: cleanups

- make needlessly global code static

- #if 0 the following unused global functions:
- aic79xx_core.c: ahd_print_scb
- aic79xx_core.c: ahd_suspend
- aic79xx_core.c: ahd_resume
- aic79xx_core.c: ahd_dump_scbs
- aic79xx_osm.c: ahd_softc_comp

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6d07cb71fdacc710fd9816cddb5c2df0f7bd96b4 20-Oct-2006 Amol Lad <amol@verismonetworks.com> [SCSI] drivers/scsi: Handcrafted MIN/MAX macro removal

Cleanups done to use min/max macros from kernel.h. Handcrafted MIN/MAX
macros are changed to use macros in kernel.h

[akpm@osdl.org: fix warning]
Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
80f1443c66de3ec42e28d151bd43a80de398877e 06-Oct-2006 Hannes Reinecke <hare@suse.de> [SCSI] aic7xxx: Adjust .max_sectors

According to the adaptec sources aic7xxx / aic79xx really can do
4MB transfers. So we should adjust .max_sectors.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
6e9a4738c9fadb7cbdcabc1e3b415159f3741ed9 01-Oct-2006 Peter Zijlstra <a.p.zijlstra@chello.nl> [PATCH] completions: lockdep annotate on stack completions

All on stack DECLARE_COMPLETIONs should be replaced by:
DECLARE_COMPLETION_ONSTACK

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
cf2b5d3fcab77a9390293920ec5b49e67eced200 17-Sep-2006 Doug Ledford <dledford@redhat.com> [SCSI] aic7xxx: pause sequencer before touching SBLKCTL

Some cards need to pause the sequencer before the SBLKCTL register is
touched. This fixes a PCI related oops seen on powerpc macs with this
card caused by trying to ascertain the bus signalling before beginning
domain validation.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3e3c60e3a8c7013d55768aa7256bb5a7f66b0bb4 06-Sep-2006 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: avoid checking SBLKCTL register for certain cards

For cards that don't support LVD, checking the SBLKCTL register to
determine the bus singalling doesn't work. So, check that the card
supports LVD first (AHC_ULTRA2) before checking the register.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2b6ee9b5295460017fc1bc3d60545512df280908 15-Aug-2006 Randy Dunlap <rdunlap@xenotime.net> [SCSI] aic7*: cleanup MODULE_PARM_DESC strings

Modify beginning string to be more readable. Remove one trailing newline.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d14164316d48a4319d8da9dc24be8663b2472bae 08-Jul-2006 Matthew Wilcox <matthew@wil.cx> [SCSI] aic7[9x]xx: Remove last vestiges of reverse_scan

Remove last vestiges of the reverse_scan paramater from aic7xxx and aic79xx.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
b2d8bfe18578c4e50e8ba52011c9b260a1b51dac 10-Jun-2006 James Bottomley <jejb@mulgrave.il.steeleye.com> [SCSI] aic7xxx: expose the bus setting to sysfs

Read the transciever register and display in the host transport
properties. I'm still not entirely sure what this does for multiple
transciever adapters (like some 160 ones) however, I suspect it
displays the transciever state of the switchable bus segment.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6391a11375de5e2bb1eb8481e54619761dc65d9f 09-Jun-2006 Tobias Klauser <tklauser@nuerscht.ch> [SCSI] drivers/scsi: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of the macro.

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8cac814501677e9f6a824cf4d423122ac8d67fcb 06-Feb-2006 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: semaphore to completion conversion

On Tue, Jan 31, 2006 at 06:20:18PM +0100, Christoph Hellwig wrote:
> switch eh_sem to a completion. due to wait_for_completion_timeout this
> also nicely simplifies the code. Unfortunately it's untested, so if
> someone with the hardware could give it a try that would be nice. Once
> it works the same thing can be applied to aic79xx.

New version that switches to the common onstack completion and just a
pointer in the platform_data struct idiom. This gets rid of all the
flags fiddling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
dacee84b070c4e705a5b6446f1f0a6a6e2f8d7a4 10-Jan-2006 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: fix timer handling bug

The driver is doing a rather stupid mod_timer allegedly to "give
request sense more time to complete". This is illegal and pointless,
so just eliminate it. Also eliminate all the other uses of struct
timer_list in the driver, which are mostly bogus.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
9e1fe9314cb5649b2dc73690f2cd8d0068e633d9 14-Dec-2005 Jesper Juhl <jesper.juhl@gmail.com> [SCSI] handle scsi_add_host failure for aic7xxx and fix compiler warning

Add scsi_add_host() failure handling for aic7xxx
Also silence a compiler warning :
drivers/scsi/aic7xxx/aic7xxx_osm.c: In function `ahc_linux_register_host':
drivers/scsi/aic7xxx/aic7xxx_osm.c:1100: warning: ignoring return value of `scsi_add_host', declared with attribute warn_unused_result

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
dce200670d63615120de17d4aed0a4fd777cc825 27-Nov-2005 Vasily Averin <vvs@sw.ru> [SCSI] aic7xxx: reset handler selects a wrong command

To transport scsi reset command to device aic7xxx reset handler looks
at the driver's pending_list and searches any proper command. However
the search condition has been inverted: ahc_match_scb() returns TRUE
if a matched command is found. As a result the reset on required
devices did not turn out well, a correctly working neighbour device
may be surprised by the reset. aic7xxx reset handler reports about the
success, but really the original situation is not corrected yet.

Signed-off-by: Vasily Averin <vvs@sw.ru>

Naturally, there's a corresponding problem in the aic79xx driver, so
I've also added the same fix for that.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6d5e9fd1964e653fa538b020af351d3c9f609c07 31-Oct-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove scsi_assign_lock usage

just take the internal lock in queuecommand instead. also switch
the only direct use of the internal lock to the wrappers used elsewhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
422c0d61d591cbfb70f029e13505fb437e169d68 25-Oct-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] use scmd_id(), scmd_channel() throughout code

Wrap a highly common idiom. Makes the code easier to read, helps pave
the way for sdev->{id,channel} removal, and adds a token that can easily
by grepped-for in the future.

There are a couple sdev_id() and scmd_printk() updates thrown in as well.

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
017560fca496f72ed9dd734ffde63ce39dfe0411 25-Oct-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] use sfoo_printk() in drivers

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
97af50f60ff1202b0dd9ce481d4cf98c6a578bec 02-Oct-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx/aic79xx: fix module removal path not to panic

In these drivers, scsi_remove_host() is called too late, at the point
it is called, the driver has already shut down too far to accept any
I/O that the shutdown might generate. Any generated I/O actually
triggers a panic.

Fix this by calling scsi_remove_host() as early as possible and not
calling scsi_host_put() until just before we kfree the ahc_softc.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
a89f29f6ea8dba0b7c4ae5d1d0b43de6cb500ea6 30-Aug-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: move to dma_get_required_mask() and correct 39 bit assumptions

This patch moves aic7xxx over to the dma_get_required_mask() API and
dumps its open coded memory check.

It also appears from this bug:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=167049

That 39 bit addressing doesn't work on older cards. I surmise that the
AHC_LARGE_SCBS flag is the one that marks cards capable of using 39 bit
addressing, so I also folded that check into the code.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1ff927306e08b356d764e605eff7c50079550bd2 19-Aug-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove aiclib.c

#include of C files and macro tricks to rename symbols are evil and just
cause trouble. Let's doublicate the two functions as they're going to
go away soon enough anyway.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
a80b3424d9fde3c4b6d62adaf6dda78128dc5c27 09-Aug-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic79xx: fix boot panic with no hardware

There's a spurious (and illegal since it's marked __exit) call to
ahc_linux_exit() in ahc_linux_init() which causes a double list
deletion of the transport class; remove it.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fc789a93994858b5e5a46afb96d0dcf6cc1b6f08 05-Aug-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx/79xx: fix another potential panic due to a non existent target

I ran into this one sending bus resets across the hardware.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
79778a27be4c704552a18cf2a3e8b9e30623acd1 05-Aug-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: upport all sequencer and core fixes from adaptec version 6.3.9

This patch upports all relevant code fixes and bumps the driver version
to 7.0 to signify starting a new tree.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fdd0edf2aca72e374d10e7a0957a006f18bffaf4 04-Aug-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] fix aic7xxx performance issues since 2.6.12-rc2

Several people noticed we dropped quite a bit on benchmark figures.
OK, it was my fault but unfortunately I discovered I ran out of brown
paper bags a while ago and forgot to reorder them.

The issue is that a construct introduced in the conversion of the
driver to use the transport class keyed off whether the block request
was tagged or not. However, the aic7xxx driver doesn't properly set
up the block layer TCQ (it uses the wrong API), so the driver now
things all requests are untagged and we keep it to a queue depth of a
single element. Oops.

The fix is to use the correct TCQ API.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
84e66ee7ec7aaa789945403b7cbde7a0b08c15ef 02-Aug-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: final fixes for DT handling

The aic7xxx can support Data Group transfers at periods > 12.5, so
eliminate that restriction. Additionally wide is a requirement for DT
so ensure wide is set if users request DT.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f7ff898ad3971cd36967453d331c57d97d407007 30-Jul-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: fix bug in DT handing

Basically DT isn't reported or handled at all. The problem is that
lines of code like this:

spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ;

don't do what you think they do when spi_dt is a single bit variable.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2a40342e0e72a2ba89aaa9e6c9a9eceb04741b24 28-Jun-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove ahc_tailq

now that we do normal PCI probing there's no need to keep a list of
all HBAs.

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
dfd287f6ee9be1e3ae8fe1160c185aac6ca83c6a 28-Jun-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: sane pci probing

always probe in bus order, avoid any reordering

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ace4e7185d565cab057139e8927659bd072bf25a 02-Jul-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: fix boot hang with Fujitsu drives

Apparently these are the only drives that try to negotiate IU and QAS
at u160 speeds. The aic7xxx driver can't cope with this. The fix is
to eliminate the IU and QAS setting routines. I've #if 0'd them out,
just in case we ever get the sequencer documentation out of Adaptec,
since we'd then be able to fix the driver.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
68b3aa7c9805aee9005a8ca53c5e99177961fbb9 28-May-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] allow sleeping in ->eh_bus_reset_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8fa728a26886f56a9ee10a44fea0ddda301d21c3 28-May-2005 Jeff Garzik <jgarzik@pobox.com> [SCSI] allow sleeping in ->eh_abort_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
12021fff2bae7fab01c4bf283f3cd9bc6997d8c4 14-Jun-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: fix the BIOS limits setting routines

Following the go around over the SONY DVD that needs artificial limits,
this should be the correct code for all cases (minus the debugging
prints).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d6cbbad7296538b6a38c0fe36e6ecf67f1e600a7 11-Jun-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: clean up eisa support

- the eisa layer only probes when it's actually safe, no need for
a driver option
- store the id table directly in linux format instead of convering
at runtime

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8eb379425765bfc9a44f06f210224b10066fc46f 11-Jun-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove some dead wood

especially the now dead scsi_cmnd overlay

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
597487b9ba875785f3ee9bd541073e9edd2e700a 03-Jun-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] fix aic7xxx coupled parameter problem

For setting coupled parameters, we need to be comparing against the goal
settings, not the current ones.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
b1abb4d67f2a706f52a95064001e0c55d9be2d26 25-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: remove separate target and device allocations

Since the aic driver is now taught to speak in terms of the generic
linux devices, we can now also dispense with the transport class get
routines (since we update the parameters when the driver sees they
change) and also plumb it into the spi transport transfer agreement
reporting infrastructure.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d981289627a7e2d8ef62dfcaa11fb60da68f30c6 25-May-2005 Andrew Morton <akpm@osdl.org> [PATCH] aic7xxx_osm build fix

Fix a c99ism.

Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2bf2c568c878b9c0bbacac5c3210a6bd81856d21 20-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: fix U160 mode

The new period/dt setting routines don't get the coupling of these
parameters correct. This means that Domain Validation never gets DT
set, and thus the drive gets restricted to U80.

Fix this by restoring the couplings in the set routines.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fb3089dfb58bf07992252b42e77c6f35d45dff5e 18-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: add back locking

Tampering with the settings has to be done under the host lock ...
slave_alloc isn't called under any lock, so this has to be done
explicitly.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
c7525233d2df39b95552f6f49c6b390a9c4d2e80 18-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: make correct use of slave_alloc/destroy and remove the per device timer

The allocation of all of our components should be done in slave alloc.
Currently it's rather fancifully refcounted in the queuecommand
callback. This patch moves allocation and destroy to their correct
places in slave_alloc/slave_destory. Now we can guarantee that
everywhere a device is requested, it's actually been allocated, so don't
check for this anymore.

Additionally, the per device busy timer was the only source of potential
use after free. It's been deleted because Linux does the correct thing
with busy returns, so there's no need to implement a separate timer in
the driver.

Finally, implement code that forces all the device parameters to zero
(i.e. async and narrow) in the slave alloc, inform the spi class of the
bios recorded maximums and wait until slave configure before trying
anything more adventurous.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8e45ebcc661069bfb002c56dd942aedf43ba9239 17-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: remove the completeq

This should finish the spurious queue removal from aic7xxx (there are
other queues that are probably unnecessary, but at least the major and
obviously unnecessary ones are done with).

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
38c29ce06d24691d6e6dd786175fcc54efd5995b 17-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic7xxx: remove the last vestiges of the runq

This was rendered obsolete by the busyq removal; remove some of the last
remnants of its presence.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
013791ee01754f83dbb4ccfd266381db74e120b5 16-May-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove usage of obsolete typedefs

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7dfa0f2673c17334c5de75a449f7bc161c9bd2c0 16-May-2005 Christoph Hellwig <hch@lst.de> [SCSI] remove dma_mask hacks

pci_alloc_consistent is under 4G by default. Also simplify the
definition of bus_dmamap_t.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
dedd831081052028f35aaf924ea3d6c55109074f 16-May-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove Linux 2.4 ifdefs

There's not much sense in sharing code anymore now that aic7xxx uses
various transport class facilities.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
e4e360c325c90f7830baaa2a27cd7a1f2bdeb6b0 16-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] remove aic7xxx busyq

The aic7xxx driver has two spurious queues in it's linux glue code: the
busyq which queues incoming commands to the driver and the completeq
which queues finished commands before sending them back to the mid-layer

This patch just removes the busyq and makes the aic finally return the
correct status to get the mid-layer to manage its queueing, so a command
is either committed to the sequencer or returned to the midlayer for
requeue.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fad01ef88d2a27303757924c1fc013b31fe9a76b 08-May-2005 James Bottomley <James.Bottomley@steeleye.com> [SCSI] correct aic7xxx period setting routines

This is similar to the previous sym2 problem. For Domain Validation to
work we can't allow any period setting to turn wide on if it was
previously off.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
0bdcd78ea2342ad1a9c79cac99eefcfd0b3f1c2b 21-Apr-2005 Christoph Hellwig <hch@lst.de> [SCSI] aic7xxx: remove inquiry sniffing leftovers

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
858eaca169ed5e7b1b14eebb889323e75a02af0e 21-Apr-2005 James Bottomley <James.Bottomley@SteelEye.com> [PATCH] Fix aic7xxx_osm.c compile with older gcc's

My version of gcc doesn't warn about this error (declaration in the
middle of a set of statements).

The fix is simple (this also corrects return code; for init functions it
should be zero or error).
cb624029cab62e5415287d15b2ec907b8f322ff5 18-Apr-2005 <jejb@titanic.il.steeleye.com> aic7xxx: convert to SPI transport class Domain Validation

Now that we export all the parameters, this is easy to do.
It also means that we can dump about 2000 lines of code that
were dedicated to doing this internally.

Additionally, this removes all the aic7xxx driver abuse
of SCSI timers which were embedded in the DV routines.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
92d161c373b45be158b73a162bedebb5293a73d3 17-Apr-2005 <jejb@titanic.il.steeleye.com> aic7xxx: add support for the SPI transport class

This is just a simplistic patch to export all of the
aic7xxx internal transport parameters via the SPI
transport class. It doesn't actually alter the way the
driver works at all.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
be7db055dd7261522557046370f49160728e3847 17-Apr-2005 <hch@lst.de> [PATCH] remove old scsi data direction macros

these have been wrappers for the generic dma direction bits since 2.5.x.
This patch converts the few remaining drivers and removes the macros.

Arjan noticed there's some hunk in here that shouldn't. Updated patch
below:

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!