History log of /linux-master/drivers/scsi/aic7xxx/aic79xx_osm.c
Revision Date Author Comments
# c7f4c5de 23-Oct-2023 Hannes Reinecke <hare@suse.de>

scsi: aic79xx: Fix up NULL command in ahd_done()

Found by smatch.

Fixes: c67e63800446 ("scsi: aic79xx: Do not reference SCSI command when resetting device")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20231023073014.21438-1-hare@suse.de
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c67e6380 02-Oct-2023 Hannes Reinecke <hare@suse.de>

scsi: aic79xx: Do not reference SCSI command when resetting device

When sending a device reset we should not take a reference to the SCSI
command.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20231002154328.43718-10-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 9cc9ef28 02-Oct-2023 Hannes Reinecke <hare@suse.de>

scsi: aic79xx: Make BUILD_SCSIID() a function

Convert BUILD_SCSIID() into a function and add a scsi_device argument.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20231002154328.43718-9-hare@suse.de
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 32e7e06f 14-Sep-2022 Kees Cook <keescook@chromium.org>

scsi: aic79xx: Use __ro_after_init explicitly

ahd_linux_setup_iocell_info() intentionally writes to the const-marked
aic79xx_iocell_info array, but is called during __init, so the location is
actually writable at this point on most architectures. Annotate this
explicitly with __ro_after_init to avoid static analysis confusion.

Link: https://lpc.events/event/16/contributions/1175/attachments/1109/2128/2022-LPC-analyzer-talk.pdf
Link: https://lore.kernel.org/r/20220914115953.3854029-1-keescook@chromium.org
Cc: Hannes Reinecke <hare@suse.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Reported-by: David Malcolm <dmalcolm@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c3b48443 04-Jan-2022 Minghao Chi <chi.minghao@zte.com.cn>

scsi: aic79xx: Remove redundant error variable

Return the value from ahd_linux_queue_abort_cmd() directly instead of using
a redundant variable.

Link: https://lore.kernel.org/r/20220104112452.601899-1-chi.minghao@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# af049dfd 07-Oct-2021 Bart Van Assche <bvanassche@acm.org>

scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions

The DEF_SCSI_QCMD() macro passes the addresses of the SCSI host lock and
also that of the scsi_done function to the queuecommand_lck() function
implementations. Remove the 'scsi_done' argument since its address is
now a constant and instead call 'scsi_done' directly from inside the
queuecommand_lck() functions.

Link: https://lore.kernel.org/r/20211007204618.2196847-14-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 07ebbc3a 07-Oct-2021 Bart Van Assche <bvanassche@acm.org>

scsi: aic7xxx: Call scsi_done() directly

Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.

Link: https://lore.kernel.org/r/20211007202923.2174984-22-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 464a00c9 27-Apr-2021 Hannes Reinecke <hare@suse.de>

scsi: core: Kill DRIVER_SENSE

Replace the check for DRIVER_SENSE with a check for
scsi_status_is_check_condition().

Audit all callsites to ensure the SAM status is set correctly. For
backwards compability move the DRIVER_SENSE definition to sg.h, and update
sg, bsg, and scsi_ioctl to set the DRIVER_SENSE driver_status whenever
SAM_STAT_CHECK_CONDITION is present.

[mkp: fix zeroday srp warning]

Link: https://lore.kernel.org/r/20210427083046.31620-10-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

fix


# d8cd784f 13-Jan-2021 Hannes Reinecke <hare@suse.de>

scsi: aic7xxx: aic79xx: Drop internal SCSI message definition

Use the standard SCSI message definitions instead of the driver-internal
ones.

Link: https://lore.kernel.org/r/20210113090500.129644-20-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 54c9f6fd 13-Jan-2021 Hannes Reinecke <hare@suse.de>

scsi: aic7xxx: aic79xx: Remove driver-defined SAM status definitions

Replace the driver-defined SAM status definitions with the standard
mid-layer defined ones.

Link: https://lore.kernel.org/r/20210113090500.129644-9-hare@suse.de
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# b2ed1bab 02-Nov-2020 Lee Jones <lee.jones@linaro.org>

