8786 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
d2536357bc From Erik Habbinga:
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
2007-02-02 12:26:50 +00:00
Vladislav Bolkhovitin
d8bd3482e1 Here is a patch to the scstadmin script that solves my startup problems, when
initiator doesn't see the target and puts in the kernel log messages like that:

qla2300 0000:02:03.0: scsi(6:0:0): Abort command issued -- a 2002.
 6:0:0:0: scsi: Device offlined - not ready after error recovery
 6:0:0:0: rejecting I/O to offline device

All it does is move the enabling of target mode to the end of the
applyConfiguration subroutine. The key seems to be that target mode must
be enabled after SCST device and group assignments are configured. 

From Brad Johnson <bjohnson@proficientsolutionsinc.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@85 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-24 13:31:00 +00:00
Vladislav Bolkhovitin
a0867f49fc In Qlogic initiator driver (version 8.01.04) in qla2x00_rff_id() BIT_1 of the RFF_ID
Feature bits is set, indicating to the name server that this is an
initiator. The attached patch sets BIT_0 instead if target mode is
enabled, indicating target mode support to the name server. (See the
INCITS FC-GS-4 document). This fixed many of my problems relating to
working with a switch fabric, including the discovery and addition of
the initiator ports in the fcports list.

From Brad Johnson <bjohnson@proficientsolutionsinc.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@84 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-24 13:17:20 +00:00
Vladislav Bolkhovitin
c8a47b0753 Bugfix for Fedora 6 kernel where GFP_ATOMIC constant is redefined, which lead to massive commands data
buffers memory allocations failures.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@83 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-22 10:38:18 +00:00
Vladislav Bolkhovitin
cebd38b37e - shutdown_mutex was replaced by shutdown_compl in hope that it will
remove the lockdep's warning about "trying to register
 - Ability to trace SYNCHRONIZE_CACHE, FUA and ORDERED commands added to
FILEIO
 - NULLIO for FILEIO doesn't require anymore path to a real file/device


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@82 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-18 11:30:05 +00:00
Vladislav Bolkhovitin
a2d3812550 From Erik Habbinga:
- 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
2007-01-18 10:59:48 +00:00
Vladislav Bolkhovitin
13ef297e76 Minor TM-related fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@80 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-17 14:47:21 +00:00
Vladislav Bolkhovitin
73a0c8b152 From Erik Habbinga: added note on REQUEST SENSE implementation
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@79 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-16 17:51:48 +00:00
Vladislav Bolkhovitin
c7b6d79352 From Erik Habbinga:
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
2007-01-16 14:23:44 +00:00
Vladislav Bolkhovitin
4b84541a21 Some cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@77 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-12 15:42:31 +00:00
Vladislav Bolkhovitin
4a6c891705 Minor tracing cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@76 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-11 12:46:22 +00:00
Vladislav Bolkhovitin
5f81d67e70 Patch from Erik Habbinga:
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
2007-01-11 12:39:10 +00:00
Vladislav Bolkhovitin
9bb1f8eefe Atomic memory barriers cleanup. Inspired by Ming Zhang.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@74 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-09 14:52:16 +00:00
Vladislav Bolkhovitin
a0ef0b8fb2 Minor fixes and cleanups from Ming Zhang:
- Fixed scst_cur_cmd_mem leak for real devices
 - Since scst_unregister_target_template() returnes void it should use down() instead of down_interruptible()
 - Cleanups


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@73 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-08 17:56:35 +00:00
Vladislav Bolkhovitin
b09e1e7d46 Call graphs from Ming
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@72 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2007-01-08 14:05:24 +00:00
Vladislav Bolkhovitin
046ffc3d09 A bunch of cleanups and minor fixes by Ming:
- Dead code removed from scst_prepare_space()
 - LUN and CDB check moved out of EXTRACHECKS section
 - Fixed error processing in scst_register_dev_driver(), scst_sgv_pools_init() and scst_register()
 - Since scst_unregister_dev_driver() returnes void it should use down() instead of down_interruptible()
 - Clean out scst_num_cpus
 - Fixed race in scst_register_target_template()


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@71 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-29 11:38:43 +00:00
Vladislav Bolkhovitin
c116ec22f4 SCST user space device handler. User space interface description. Version 0.3.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@70 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-28 11:10:22 +00:00
Vladislav Bolkhovitin
fc5236bf09 - Cleanup: masked_status deleted, use status instead
- In FILEIO report in MODE SENSE if NV_CACHE enabled that no commands reordering is possible


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@69 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-21 11:04:34 +00:00
Vladislav Bolkhovitin
dc7b5d8684 From Erik Habbinga:
This patch allows reading and writing of the LSI SCSI target id via /proc/scsi_tgt/mpt_scst/x (where x is the controller number). Reading that file dumps various statistics as before:

