WARNING! This commit changes external SCST interface, so it can break compilation of your out of SCST SVN tree target driver or dev handler. To fix it, simply supply the preferred exection context to scst_cmd_done() and/or scst_tgt_cmd_done().
Thanks to Bart Van Assche <bart.vanassche@gmail.com> for pointing on it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
an external module. When applying the SCST kernel patch to the mainstream
kernel tree with debugging and/or tracing enabled however, the resulting code
triggers a compiler error. This is because the symbols DEBUG and TRACING
conflict with symbols with the same named defined in unrelated kernel headers.
The patch below resolves these conflicts by renaming the following preprocessor
symbols:
- DEBUG into CONFIG_SCST_DEBUG.
- DEBUG_DIGEST_FAILURES into CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES.
- DEBUG_OOM into CONFIG_SCST_DEBUG_OOM.
- DEBUG_RETRY into CONFIG_SCST_DEBUG_RETRY.
- DEBUG_SN into CONFIG_SCST_DEBUG_SN.
- DEBUG_TM into CONFIG_SCST_DEBUG_TM.
- EXTRACHECKS into CONFIG_SCST_EXTRACHECKS.
- SCST_HIGHMEM into CONFIG_SCST_HIGHMEM.
- STRICT_SERIALIZING into CONFIG_SCST_STRICT_SERIALIZING.
- TM_DBG_GO_OFFLINE into CONFIG_SCST_TM_DBG_GO_OFFLINE. Mapped 0/1 values
into macro undefined / macro defined.
- TRACING into CONFIG_SCST_TRACING.
- USE_EXPECTED_VALUES into CONFIG_SCST_USE_EXPECTED_VALUES.
- In qla_isp/linux/isp_scst.c, renamed DEBUG into DEBUG_ISP_SCST.
- In qla_isp/..., renamed SCSI_TARGET in SCST_SCSI_TARGET.
- In qla_isp/..., renamed SCSI_TARGET_DEV in SCST_SCSI_TARGET_DEV.
Additionally, all CONFIG_SCSI_TARGET* macro's are renamed into CONFIG_SCST* in
order to avoid confusion between the STGT CONFIG-symbols and the SCST CONFIG-
symbols.
The following additional options are now configurable through Kconfig:
- CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
- CONFIG_SCST_STRICT_SERIALIZING
- CONFIG_SCST_STRICT_SECURITY
- CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
- CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
- CONFIG_SCST_USE_EXPECTED_VALUES
- CONFIG_SCST_DEBUG_OOM
- CONFIG_SCST_DEBUG_RETRY
- CONFIG_SCST_DEBUG_SN
- CONFIG_SCST_DEBUG_TM
- CONFIG_SCST_TM_DBG_GO_OFFLINE
The patch below has been verified as follows:
- Verified that the following command does not print any new warning messages:
make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s
- Verified as follows that the internal SCST patches still apply cleanly:
for p in *patch; do patch -p0 --dry-run -f -s <$p; done
- Checked that the patch generated by generate-kernel-patch still applies
cleanly to the 2.6.25.7 kernel, and that the patched kernel tree still
compiles, installs and boots fine, that the iscsi-scst, ib_srpt,
scst_disk and scst_vdisk modules still load, and that iSCSI communication
still works fine. All SCST kernel configuration options that could be
enabled have been enabled during this test.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@453 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below fixes the checkpatch complaints on kfree():
WARNING: kfree(NULL) is safe this check is probabally not required
This patch has been verified as follows:
- Verified that checkpatch does no longer complain about kfree().
- Verified that make -s clean && make -s iscsi scst && make -s -C srpt
still works and does not trigger any new compiler warnings.
- Checked that the patch generated by generate-kernel-patch still applies
cleanly to the 2.6.25.4 kernel, and that the patched kernel tree still
compiles, installs and boots fine, and that the iscsi-scst, ib_srpt,
scst_disk and scst_vdisk modules still load.
Note: I'm not sure any of the above verifications did trigger the code paths
changed by this patch.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@402 d57e44dd-8a1f-0410-8b47-8ef2f437770f
I've updated the MPT fusion target driver for LSI SCSI/FC/SAS HBAs. The original SCST MPT driver was based on the 1.00.13 LSI
sample target driver. LSI has since released version 1.00.14 of the sample target driver. I've ported all the changes from .13 to
.14 into the SCST MPT driver for consistency. I've also updated the SCST MPT driver to compile under 2.6.24 and 2.6.25.4. Finally,
I force the SCSI parallel transfer rate to very slow depending on the SCSI HBA firmware revision. Newer versions of SCSI HBA
firmware have a bug where the incorrect amount of data is transferred for non-divisible-by-4 length transfers (like standard 14 byte
REQUEST SENSE). LSI is aware of the problem and I'll update the driver to restore functionality upon a new good SCSI HBA firmware
release.
I still have not confirmed operation with LSI SAS or FC HBAs.
Signed-off-by: Erik Habbinga <erikhabbinga@inphase-tech.com>
Changes:
./mpt/mpt_scst.h
- differences between LSI sample target drivers 1.00.13 and 1.00.14
./mpt/Kconfig
- remove some unnecessary white space
./mpt/mpt_scst.c
- differences between LSI sample target drivers 1.00.13 and 1.00.14
- changes for kernel 2.6.24 and 2.6.25.4
- force slow transfers for newer SCSI HBA firmware versions
./mpt/Makefile
- simplified for inclusion into kernel source tree
./mpt/in-tree/Kconfig-2.6.24.diff
- patch against 2.6.24 and 2.6.25.4 drivers/message/fusion/Kconfig
./mpt/in-tree/Makefile.diff
- changed to work with generate-kernel-patch script
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@387 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The patch below implements the following changes:
- Fixes the remaining warnings reported by checkpatch.pl with regard to the use
of whitespace in C code.
- Adds double qoutes around some #warning messages, such that checkpatch.pl
does no longer try to interprete the text behind the #warning preprocessor
directive.
- Adds an extra conversion to the generate-kernel-patch script that removes
the single space from before goto-labels while generating the kernel patch.
This patch has been tested as follows:
- Verified that svn diff -x -w only shows changes in the #warning preprocessor directives.
- Verified the output of svn diff by reading it.
- Verified that checkpatch.pl does no longer complain on the use of whitespace
(searched through the checkpatch.pl output for the text ' space').
- Verified that the patch generated by the generate-kernel-patch script still
applies cleanly to the 2.6.24 kernel, and that the patched kernel still compiles cleanly.
Please let me know if I have to resubmit parts of this patch to other SCST authors.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
One of the Linux kernel patch submission requirements is that source files do
not contain trailing whitespace. The patch below removes trailing whitespace
from .c and .h source files.
Note: it might be more convenient to run the script I used to generate this
patch than to review and apply the patch below. This is how I generated and
verified the patch below:
cat <<EOF >./strip-trailing-whitespace
#!/bin/bash
trap "rm -f $t" EXIT
t=/tmp/temporary-file.$$
for f in "$@"
do
sed 's/[ ]*$//' <"$f" >"$t" && mv "$t" "$f"
done
EOF
chmod a+x ./strip-trailing-whitespace
find -name '*.[ch]' | xargs ./strip-trailing-whitespace
svn diff -x -w
Signed-off-by: <bart.vanassche@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
- "RECEIVE DIAGNOSTIC RESULTS" command handling fixed
- Obtaining device queue parameters in scst_obtain_device_parameters() changed to handle NOT READY sense
- Fixed possible dev_cmd_count underflow
- Minor iSCSI-SCST connection closing cleanups and fixes
- Semantic of other *_atomic flags changed a bit. Now they are intended only to allow SCST to optimize execution context. The corresponing functions now can *always* be called on atomic context and, if necessary, should manually determine that using scst_cmd_atomic() function and restart using corresponding *_NEED_THREAD_* return value.
- scst_cmd_get_tgt_resp_flags() and SCST_TSC_FLAG_STATUS flag made obsolete and replaced by scst_cmd_get_is_send_status(). All in-tree drivers updated accordingly
- Cleanup: preprocessing_done_atomic removed, now preprocessing_done() callback always called on thread context
- 64-bit cleanups
- Documented that iscsi-scst-adm is currently broken and explained why
- In user space Makefile's added possibility to specify external linker flags
- Minor performance optimizations
- Other minor cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
- Important reference counting and barriers usage cleanups
- Sense buffer made dynamic
- Other minor improvements and cleanups
- Docs updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@287 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Particularly:
- Added ability for target drivers to set result of command's status delvery to initiator (see scst_set_delivery_status())
- Added ability for user space devices set some mode page parameters to make SCST core behave correspondingly
- TM improvements
- Few possible crashes fixed
- Logging improvements
- Performance improvements
- Docs updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@227 d57e44dd-8a1f-0410-8b47-8ef2f437770f
* Allows LSI MPT target driver to compile on kernels >2.6.15
* Changes the way how gettid() syscall gate implemented
- Small doc update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@189 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch fixes a race condition where a pointer to the just-finished SCST command would interfere with the incoming target
command.
Also, printing out TargetStatusSendReq IOCStatus is now done in debug/tracing mode if we're a SCSI device and the expected "error" case for attempting to send simultaneous status and sense is triggered.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@86 d57e44dd-8a1f-0410-8b47-8ef2f437770f
- corrects the amount of data transferred when cached sense data is used to satisfy a REQUEST SENSE command.
- removes support for non scatterlist buffers in scst_cmd (sg_cnt == 0).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@81 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch further fixes sense handling for the LSI driver in the non-packetized SCSI case:
- this version doesn't crash if a REQUEST SENSE command is sent.
- added a big comment explaining sense caching implementation.
- INQUIRY responses are inspected and tagged command queuing bits are cleared if LSI is a SCSI controller, per previous discussions.
- pending sense is cleared on a bus reset.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@78 d57e44dd-8a1f-0410-8b47-8ef2f437770f
There are a few minor changes:
- fix some 80 char line length issues
- fix some indenting
- change scst_to_dma_dir to scst_to_tgt_dma_dir
The big issue is fixing the sending of sense data. The LSI chip, when talking to a non-packetized SCSI initiator, cannot send both
status (i.e. check condition) and sense data (from autosense) in the same transaction. The result is a 006B
(MPI_IOC_STATUS_TARGET_STS_DATA_NOT_SENT) IOCStatus value when this is attempted. The sense data doesn't get transmitted over the
SCSI cable in this case. My fix, which is modeled on LSI's own SCSI target implementation, is to cache sense data before attempting
to send it. If a REQUEST SENSE command comes in with pending sense, the LSI driver will handle the REQUEST SENSE command on it's
own without involving SCST. Pending sense is cleared once the REQUEST SENSE command is handled, or if any other command comes in.
Sense data is cached per initiator. Apparantely this problem is only related to non-packetized SCSI interfaces. That's all I have
to test with, so I can't vouch for SAS or FC.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@75 d57e44dd-8a1f-0410-8b47-8ef2f437770f
--This line, and below, will be ignored--
_M trunk/mpt
_M trunk/mpt/in-tree
M trunk/mpt/in-tree/Makefile.diff
M trunk/mpt/mpt_scst.c
M trunk/mpt/Makefile
M trunk/qla2x00t/qla2x00-target/qla2x00t.c
M trunk/scst/kernel/in-tree/Makefile.scsi_tgt
D trunk/scst/include/scst_debug.c
M trunk/scst/include/scst_debug.h
M trunk/scst/src/scst_proc.c
M trunk/scst/src/scst_priv.h
A trunk/scst/src/scst_debug.c
M trunk/scst/src/scst_targ.c
M trunk/scst/src/scst_mem.c
M trunk/scst/src/Makefile
M trunk/scst/src/scst.c
M trunk/scst/src/dev_handlers/scst_cdrom.c
M trunk/scst/src/dev_handlers/scst_modisk.c
M trunk/scst/src/dev_handlers/scst_changer.c
M trunk/scst/src/dev_handlers/scst_fileio.c
M trunk/scst/src/dev_handlers/scst_tape.c
M trunk/scst/src/dev_handlers/scst_disk.c
M trunk/scst/src/dev_handlers/scst_processor.c
M trunk/scst/src/dev_handlers/scst_raid.c
M trunk/scst/src/dev_handlers/Makefile
M trunk/scst/src/dev_handlers/scst_dev_handler.h
M trunk/scst/README
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@62 d57e44dd-8a1f-0410-8b47-8ef2f437770f