aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-02-12[SCSI] pm8001: simplify workqueue usageTejun Heo3-33/+41
pm8001 manages its own list of pending works and cancel them on device free. It is unnecessarily complex and has a race condition - the works are canceled but not synced, so the work could still be running during and after the data structures are freed. This patch simplifies workqueue usage. * A driver specific workqueue pm8001_wq is created to serve these work items. * To avoid confusion, the "queue" suffixes are dropped from work items and functions. * Delayed queueing was never used. pm8001_work now uses work_struct instead. * The driver no longer keeps track of pending works. All pm8001_works are queued to pm8001_wq and the workqueue is flushed as necessary. flush_scheduled_work() usage is removed during conversion. Signed-off-by: Tejun Heo <[email protected]> Acked-by: Jack Wang <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-02-12[SCSI] remove flush_scheduled_work() usagesTejun Heo6-11/+7
Simple conversions to drop flush_scheduled_work() usages in drivers/scsi. More involved ones will be done in separate patches. * NCR5380, megaraid_sas: cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync(). * mpt2sas_scsih: drop unnecessary flush_scheduled_work(). * arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of using flush_scheduled_work(). Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_mid_low_api.txt recommend resid usageDouglas Gilbert1-1/+13
As discussed in a thread on this list titled: "RFC: short reads on block devices" this patch adds recommendations for LLDs to set resid when there might be uncertainty about how much data has been returned by a device. This patch inline and attached] is against scsi-misc-2.6.git Signed-off-by: Douglas Gilbert <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] libosd: osd_req_read_sg, optimize the single entry caseBoaz Harrosh1-4/+16
Since sg-read is a bidi operation, it is a gain to convert a single sg entry into a regular read. Better do this in the generic layer then force each caller to do so. Signed-off-by: Boaz Harrosh <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] libsas: remove spurious sata control register read/writeJames Bottomley1-51/+0
Originally, libata required the illusion that it could access the sata control register. Now, however, it can run perfectly well without them, so remove the dummy routines from libsas which tried to emulate them (but only ended up causing confusion). Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] libsas: convert to standard kernel debuggingJames Bottomley5-33/+1
Instead of using a config option for debugging, just dump the messages with KERN_DEBUG. Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] libsas: fix ATAPI check condition terminationJames Bottomley1-3/+5
ATAPI check condition needs to be treated the same as a success or protocol return. The register returns from the PACKET command are all correctly positioned in the device to host register FIS and so we should collect them properly. Right at the moment this doesn't matter because libata sends a request sense always for ATAPI errors, but if it ever checked the registers, we should have the correct contents just in case. Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_dh: Use scsi_devinfo functions to do matching of device_handler ↵Peter Jones3-75/+39
tables. Previously we were using strncmp in order to avoid having to include whitespace in the devlist, but this means "HSV1000" matches a device list entry that says "HSV100", which is wrong. This patch changes scsi_dh.c to use scsi_devinfo's matching functions instead, since they handle these cases correctly. Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] Add scsi_dev_info_list_del_keyed()Peter Jones2-0/+86
For scsi_dh.c to use devinfo lists, we have to be able to remove entries before rmmod. Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] cxgb3i: fixed connection problem with iscsi private ip[email protected]1-4/+15
fixed the connection problem when the private iscsi ipv4 address is provisioned on the interface. Signed-off-by: Karen Xie <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] MAINTAINERS: Update zfcp entryChristof Schmitt1-2/+1
Steffen will take over the zfcp maintainer work. Update the MAINTAINERS entry accordingly. Acked-by: Steffen Maier <[email protected]> Acked-by: Swen Schillig <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] mptfusion: Fix memory leak in mptctl_getiocinfo()Jesper Juhl1-1/+3
A 'kfree(karg)' is missing in a failure path in mptctl.c::mptctl_getiocinfo() which can cause a memory leak. Signed-off-by: Jesper Juhl <[email protected]> Acked-by: "Desai, Kashyap" <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] bnx2i: Added reconnect fix connecting against Lefthand targetsEddie Wai1-0/+3
The nopout's reserved field was not being initialized to zero before being reused. Stale CDB values from previous SCSI cmds of the same BHS offset was the cause of the disconnection initiated by the Lefthand target. Signed-off-by: Eddie Wai <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] cxgbi: get rid of gl_skb in cxgbi_ddp_info[email protected]4-63/+8
Remove gl_skb from cxgbi_ddp_info as it is only used by cxgb3i. Signed-off-by: Karen Xie <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] cxgbi: set ulpmode only if digest is on[email protected]1-7/+10
There is no need to set ulpmode on the tx skbs if no digest is enabled. Signed-off-by: Karen Xie <[email protected]> Reviewed-by: Mike Christie <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: avoid leaking stack contents to userlandVasiliy Kulikov1-0/+2
memset arg64 to zero in the passthrough ioctls to avoid leaking contents of kernel stack memory to userland via uninitialized padding fields inserted by the compiler for alignment reasons. Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: Fix problem that CMD_UNABORTABLE command status was treated as ↵Stephen M. Cameron1-0/+7
unknown Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: fix use of uninitialized variable in ↵Stephen M. Cameron1-2/+2
hpsa_add_msa2xxx_enclosure_device() Thanks to Scott Teel for noticing this. Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: Add a per controller commands_outstanding entry in /sysStephen M. Cameron1-0/+14
Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: use usleep_range not msleep for small sleepsStephen M. Cameron1-1/+1
Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: allow driver to put controller in either simple or performant modeStephen M. Cameron2-0/+13
Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: take the adapter lock in hpsa_wait_for_mode_change_ackStephen M. Cameron1-3/+8
Need to take the lock while accessing the register to check to see if config table changes have taken effect. Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: do not reset unknown boards on reset_devicesStephen M. Cameron1-1/+5
This is to prevent hpsa from resetting older boards which the cciss driver may be controlling. Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: limit commands allocated on reset_devicesStephen M. Cameron1-0/+5
This is to conserve memory in a memory-limited kdump scenario Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: Use kernel provided PCI state save and restore functionsStephen M. Cameron1-66/+15
and use the doorbell reset method if available (which doesn't lock up the controller if you properly save and restore all the PCI registers that you're supposed to.) Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: fix board status waiting codeStephen M. Cameron2-8/+40
After a reset, we should first wait for the board to become "not ready", and then wait for it to become "ready", instead of immediately waiting for it to become "ready", and do this waiting *after* restoring PCI config space registers. Also, only wait 10 secs for board to become "not ready" after a reset (it should quickly become not ready.) Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: Remove duplicate defines of DIRECT_LOOKUP_ constantsStephen M. Cameron1-2/+0
They are defined in hpsa_cmd.h Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: fixup DMA address before freeing.Stephen M. Cameron2-1/+2
Some low bits might have been set by the driver, causing a message like this to come out: [ 13.288062] ------------[ cut here ]------------ [ 13.293211] WARNING: at lib/dma-debug.c:803 check_unmap+0x1a1/0x654() [ 13.300387] Hardware name: ProLiant DL180 G6 [ 13.305335] hpsa 0000:06:00.0: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0x000000007f81e001] [size=640 bytes] Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] hpsa: defend against zero sized buffers in passthru ioctlsStephen M. Cameron1-20/+16
Signed-off-by: Stephen M. Cameron <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_dh_alua: add scalable ONTAP lun to dev listMike Snitzer1-0/+1
Currently NetApp's VID/PID details in the INQUIRY response shows up as 'NETAPP' and 'LUN'. With upcoming scalable SAN ONTAP version on NetApp controllers, the PID entry alone is being modified to 'LUN C-Mode' (to distinguish current ONTAP LUNs from scalable ONTAP LUNs). 'LUN' would still suffice for matching 'LUN C-Mode' but best to explicitly add these new NetApp LUNs to the device list. Reported-by: Martin George <[email protected]> Acked-by: Mike Christie <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_dh_alua: Add Promise VTrak to dev listIlgu Hong1-0/+1
Adds Promise VTrak devices to the ALUA device handler. Signed-off-by: Ilgu Hong <[email protected]> Signed-off-by: Joseph Gruher <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_dh_alua: fix stpg_endio group state reportingJoseph Gruher1-3/+5
Initialize stpg_endio() 'err' to SCSI_DH_OK and only change it to SCSI_DH_IO accordingly. This allows the switching of target group state to be properly reported when no error has occurred. Signed-off-by: Joseph Gruher <[email protected]> Signed-off-by: Ilgu Hong <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_dh_alua: fix deadlock in stpg_endioJoseph Gruher1-1/+2
The use of blk_execute_rq_nowait() implies __blk_put_request() is needed in stpg_endio() rather than blk_put_request() -- blk_finish_request() is called with queue lock already held. Signed-off-by: Joseph Gruher <[email protected]> Signed-off-by: Ilgu Hong <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Cc: [email protected] Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] scsi_dh_alua: fix submit_stpg returnJoseph Gruher1-2/+1
submit_stpg() will always return failure so alua_activate() will report failure via dm-multipath callback function. Even though the stpg fired successfuly dm-multipath does not know and always fails to change the valid path. By returning SCSI_DH_OK we're now skipping alua_activate()'s call to activate_complete 'fn'. But this is fine because stpg_endio() will call it via h->callback_fn(). Signed-off-by: Joseph Gruher <[email protected]> Signed-off-by: Ilgu Hong <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] mpt2sas: Bump version 08.100.00.00Kashyap, Desai1-2/+2
Upgrade driver version from 7.100.00.00 to 8.100.00.00 Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] mpt2sas: Basic Code Cleanup in mpt2sas_baseKashyap, Desai2-56/+68
Basic Code Cleanup: (1) _base_get_cb_idx and mpt2sas_base_free_smid were reorganized in similar fashion so the order of obtaining the cbx and smid are scsiio, hi_priority, and internal. (2) The hi_priority and internal request queue struct was made smaller by removing the scmd and chain_tracker, thus saving memory allocation. (3) For scsiio request, a new structure was created having the same elements from the former request tracker struct. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] mpt2sas: Add support for Customer specific branding messagesKashyap, Desai2-0/+40
Add support for Customer specific branding messages when device driver loads, based on specific customer subsystem vendor and device Ids Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24[SCSI] mpt2sas: Revision P MPI Header UpdateKashyap, Desai5-392/+18
Revision P MPI Header Update: a) Added enable/disable SATA NCQ operations to SAS IO Unit Control Request. b) Modified Host Based Discovery Action Request message format. c) Removed Device Path bit from IO Unit Page 1 Flags field. d) Added description of ChainOffset field for Diagnostic Data Upload Tool.Chaining is not allowed. Removed mpi2_history.txt file Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2011-01-24Merge branch 'BUG_ON' of ↵Linus Torvalds4-9/+32
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus * 'BUG_ON' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: Remove MAYBE_BUILD_BUG_ON BUILD_BUG_ON: make it handle more cases
2011-01-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linusLinus Torvalds6-15/+94
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: module: fix missing semicolons in MODULE macro usage param: add null statement to compiled-in module params module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n module: show version information for built-in modules in sysfs
2011-01-24Merge branch 'for-linus' of ↵Linus Torvalds10-14/+40
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: selinux: return -ENOMEM when memory allocation fails tpm: fix panic caused by "tpm: Autodetect itpm devices" TPM: Long default timeout fix trusted keys: Fix a memory leak in trusted_update(). keys: add trusted and encrypted maintainers encrypted-keys: rename encrypted_defined files to encrypted trusted-keys: rename trusted_defined files to trusted
2011-01-24Remove MAYBE_BUILD_BUG_ONRusty Russell4-4/+6
Now BUILD_BUG_ON() can handle optimizable constants, we don't need MAYBE_BUILD_BUG_ON any more. Signed-off-by: Rusty Russell <[email protected]>
2011-01-24BUILD_BUG_ON: make it handle more casesRusty Russell1-6/+27
BUILD_BUG_ON used to use the optimizer to do code elimination or fail at link time; it was changed to first the size of a negative array (a nicer compile time error), then (in 8c87df457cb58fe75b9b893007917cf8095660a0) to a bitfield. This forced us to change some non-constant cases to MAYBE_BUILD_BUG_ON(); as Jan points out in that commit, it didn't work as intended anyway. bitfields: needs a literal constant at parse time, and can't be put under "if (__builtin_constant_p(x))" for example. negative array: can handle anything, but if the compiler can't tell it's a constant, silently has no effect. link time: breaks link if the compiler can't determine the value, but the linker output is not usually as informative as a compiler error. If we use the negative-array-size method *and* the link time trick, we get the ability to use BUILD_BUG_ON() under __builtin_constant_p() branches, and maximal ability for the compiler to detect errors at build time. We also document it thoroughly. Signed-off-by: Rusty Russell <[email protected]> Cc: Jan Beulich <[email protected]> Acked-by: Hollis Blanchard <[email protected]>
2011-01-24module: fix missing semicolons in MODULE macro usageRusty Russell2-2/+2
You always needed them when you were a module, but the builtin versions of the macros used to be more lenient. Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2011-01-24param: add null statement to compiled-in module paramsLinus Walleij1-2/+4
Add an unused struct declaration statement requiring a terminating semicolon to the compile-in case to provoke an error if __MODULE_INFO() is used without the terminating semicolon. Previously MODULE_ALIAS("foo") (no semicolon) compiled fine if MODULE was not selected. Cc: Dan Carpenter <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2011-01-24module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=nRusty Russell1-1/+1
lib/built-in.o:(__modver+0x8): undefined reference to `__modver_version_show' lib/built-in.o:(__modver+0x2c): undefined reference to `__modver_version_show' Simplest to just not emit anything: if they've disabled SYSFS they probably want the smallest kernel possible. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2011-01-24module: show version information for built-in modules in sysfsDmitry Torokhov3-11/+88
Currently only drivers that are built as modules have their versions shown in /sys/module/<module_name>/version, but this information might also be useful for built-in drivers as well. This especially important for drivers that do not define any parameters - such drivers, if built-in, are completely invisible from userspace. This patch changes MODULE_VERSION() macro so that in case when we are compiling built-in module, version information is stored in a separate section. Kernel then uses this data to create 'version' sysfs attribute in the same fashion it creates attributes for module parameters. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2011-01-24selinux: return -ENOMEM when memory allocation failsDavidlohr Bueso2-3/+3
Return -ENOMEM when memory allocation fails in cond_init_bool_indexes, correctly propagating error code to caller. Signed-off-by: Davidlohr Bueso <[email protected]> Signed-off-by: James Morris <[email protected]>
2011-01-24tpm: fix panic caused by "tpm: Autodetect itpm devices"Olof Johansson1-3/+3
commit 3f0d3d016d89a5efb8b926d4707eb21fa13f3d27 adds a check for PNP device id to the common tpm_tis_init() function, which in some cases (force=1) will be called without the device being a member of a pnp_dev. Oopsing and panics ensue. Move the test up to before the call to tpm_tis_init(), since it just modifies a global variable anyway. Signed-off-by: Olof Johansson <[email protected]> Acked-by: Rajiv Andrade <[email protected]> Signed-off-by: James Morris <[email protected]>
2011-01-24TPM: Long default timeout fixRajiv Andrade1-4/+6
If duration variable value is 0 at this point, it's because chip->vendor.duration wasn't filled by tpm_get_timeouts() yet. This patch sets then the lowest timeout just to give enough time for tpm_get_timeouts() to further succeed. This fix avoids long boot times in case another entity attempts to send commands to the TPM when the TPM isn't accessible. Signed-off-by: Rajiv Andrade <[email protected]> Signed-off-by: James Morris <[email protected]>