# cat /proc/scsi_tgt/mpt_scst/0
ProductID        :0x020b (LSI53C1030)
Target Enable    :True
Target ID        :3
Capabilities     :0x7087fa0
PhysicalInterface:0x30000fe
Configuration    :0x3000800
OnBusTimerValue  :0x0
TargetConfig     :0x1
IDConfig         :0x0
PortFlags        :0x2000000
PortSettings     :0x37020000
  Device 00: 0x7087fa0, 0x0
  Device 01: 0x7087fa0, 0x0
  Device 02: 0x7087fa0, 0x0
  Device 03: 0x7087fa0, 0x0
  Device 04: 0x7087fa0, 0x0
  Device 05: 0x7087fa0, 0x0
  Device 06: 0x7087fa0, 0x0
  Device 07: 0x7087fa0, 0x0
  Device 08: 0x7087fa0, 0x0
  Device 09: 0x7087fa0, 0x0
  Device 10: 0x7087fa0, 0x0
  Device 11: 0x7087fa0, 0x0
  Device 12: 0x7087fa0, 0x0
  Device 13: 0x7087fa0, 0x0
  Device 14: 0x7087fa0, 0x0
  Device 15: 0x7087fa0, 0x0

Writing "target_id:n" will change the SCSI target id to n.


# echo "target_id:5" > /proc/scsi_tgt/mpt_scst/0
# cat /proc/scsi_tgt/mpt_scst/0
ProductID        :0x020b (LSI53C1030)
Target Enable    :True
Target ID        :5
Capabilities     :0x7087fa0
....


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@68 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-20 17:53:41 +00:00
Vladislav Bolkhovitin
3eb6d67674 This patch removes usage of bexx_to_cpu() on lba and len conversion, because possible unalined access, + some cosmetics. From Ming Zhang.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@67 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-19 18:07:56 +00:00
Vladislav Bolkhovitin
b3e2455cb2 Not debug compilation fixed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@66 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-18 15:07:12 +00:00
Vladislav Bolkhovitin
59fb188c83 ChangeLog updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@65 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-15 16:49:15 +00:00
Vladislav Bolkhovitin
2348328a45 - Patch from Ming Zhang <blackmagic02881@gmail.com>:
Small patch to enhance the 2TB support. MS Windows only like a 12 byte
response. It seems to still follow the sbc2r10 spec instead of the r16
spec we use.

detailed info can be found at
http://sourceforge.net/mailarchive/forum.php?thread_id=31236894&forum_id=40837

 - Small cleanup


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@64 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-15 16:30:30 +00:00
Vladislav Bolkhovitin
c2fafc2cf2 Small cleanup to the prev. commit
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@63 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-15 16:14:04 +00:00
Vladislav Bolkhovitin
ba4f29ee54 Update to allow SCST built inside Linux kernel. Done together with Erik Habbinga.
--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
2006-12-15 15:59:21 +00:00
Vladislav Bolkhovitin
32c3fd4e19 - Minor cleanup
- Corrected definition PERSISTENT_RESERV_IN and PERSISTENT_RESERV_OUT


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@61 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-15 11:45:24 +00:00
Vladislav Bolkhovitin
0e04ac351a Update to work on 2.6.19. Mostly done by Ming Zhang.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@60 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 18:10:39 +00:00
Vladislav Bolkhovitin
bf30ca2c93 - First step to SCSI_ID support
- Set correct response data length for emulated commands.
Mostly done by Ming Zhang.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@59 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 17:53:01 +00:00
Vladislav Bolkhovitin
b4e6b71a90 Internal threads management reimplemented based on kthread*() API. Mostly done by Ming Zhang.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@58 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 17:50:57 +00:00
Vladislav Bolkhovitin
f1e2c33ac7 /proc implementation moved to seq_*() library. Mostly done by Ming Zhang.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@57 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 17:08:46 +00:00
Vladislav Bolkhovitin
f375c2e756 Various changes and fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@56 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 16:22:29 +00:00
Vladislav Bolkhovitin
d01eacc4d2 Reorganized getting CDB info (scst_get_cdb_info()) to make it more
peformance effective. Mostly done by Ming Zhang.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@55 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 15:52:16 +00:00
Vladislav Bolkhovitin
426e0474e0 - Switch kmem_cache_alloc() -> kmem_cache_zalloc()
- Minor changes

