30 Mar, 2010
1 commit
-
…it 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 allmodconfig8. 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>
27 Feb, 2010
1 commit
-
Set power.async_suspend for all SCSI devices, targets and hosts, so
that they can be suspended and resumed in parallel with the main
suspend/resume thread and possibly with other devices they don't
depend on in a known way (i.e. devices which are not their parents or
children).The power.async_suspend flag is also set for devices that don't have
suspend or resume callbacks, because otherwise they would make the
main suspend/resume thread wait for their "asynchronous" children
(during suspend) or parents (during resume), effectively negating the
possible gains from executing these devices' suspend and resume
callbacks asynchronously.Signed-off-by: Rafael J. Wysocki
10 Dec, 2009
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
[SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
[SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
[SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
[SCSI] zfcp: Update FSF error reporting
[SCSI] zfcp: Improve ELS ADISC handling
[SCSI] zfcp: Simplify handling of ct and els requests
[SCSI] zfcp: Remove ZFCP_DID_MASK
[SCSI] zfcp: Move WKA port to zfcp FC code
[SCSI] zfcp: Use common code definitions for FC CT structs
[SCSI] zfcp: Use common code definitions for FC ELS structs
[SCSI] zfcp: Update FCP protocol related code
[SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
[SCSI] zfcp: Assign scheduled work to driver queue
[SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
[SCSI] zfcp: Implement module unloading
[SCSI] zfcp: Merge trace code for fsf requests in one function
[SCSI] zfcp: Access ports and units with container_of in sysfs code
[SCSI] zfcp: Remove suspend callback
[SCSI] zfcp: Remove global config_mutex
[SCSI] zfcp: Replace local reference counting with common kref
...
05 Dec, 2009
1 commit
-
Some of our virtual SCSI hosts don't have a proper bus parent at the
top, which can be a problem for doing DMA on themThis patch makes the host device cache a pointer to the physical bus
device and provides an extra API for setting it (the normal API picks
it up from the parent). This patch also modifies the qla2xxx and lpfc
vport logic to use the new DMA host setting API.Acked-By: James Smart
Cc: Stable Tree
Signed-off-by: James Bottomley
27 Nov, 2009
1 commit
-
__scsi_remove_device() in scsi_forget_host() is executed out of scan_mutex
and races with scsi_destroy_sdev()
Signed-off-by: Denis V. Lunev
Signed-off-by: Andrew Morton
Signed-off-by: James Bottomley
21 Jun, 2009
1 commit
-
Just once, two fcoe instances got the same host number
from scsi_add_host().Use atomic_t and atomic_inc_return() to get next host number.
Subtract 1, so that scsi_host still starts with 0.[jejb: added comment about unusual subtraction]
Signed-off-by: Joe Eykholt
Signed-off-by: James Bottomley
13 Mar, 2009
1 commit
-
The SCSI core calls scsi_proc_hostdir_add() from within
scsi_host_alloc(), but the corresponding scsi_proc_hostdir_rm()
routine is called from within scsi_remove_host(). As a result, if a
host is allocated and then deallocated without ever being registered,
the host's directory in /proc is leaked.This patch (as1181b) fixes this bug in the SCSI core by moving
scsi_proc_hostdir_rm() into scsi_host_dev_release().Signed-off-by: Alan Stern
Signed-off-by: James Bottomley
03 Jan, 2009
1 commit
-
[jejb: limit ioctl to returning 20 characters to avoid overrun
on long device names and add a few more conversions]
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: James Bottomley
04 Oct, 2008
1 commit
-
This patch cleans up the behavior of scsi_host_lookup().
The original implementation attempted to use the dual role of
either returning a pointer value, or a negative error code.
User's needed to use IS_ERR() to check the result. Additionally,
the IS_ERR() macro never checks for when a NULL pointer was
returned, so a NULL pointer actually passes with a success case.
Note: scsi_host_get(), used by scsi_host_lookup(), can return
a NULL pointer.Talk about a mudhole for the unitiated to step into....
This patch converts scsi_host_lookup() to return either NULL
or a valid pointer. The consumers were updated for the change.Signed-off-by: James Smart
Signed-off-by: James Bottomley
22 Jul, 2008
2 commits
-
Kobjects do not have a limit in name size since a while, so stop
pretending that they do.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This mirrors the functionality that driver_find_device has as well.
We add a start variable, and all callers of the function are fixed up at
the same time.The block layer will be using this new functionality in a follow-on
patch.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
16 Jul, 2008
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (102 commits)
[SCSI] scsi_dh: fix kconfig related build errors
[SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of
[SCSI] scsi_cmnd.h: remove double inclusion of linux/blkdev.h
[SCSI] make struct scsi_{host,target}_type static
[SCSI] fix locking in host use of blk_plug_device()
[SCSI] zfcp: Cleanup external header file
[SCSI] zfcp: Cleanup code in zfcp_erp.c
[SCSI] zfcp: zfcp_fsf cleanup.
[SCSI] zfcp: consolidate sysfs things into one file.
[SCSI] zfcp: Cleanup of code in zfcp_aux.c
[SCSI] zfcp: Cleanup of code in zfcp_scsi.c
[SCSI] zfcp: Move status accessors from zfcp to SCSI include file.
[SCSI] zfcp: Small QDIO cleanups
[SCSI] zfcp: Adapter reopen for large number of unsolicited status
[SCSI] zfcp: Fix error checking for ELS ADISC requests
[SCSI] zfcp: wait until adapter is finished with ERP during auto-port
[SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver
[SCSI] sg: Add target reset support
[SCSI] lib: Add support for the T10 (SCSI) Data Integrity Field CRC
[SCSI] sd: Move scsi_disk() accessor function to sd.h
...
12 Jul, 2008
1 commit
-
Make the needlessly global struct scsi_{host,target}_type static.
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: James Bottomley
16 Jun, 2008
1 commit
-
commit 9c7701088a61cc0cf8a6e1c68d1e74e3cc2ee0b7
Author: Dave Young
Date: Tue Jan 22 14:01:34 2008 +0800scsi: use class iteration api
Isn't a correct replacement for the original hand rolled host
lookup. The problem is that class_find_child would get a reference to
the host's class device which is never released. Since the host class
device holds a reference to the host gendev, the host can never be
freed.In 2.6.26 we started using class_find_device, and this function also
gets a reference to the device, so we end up with an extra ref
and the host will not get released.This patch adds a put_device to balance the class_find_device() get. I
kept the scsi_host_get in scsi_host_lookup, because the target layer
is using scsi_host_lookup and it looks like it needs the SHOST_DEL
check.Signed-off-by: Mike Christie
Signed-off-by: James Bottomley
28 Apr, 2008
1 commit
-
We're getting a WARN_ON from SLUB indicating that we're trying to free
caches with in-use objects. The root cause is a new dependency in the
command/sense free on unchecked_isa_dma. The WARN_ON is caused by
drivers which change this in their setup after the command/sense cache
is allocated.The fix is to move the allocation of this cache into scsi_add_host()
so things like gdth have an opportunity to modify it between alloc and
add (but *not* after).The true fix would be to move unchecked_isa_dma into the template and
out of the host, so it because a truly read only variable.Signed-off-by: James Bottomley
23 Apr, 2008
2 commits
-
This patch removes the unused sysfs attibute overwriting logic for
the scsi host attibutes, and plugs them into the driver core default
attribute creation.Signed-off-by: Hannes Reinecke
Signed-off-by: Kay Sievers
Signed-off-by: James Bottomley -
This patch implements scsi_host and scsi_target device types
and adds both to the scsi_bus.Signed-off-by: Hannes Reinecke
Signed-off-by: Kay Sievers
Signed-off-by: James Bottomley
20 Apr, 2008
1 commit
-
It's big, but there doesn't seem to be a way to split it up smaller...
Signed-off-by: Tony Jones
Signed-off-by: Kay Sievers
Cc: Roland Dreier
Cc: Sean Hefty
Cc: Hal Rosenstock
Cc: James Bottomley
Signed-off-by: Greg Kroah-Hartman
08 Apr, 2008
1 commit
-
In the following if/else statement, shost->active_mode will always be set,
so this assignment is unneeded.Signed-off-by: Denis Cheng
Signed-off-by: James Bottomley
28 Mar, 2008
1 commit
-
This patch corrects some cases in scsi_add_host() that fail, but the "error"
return code was not reset after a prior use which set it to a non-error value.Patch cut against scsi-rc-fixes-2.6
Signed-off-by: James Smart
Signed-off-by: James Bottomley
31 Jan, 2008
1 commit
-
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
26 Jan, 2008
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits)
[SCSI] usbstorage: use last_sector_bug flag universally
[SCSI] libsas: abstract STP task status into a function
[SCSI] ultrastor: clean up inline asm warnings
[SCSI] aic7xxx: fix firmware build
[SCSI] aacraid: fib context lock for management ioctls
[SCSI] ch: remove forward declarations
[SCSI] ch: fix device minor number management bug
[SCSI] ch: handle class_device_create failure properly
[SCSI] NCR5380: fix section mismatch
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
[SCSI] IB/iSER: add logical unit reset support
[SCSI] don't use __GFP_DMA for sense buffers if not required
[SCSI] use dynamically allocated sense buffer
[SCSI] scsi.h: add macro for enclosure bit of inquiry data
[SCSI] sd: add fix for devices with last sector access problems
[SCSI] fix pcmcia compile problem
[SCSI] aacraid: add Voodoo Lite class of cards.
[SCSI] aacraid: add new driver features flags
[SCSI] qla2xxx: Update version number to 8.02.00-k7.
[SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
...
25 Jan, 2008
1 commit
-
Convert to use the class iteration api.
Signed-off-by: Dave Young
Cc: James Bottomley
Signed-off-by: Greg Kroah-Hartman
24 Jan, 2008
2 commits
-
Only hosts which actually have ISA DMA requirements need sense buffers
coming out of ZONE_DMA, so only use the __GFP_DMA flag for that case
to avoid allocating this scarce resource if it's not necessary.[tomo: fixed slab leak in failure case]
Acked-by: FUJITA Tomonori
Signed-off-by: James Bottomley -
This removes static array sense_buffer in scsi_cmnd and uses
dynamically allocated sense_buffer (with GFP_DMA).The reason for doing this is that some architectures need cacheline
aligned buffer for DMA:http://lkml.org/lkml/2007/11/19/2
The problems are that scsi_eh_prep_cmnd puts scsi_cmnd::sense_buffer
to sglist and some LLDs directly DMA to scsi_cmnd::sense_buffer. It's
necessary to DMA to scsi_cmnd::sense_buffer safely. This patch solves
these issues.__scsi_get_command allocates sense_buffer via kmem_cache_alloc and
attaches it to a scsi_cmnd so everything just work as before.Signed-off-by: FUJITA Tomonori
Signed-off-by: James Bottomley
12 Jan, 2008
1 commit
-
Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update
lots of kerneldoc comments in drivers/scsi/*.Updated with comments from Stefan Richter, Stephen M. Cameron,
James Bottomley and Randy Dunlap.Signed-off-by: Rob Landley
Signed-off-by: James Bottomley
18 Oct, 2007
1 commit
-
if shost->supported mode is zero (i.e. MODE_UNKNOWN) show it as
initiator (it's obviously an unconverted driver that won't do target).Acked-by: FUJITA Tomonori
Signed-off-by: James Bottomley
16 Oct, 2007
1 commit
-
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
Signed-off-by: Jens Axboe
13 Oct, 2007
1 commit
-
This adds supported_mode and active_mode attributes to
/sys/class/sys_host/hostX/ for specifying the mode that a lld supports
and the currently activated mode. The output format is similar to fc
rport roles:luce:/sys/class/scsi_host/host0$ cat supported_mode
Initiator
luce:/sys/class/scsi_host/host0$ cat active_mode
InitiatorThe mode values uses bitmap since we would support dual-mode llds in
the future like this:luce:/sys/class/scsi_host/host0$ cat supported_mode
Initiator, TargetThe supported_mode attribute looks at a scsi_host_template and the
active_mode attribute looks at a scsi_host. We would add a hook to a
scsi_host_template to change the active_mode attribute
dynamically. But now there is no hook since no lld supports that
feature.Signed-off-by: FUJITA Tomonori
Signed-off-by: Mike Christie
Signed-off-by: James Bottomley
01 Aug, 2007
1 commit
-
It's better to initialize host->shost_data to zero like
target->starget_data and device->sdev_data.Signed-off-by: FUJITA Tomonori
Signed-off-by: James Bottomley
28 Apr, 2007
1 commit
-
SCSI was using the incorrect lock to protect walking the list of all
devices in the class. This patch fixes this.Cc: James Bottomley
Signed-off-by: Greg Kroah-Hartman
26 Nov, 2006
1 commit
-
This patch contains the needed changes to the scsi-ml for the target
mode support.Note, per the last review we moved almost all the fields we added
to the scsi_cmnd to our internal data structure which we are going
to try and kill off when we can replace it with support from other
parts of the kernel.The one field we left on was the offset variable. This is needed to handle
the case where the target gets request that is so large that it cannot
execute it in one dma operation. So max_secotors or a segment limit may
limit the size of the transfer. In this case our tgt core code will
break up the command into managable transfers and send them to the
LLD one at a time. The offset is then used to tell the LLD where in
the command we are at. Is there another field on the scsi_cmd for
that?Signed-off-by: Mike Christie
Signed-off-by: FUJITA Tomonori
Signed-off-by: James Bottomley
16 Nov, 2006
1 commit
-
scsi_assign_lock has been unused for a long time and is a bad idea
in general, so kill it.Signed-off-by: Christoph Hellwig
Signed-off-by: James Bottomley
31 Aug, 2006
1 commit
-
This patch adds support for sharing tag maps at the host level
(i.e. either every queue [LUN] has its own tag map or there's a single
one for the entire host). This formulation is primarily intended to
help single issue queue hardware, like the aic7xxxSigned-off-by: James Bottomley
07 Aug, 2006
1 commit
-
If you examine the queue_work() routine you'll see that it returns
1 on success, 0 if the work is already queued.This patch corrects the source code documentation for the
scsi_queue_work function.Signed-off-by: Michael Reed
Signed-off-by: James Bottomley
11 Apr, 2006
1 commit
-
Overriding the whole EH code is a per-transport, not per-host thing.
Move ->eh_strategy_handler to the transport class, same as
->eh_timed_out.Downside is that scsi_host_alloc can't check for the total lack of EH
anymore, but the transition period from old EH where we needed it is
long gone already.Signed-off-by: Christoph Hellwig
Signed-off-by: Jeff Garzik
28 Feb, 2006
1 commit
-
Change the core SCSI code to use kzalloc rather than kmalloc+memset
where possible.Signed-off-by: Jes Sorensen
Signed-off-by: James Bottomley
13 Jan, 2006
1 commit
-
the scsi layer is using semaphores in a mutex way, this patch converts
these into using mutexes insteadSigned-off-by: Arjan van de Ven
Signed-off-by: James Bottomley
06 Jan, 2006
1 commit
-
All ordered request related stuff delegated to HLD. Midlayer
now doens't deal with ordered setting or prepare_flush
callback. sd.c updated to deal with blk_queue_ordered
setting. Currently, ordered tag isn't used as SCSI midlayer
cannot guarantee request ordering.Signed-off-by: Tejun Heo
Signed-off-by: Jens Axboe
05 Nov, 2005
1 commit
-
Conflicts in dec_esp.c (Thanks Bacchus), scsi_transport_iscsi.c and
scsi_transport_fc.hSigned-off-by: James Bottomley