scsi: aic7xxx: aic79xx_osm: Remove unused variable 'saved_scsiid'

Fixes the following W=1 kernel build warning(s):

drivers/scsi/aic7xxx/aic79xx_osm.c: In function ‘ahd_linux_queue_abort_cmd’:
drivers/scsi/aic7xxx/aic79xx_osm.c:2143:9: warning: variable ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20201102142359.561122-2-lee.jones@linaro.org
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# daf4b00b 29-Jul-2020 Suraj Upadhyay <usuraj35@gmail.com>

scsi: aic7xxx: Remove pci-dma-compat wrapper API

The legacy API wrappers in include/linux/pci-dma-compat.h should go away as
they create unnecessary midlayering for include/linux/dma-mapping.h API.
Instead use dma-mapping.h API directly.

The patch has been generated with the coccinelle script below. And has
been hand modified to replace each GFP_ with the correct flag depending
upon the context. Compile-tested.

@@@@
- PCI_DMA_BIDIRECTIONAL
+ DMA_BIDIRECTIONAL

@@@@
- PCI_DMA_TODEVICE
+ DMA_TO_DEVICE

@@@@
- PCI_DMA_FROMDEVICE
+ DMA_FROM_DEVICE

@@@@
- PCI_DMA_NONE
+ DMA_NONE

@@ expression E1, E2, E3; @@
- pci_alloc_consistent(E1, E2, E3)
+ dma_alloc_coherent(&E1->dev, E2, E3, GFP_)

@@ expression E1, E2, E3; @@
- pci_zalloc_consistent(E1, E2, E3)
+ dma_alloc_coherent(&E1->dev, E2, E3, GFP_)