M    trunk/qla2x00t/qla2x00-target/qla2x00t.h
M    trunk/qla2x00t/qla2x00-target/qla2x00t.c
M    trunk/scst/src/scst_lib.c
M    trunk/Makefile


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@54 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 15:42:11 +00:00
Vladislav Bolkhovitin
b4d0d03e63 Kernel version specified
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@53 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-14 10:13:51 +00:00
Vladislav Bolkhovitin
06811bc7ab Updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@52 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-13 18:12:44 +00:00
Vladislav Bolkhovitin
e5843199f2 Building from the Linux kernel tree added
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@51 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-13 12:16:11 +00:00
Vladislav Bolkhovitin
7209d4b37f Minor cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@50 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-13 11:51:41 +00:00
Vladislav Bolkhovitin
58c3c9893a LSI/MPT target driver added
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@49 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-13 11:42:59 +00:00
Vladislav Bolkhovitin
097d281f04 Minor update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@48 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-13 11:32:36 +00:00
Vladislav Bolkhovitin
549b81f7cc Minor cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@47 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-13 11:26:23 +00:00
Vladislav Bolkhovitin
ea2141e197 Suggested changes to support CPU cache flushing before doing DMA to target devices.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@46 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-12 11:20:19 +00:00
Vladislav Bolkhovitin
e63a0dcbd0 Take 2 of fixing the race, which could lead to BUG() in scst_mgmt_thread()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@45 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-12 09:18:04 +00:00
Vladislav Bolkhovitin
19061ed988 - Fixed a race, which could lead to BUG() in scst_mgmt_thread()
- Credits updated


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@44 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-05 10:22:53 +00:00
Vladislav Bolkhovitin
de3801ce0b Erik Habbinga <erikhabbinga@inphase-tech.com>
I've seen a case where TRACE_BUFFER is called with a NULL buffer pointer.  This patch adds a check to debug_print_buffer in
scst_debug.c to avoid dereferencing any incoming NULL pointers.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@43 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-04 11:08:18 +00:00
Vladislav Bolkhovitin
70a97084f2 From Erik Habbinga <erikhabbinga@inphase-tech.com>
This patch addes include/vmalloc.h to scst_fileio.c to avoid "implied function" compiler warnings for vmalloc and vfree.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@42 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-04 11:04:28 +00:00
Vladislav Bolkhovitin
22eee9b4a8 From Erik Habbinga <erikhabbinga@inphase-tech.com>
This patch initializes the res variable in the scst_proc_update_size and fileio_proc_update_size to get rid of "variable might be used unintialized" compiler warnings.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@41 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-04 11:02:50 +00:00
Vladislav Bolkhovitin
3c0e316ce6 From Erik Habbinga <erikhabbinga@inphase-tech.com>
This patch allows SCST to compile on a PPC/powerpc platform.  PPC already has strcasecmp and strncasecmp defined in
include/asm-powerpc/string.h.  The patch takes strcasecmp/strncasecmp out of scst_proc.c



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@40 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-04 10:59:26 +00:00
Vladislav Bolkhovitin
22041237a9 Updated version to 0.9.6 and Makefiles to bring the debug options back
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@39 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-04 10:53:25 +00:00
Vladislav Bolkhovitin
4784c2ec6e Release 0.9.5 of both SCST and Qlogic target driver
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@38 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-12-01 19:01:35 +00:00
Vladislav Bolkhovitin
f668acb6d5 A bunch of small fixes and cleanups before 0.9.5
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@37 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2006-11-30 16:44:59 +00:00