@@ expression E1, E2, E3, E4; @@
- pci_free_consistent(E1, E2, E3, E4)
+ dma_free_coherent(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_map_single(E1, E2, E3, E4)
+ dma_map_single(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_unmap_single(E1, E2, E3, E4)
+ dma_unmap_single(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4, E5; @@
- pci_map_page(E1, E2, E3, E4, E5)
+ dma_map_page(&E1->dev, E2, E3, E4, E5)

@@ expression E1, E2, E3, E4; @@
- pci_unmap_page(E1, E2, E3, E4)
+ dma_unmap_page(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_map_sg(E1, E2, E3, E4)
+ dma_map_sg(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_unmap_sg(E1, E2, E3, E4)
+ dma_unmap_sg(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_single_for_cpu(E1, E2, E3, E4)
+ dma_sync_single_for_cpu(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_single_for_device(E1, E2, E3, E4)
+ dma_sync_single_for_device(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_sg_for_cpu(E1, E2, E3, E4)
+ dma_sync_sg_for_cpu(&E1->dev, E2, E3, E4)

@@ expression E1, E2, E3, E4; @@
- pci_dma_sync_sg_for_device(E1, E2, E3, E4)
+ dma_sync_sg_for_device(&E1->dev, E2, E3, E4)

@@ expression E1, E2; @@
- pci_dma_mapping_error(E1, E2)
+ dma_mapping_error(&E1->dev, E2)

@@ expression E1, E2; @@
- pci_set_consistent_dma_mask(E1, E2)
+ dma_set_coherent_mask(&E1->dev, E2)

@@ expression E1, E2; @@
- pci_set_dma_mask(E1, E2)
+ dma_set_mask(&E1->dev, E2)

Link: https://lore.kernel.org/r/790a8751b5c2b5393c3021b8def08e47bb1597c0.1596045683.git.usuraj35@gmail.com
Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 3eef38a1 14-Jul-2020 Hannes Reinecke <hare@suse.de>

scsi: aic79xx: Restore modes when exiting ahd_linux_queue_abort_cmd()

ahd_linux_queue_abort_cmd() calls ahd_save_modes() without calling
ahd_restore_modes() before exiting.

Link: https://lore.kernel.org/r/20200714160301.4482-1-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 42b840bc 13-Jul-2020 Lee Jones <lee.jones@linaro.org>

scsi: aic7xxx: Fix 'amount_xferred' set but not used issue

'amount_xferred' is used, but only in certain circumstances. Place
the same stipulations on the defining/allocating of 'amount_xferred'
as is placed when using it.

We've been careful not to change any of the ordering semantics here.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/aic7xxx/aic79xx_osm.c: In function ‘ahd_done’:
drivers/scsi/aic7xxx/aic79xx_osm.c:1796:12: warning: variable ‘amount_xferred’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20200713080001.128044-24-lee.jones@linaro.org
Cc: Hannes Reinecke <hare@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 532d56c6 13-Jul-2020 Lee Jones <lee.jones@linaro.org>

scsi: aic7xxx: Remove unused variables 'wait' and 'paused'

It looks like they have never actually been used.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/aic7xxx/aic79xx_osm.c: In function ‘ahd_linux_dev_reset’:
drivers/scsi/aic7xxx/aic79xx_osm.c:782:9: warning: variable ‘wait’ set but not used [-Wunused-but-set-variable]
drivers/scsi/aic7xxx/aic79xx_osm.c:781:9: warning: variable ‘paused’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20200713080001.128044-23-lee.jones@linaro.org
Cc: Hannes Reinecke <hare@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 91b6e191 13-Jul-2020 Lee Jones <lee.jones@linaro.org>

scsi: aic7xxx: Remove unused variable 'ahd'

Hasn't been used since 2005.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/aic7xxx/aic79xx_osm.c: In function ‘ahd_linux_slave_configure’:
drivers/scsi/aic7xxx/aic79xx_osm.c:703:20: warning: variable ‘ahd’ set but not used [-Wunused-but-set-variable]

Link: https://lore.kernel.org/r/20200713080001.128044-22-lee.jones@linaro.org
Cc: Hannes Reinecke <hare@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a10183d7 24-Mar-2020 Christoph Hellwig <hch@lst.de>

scsi: simplify scsi_partsize

Call scsi_bios_ptable from scsi_partsize instead of requiring boilerplate
code in the callers. Also switch the calling convention to match that
of the ->bios_param instances calling this function, and use true/false
for the return value instead of the weird -1 convention.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>


# 2a3d4eb8 13-Dec-2018 Christoph Hellwig <hch@lst.de>

scsi: flip the default on use_clustering

Most SCSI drivers want to enable "clustering", that is merging of
segments so that they might span more than a single page. Remove the
ENABLE_CLUSTERING define, and require drivers to explicitly set
DISABLE_CLUSTERING to disable this feature.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 64d513ac 08-Oct-2015 Christoph Hellwig <hch@lst.de>

scsi: use host wide tags by default

This patch changes the !blk-mq path to the same defaults as the blk-mq
I/O path by always enabling block tagging, and always using host wide
tags. We've had blk-mq available for a few releases so bugs with
this mode should have been ironed out, and this ensures we get better
coverage of over tagging setup over different configs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>


# 114fc1d9 26-Mar-2015 Michael Opdenacker <michael.opdenacker@free-electrons.com>

aic7xxx: replace kmalloc/memset by kzalloc

This replaces kmalloc + memset by a call to kzalloc

This also fixes one checkpatch.pl issue in the process.

This improvement was suggested by "make coccicheck"

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# db5ed4df 13-Nov-2014 Christoph Hellwig <hch@lst.de>

scsi: drop reason argument from ->change_queue_depth

Drop the now unused reason argument from the ->change_queue_depth method.
Also add a return value to scsi_adjust_queue_depth, and rename it to
scsi_change_queue_depth now that it can be used as the default
->change_queue_depth implementation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>


# c8b09f6f 03-Nov-2014 Christoph Hellwig <hch@lst.de>

scsi: don't set tagging state from scsi_adjust_queue_depth

Remove the tagged argument from scsi_adjust_queue_depth, and just let it
handle the queue depth. For most drivers those two are fairly separate,
given that most modern drivers don't care about the SCSI "tagged" status
of a command at all, and many old drivers allow queuing of multiple
untagged commands in the driver.

Instead we start out with the ->simple_tags flag set before calling
->slave_configure, which is how all drivers actually looking at
->simple_tags except for one worke anyway. The one other case looks
broken, but I've kept the behavior as-is for now.

Except for that we only change ->simple_tags from the ->change_queue_type,
and when rejecting a tag message in a single driver, so keeping this
churn out of scsi_adjust_queue_depth is a clear win.

Now that the usage of scsi_adjust_queue_depth is more obvious we can
also remove all the trivial instances in ->slave_alloc or ->slave_configure
that just set it to the cmd_per_lun default.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>


# 2ecb204d 03-Nov-2014 Christoph Hellwig <hch@lst.de>

scsi: always assign block layer tags if enabled

Allow a driver to ask for block layer tags by setting .use_blk_tags in the
host template, in which case it will always see a valid value in
request->tag, similar to the behavior when using blk-mq. This means even
SCSI "untagged" commands will now have a tag, which is especially useful
when using a host-wide tag map.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>


# 50668633 30-Oct-2014 Christoph Hellwig <hch@lst.de>

scsi: remove abuses of scsi_populate_tag

Unless we want to build a SPI tag message we should just check SCMD_TAGGED
instead of reverse engineering a tag type through the use of
scsi_populate_tag_msg.

Also rename the function to spi_populate_tag_msg, make it behave like the
other spi message helpers, and move it to the spi transport class.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Hannes Reinecke <hare@suse.de>


# 9cb78c16 25-Jun-2014 Hannes Reinecke <hare@suse.de>

scsi: use 64-bit LUNs

The SCSI standard defines 64-bit values for LUNs, and large arrays
employing large or hierarchical LUN numbers become more and more
common.

So update the linux SCSI stack to use 64-bit LUN numbers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# f6f83a6c 31-Mar-2013 Al Viro <viro@zeniv.linux.org.uk>

aic79xx: switch to ->show_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 970e2486 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>


# 25985edc 30-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>


# f281233d 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>


# 48813cf9 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>


# 5a0e3ad6 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>


# b71a8eb0 05-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>


# ea443190 12-Jun-2009 James Bottomley <James.Bottomley@HansenPartnership.com>

[SCSI] aic79xx: make driver respect nvram for IU and QAS settings

This patch allows the Adaptec firmware to pass on its values for Packetize and
QAS. To do this, the settings max_iu and max_qas have been introduced into
the SPI transport class and populated from the adaptec NVram tables. Domain
validation in the SPI transport class will respect the max settings when
configuring to the highest possible speed for testing.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 980b306a 24-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>


# d1d7b19d 24-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>


# be0d6768 22-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>


# 2505873a 09-Mar-2008 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

[SCSI] aic79xx: 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>


# b1c11812 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>


# d3f46f39 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>


# c1c9ce52 26-Jan-2008 FUJITA Tomonori <tomof@acm.org>

[SCSI] aic79xx: fix sense_buffer access bug

The commit de25deb18016f66dcdede165d07654559bb332bc changed
scsi_cmnd.sense_buffer from a static array to a dynamically allocated
buffer. We can't access to sense_buffer in '&cmd->sense_buffer' way.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# b80ca4f7 12-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>


# 64624d4f 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>


# 9cb83c75 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>


# 0f82cb92 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>


# 4c688fc7 25-May-2007 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

[SCSI] aic79xx: 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>


# e3e0ca51 26-Mar-2007 Adrian Bunk <bunk@stusta.de>

[SCSI] aic7xxx: make functions static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# e790b3dd 16-Feb-2007 Rolf Eike Beer <eike-kernel@sf-tec.de>

[SCSI] aic79xx: remove extra newline from info message

This extra newline character introduces a completely empty line in dmesg as
the calling function itself adds a newline.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 19966769 07-Feb-2007 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: use dma_get_required_mask()

As originally noted by Frederic Temporelli, the aic79xx supports 64
bit addressing, but the initialization code of the driver is wrong: it
tests the available memory size instead of testing the maximum
available memory address.

This patch uses the correct dma_get_required_mask() macros to
determine the correct addressing method.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Xavier Bru <xavier.bru@bull.net>
CC: Frederic Temporelli <frederic.temporelli@bull.net>

cosmetic fixes
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# d6b9ccbb 23-Oct-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Print out signalling

This is a cross-port of a similar patch for aic7xxx;
only it's a bit simpler here as we don't support HVD
and all controller actually implement this register.
I hope.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 843822ad 23-Oct-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: set precompensation

aic79xx has a special 'iocell' chip which handles the precompensation.
If it's set via DV we should make sure to set the chip correctly, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 289fe5b1 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>


# 6d07cb71 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>


# 80f1443c 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>


# 7d12e780 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)


# 6e9a4738 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>


# 2b6ee9b5 15-Aug-2006 Randy Dunlap <rdunlap@infradead.org>

[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>


# d1416431 08-Jul-2006 Matthew Wilcox <willy@infradead.org>

[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>


# f89d0a4e 22-Jun-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: remove slave_destroy

Even with the latest fixes aic79xx still occasionally triggers the
BUG_ON in slave_destroy. Rather than trying to figure out the various
levels of interaction here I've decided to remove the callback altogether.

The primary reason for the slave_alloc / slave_destroy is to keep an
index of pointers to the sdevs associated with a given target.
However, by changing the arguments to the affected functions slightly
it's possible to avoid the use of that index entirely.
The only performance penalty we'll incur is in writing the
information for /proc/scsi/XXX, as we'll have to recurse over all
available sdevs to find the correct ones. But I doubt that reading
from /proc is in any way time-critical.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 6391a113 08-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>


# f41b5cec 03-Apr-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx bus reset update

As James B. correctly noted, ahd_reset_channel() in
ahd_linux_bus_reset() should be protected by ahd_lock(). However, the
main reason for not doing so was a deadlock with the interesting
polling mechanism to detect the end a bus reset.

This patch replaces the polling mechanism with a saner signalling via
flags; it also gives us the benefit of detecting any multiple calls to
ahd_reset_channel().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 76744f42 08-Mar-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Avoid renegotiation on inquiry

Because of some quirk in the SCSI spec the aic79xx driver chose to
force a renegotiation when sending an inquiry. This should better
be handled by the upper layers if required at all.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 986a25f9 07-Mar-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: use BIOS settings

This patch fixes the aic79xx driver to properly respond to BIOS
settings.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 6902f416 07-Mar-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Update error recovery

This patch updates the error recovery. Routines for TARGET RESET
and ABORT COMMAND are split up as the logic is quite dissimilar.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 1ede5f9f 07-Mar-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Remove dead code

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 0aa800db 07-Mar-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: use tcq functions

This patch converts aic79xx to use the midlayer-supplied tcq
functions.

We also set the queuedepth to '1' if tcq is disabled; the
aic79xx driver gets confused otherwise. Will set it back to
'2' once I figure out how to queue requests in the driver.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 7b22da38 07-Mar-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: remove qfrozen

This patch removes the need for platform_data->qfrozen.
We're now using complete() instead of semaphores thus
simplifying ahd_freeze_simq() quite a lot.
This also fixes some deadlocks in the recovery code (again).

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# eb221849 30-Jan-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Fix timer handling

Fix the timer handling in aic79xx to use the SCSI-ML provided handling
instead of implementing our own.
It also fixes a deadlock in the command recovery code.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 3fb08612 24-Jan-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: SLOWCRC fix

This patch introduces the SLOWCRC handling for certain buggy chipsets.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 11668bb6 11-Jan-2006 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Sequencer update

Update sequencer code to Adaptec version 2.0.12-6.3.9.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# e7a1ca1d 14-Dec-2005 Jesper Juhl <jesper.juhl@gmail.com>

[SCSI] handle scsi_add_host failure for aic79xx and fix compiler warning

Add scsi_add_host() failure handling for aic79xx
Also silence a compiler warning :
drivers/scsi/aic7xxx/aic79xx_osm.c: In function `ahd_linux_register_host':
drivers/scsi/aic7xxx/aic79xx_osm.c:1099: 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>


# dce20067 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>


# 4065a413 31-Oct-2005 Christoph Hellwig <hch@lst.de>

[SCSI] aic79xx: 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>


# 422c0d61 24-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>


# 017560fc 24-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>


# 97af50f6 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>


# 1ff92730 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>


# 85a46523 15-Aug-2005 Christoph Hellwig <hch@lst.de>

[SCSI] aic79xx: sane pci probing

remove ahd_tailq and do sane pci probing. ported over from aic7xxx.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# a80b3424 08-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>


# fc789a93 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>


# 52b5cfb3 04-Aug-2005 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: fixup DT setting

this patch is just a cross-port of the fixup for aic7xxx DT settings.
As the same restrictions apply for aic79xx also (DT requires wide
transfers) the dt setting routine should be modified equivalently.
And an invalid period setting will be caught by ahd_find_syncrate()
anyway.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 88ff29a4 03-Aug-2005 James Bottomley <James.Bottomley@steeleye.com>

[SCSI] aic79xx: add hold_mcs to the transport parameters

since this card can support the setting, add it to the parameter list.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 3f40d7d6 03-Aug-2005 James Bottomley <James.Bottomley@steeleye.com>

[SCSI] aic79xx: fix up transport settings

There's a slight problem in the way you've done the transport
parameters; reading from the variables actually produces the current
settings, not the ones you just set (and there's usually a lag because
devices don't renegotiate until the next command goes over the bus). If
you set the bit immediately, you get into the situation where the
transport parameters report something as being set even if the drive
cannot support it.

I patched the driver to do it this way and also corrected a panic in the
proc routines.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# a4b53a11 01-Aug-2005 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: DV parameter settings

This patch updates various scsi_transport_spi parameters with the actual
parameters used by the driver internally.
Domain Validation for all devices should now work properly.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 73a25462 22-Jul-2005 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: update to use scsi_transport_spi

This patch updates the aic79xx driver to take advantage of the
scsi_transport_spi infrastructure. Patch is quite a mess as some
procedures have been reshuffled to be closer to the aic7xxx driver.

Rejections fixed and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 60a13213 22-Jul-2005 Hannes Reinecke <hare@suse.de>

[SCSI] aic79xx: Remove busyq

From: Jeff Garzik <jgarzik@pobox.com>

This patch removes the busyq in aic79xx and uses the command-queue from
the midlayer instead. Additionally some dead code is removed.

Signed-off-by: Hannes Reinecke <hare@suse.de>

Fixed rejections

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 44456d37 27-Jul-2005 Olaf Hering <olh@suse.de>

[PATCH] turn many #if $undefined_string into #ifdef $undefined_string

turn many #if $undefined_string into #ifdef $undefined_string to fix some
warnings after -Wno-def was added to global CFLAGS

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# cc33895a 09-Jul-2005 Andrew Morton <akpm@osdl.org>

[SCSI] aic79xx: ahd_linux_dev_reset() cleanup

Use the macros consistently in ahd_linux_dev_reset().

If ahd_linux_dev_reset() really can be called with local interrupts disabled
then yuk.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# e632ba11 19-Jun-2005 Jeff Garzik <jgarzik@pretzel.yyz.us>

aic7xxx/aic79xx_osm: revert completely bogus ahd_linux_queue() patch


# 68b3aa7c 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>


# 94d0e7b8 28-May-2005 Jeff Garzik <jgarzik@pobox.com>

[SCSI] allow sleeping in ->eh_device_reset_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 8fa728a2 28-May-2005 Jeff Garzik <jgarzik@pobox.com>

[SCSI] allow sleeping in ->eh_abort_handler()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 8bd7f125 27-May-2005 Shaohua Li <shaohua.li@intel.com>

[PATCH] swsusp: ahd_dv_0 can't be stopped

This driver wants to set PF_NOFREEZE.

Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# be7db055 17-Apr-2005 Christoph Hellwig <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>


# 1da177e4 16-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!