Commit Graph

401082 Commits

Author SHA1 Message Date
H Hartley Sweeten
617c8264de staging: comedi: ni_at_ao: fix board names
This driver works with "at-ao-6/10" boards not "ai-ao-6/10" boards.
Fix the names in the boardinfo.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
50a9cd5871 staging: comedi: ni_at_ao: change MODULE_DESCRIPTION
Change the MODULE_DESCRIPTION to something useful instead of the
generic "Comedi low-level driver".

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
58c34c3190 staging: comedi: ni_at_ao: tidy up multi-line comments
Cleanup the multi-line comments to follow the CodingStyle.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
32d5767a49 staging: comedi: ni_at_ao: tidy up atao_attach()
For aesthetics, add some whitespace to the subdevice init.

Remove the printk noise at the end of the attach.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
bf9fab836f staging: comedi: ni_at_ao: tidy up atao_ao_rinsn()
For aesthetics, rename this function to help with greps.

Tidy up this function to follow the normal format for analog
output read back functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
8305aac357 staging: comedi: ni_at_ao: tidy up atao_ao_winsn()
For aesthetics, rename this function to help with greps.

For channel 0, register group 1 only needs to be selected before
writing the values and restored to group 0 when the writes are
finished. Move the code out of the for () loop.

Use the comedi_ffset_munge() helper to handle the offset binary to
two's complement munging.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
a7d3d419f9 staging: comedi: ni_at_ao: introduce atao_select_reg_group()
To clarify the code a bit, introduce a helper function to set/clear
the GRP2WR bit in the CFG1 register. This bit selects which group of
registers are used for the registers that share the same I/O addresses.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:50 -07:00
H Hartley Sweeten
100515f810 staging: comedi: ni_at_ao: move the atao_reset() function
For aesthetics, move this function closer to it's only caller.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:49 -07:00
H Hartley Sweeten
83fa0099e7 staging: comedi: ni_at_ao: move the boardinfo declaration
For aesthetics, move the boardinfo declaration closer to the struct
definition. Also, remove the cut-and-paste skel driver comment.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:49 -07:00
H Hartley Sweeten
4d60c12d0c staging: comedi: ni_at_ao: rename the rest of the register map
For aesthetics, rename the remaining register map defines so they
follow the same format as the ones already renamed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:49 -07:00
H Hartley Sweeten
947f850419 staging: comedi: ni_at_ao: use 8253.h helpers
To better document the code, use the 8254.h helpers to set the
timers instead of doing the outb() instructions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:49 -07:00
H Hartley Sweeten
5bcaed8559 staging: comedi: ni_at_ao: tidy up the CFG3 register defines
Rename the defines for the CFG3 register so they have namespace
associated with the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:49 -07:00
H Hartley Sweeten
12c15b195f staging: comedi: ni_at_ao: tidy up the calibration subdevice
The AT-AO-6/10 boards use DAC8800 TrimDACs to software calibrate the
analog output channels. These are exposed to the user as a calibration
subdevice.

Tidy up, and document, the calibration subdevice.

Since the TrimDACs are not readable, store the calibration values in the
private data for the user to read back as needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:49 -07:00
H Hartley Sweeten
4fbb2e92ca staging: comedi: ni_at_ao: remove 'cfg2' from private data
This member of the private data is initialized to '0' during the
board reset then never changed. Just remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:48 -07:00
H Hartley Sweeten
3390ed32ae staging: comedi: ni_at_ao: tidy up the STATUS register defines
Rename the defines for the STATUS register so they have namespace
associated with the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:48 -07:00
H Hartley Sweeten
c8d348d427 staging: comedi: ni_at_ao: tidy up CFG1 register defines
Rename the defines for the CFG1 register so they have namespace
associated with the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:48 -07:00
H Hartley Sweeten
0960777727 staging: comedi: ni_at_ao: tidy up digital i/o register defines
The digital in and digital out registers on this board share the same
address. They also effect the same digital i/o pins. To make this clear
combine the two defines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:48 -07:00
H Hartley Sweeten
b72116bb48 staging: comedi: ni_at_ao: tidy up the register map defines
For aesthetics, sort the register map defines so the normal registers
are listed first and then alternate registers (when the GRP2WR bit is
set).

Convert the register bit defines into bit shifts to make them clear.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:48 -07:00
H Hartley Sweeten
6a6116c282 staging: comedi: ni_at_ao: remove ATAO_SIZE define
This define is only used during the board attach to specify the
I/O region length. Remove the define and just open code the value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 14:04:48 -07:00
Malcolm Priestley
c545e6a6f0 staging: vt6656: rxtx.c remove dead code s_uFillDataHead/pvTxDataHd.
uFillDataHead in is now dead so remove and pvTxDataHd.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:10 -07:00
Malcolm Priestley
c12dca0946 staging: vt6656: rxtx.c add no rts struct vnt_tx_datahead_ab
Add no rts/cts vnt_tx_datahead_ab to union vnt_tx_data_head.

The need_mic now applies to all modes of packet type PK_TYPE_11B.

and return vnt_rxtx_datahead_ab in s_vGenerateTxParameter

This removes pvTxDataHd pointer assignment and calls to s_uFillDataHead.

Since pvTxDataHd is now null a small vendor hack to vDMA0_tx_80211/csMgmt_xmit
to do with Disassociation-packet is also changed correct head position.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:09 -07:00
Malcolm Priestley
5634a5ab6a staging: vt6656: rxtx.c parse out vnt_rxtx_datahead_ab
Parse struct vnt_tx_datahead_ab from s_uFillDataHead and
move to struct vnt_rts_ab structure returning duration down
functions.

Both are returned in s_uFillDataHead at this stage as pvTxDataHd
is only null in s_bPacketToWirelessUsb.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:09 -07:00
Malcolm Priestley
a90186e458 staging: vt6656: rxtx.c add no rts struct vnt_tx_datahead_a_fb
Add no rts/cts vnt_tx_datahead_a_fb to union vnt_tx_data_head.

The need_mic now applies to all modes of packet type PK_TYPE_11A.

and return vnt_rxtx_datahead_a_fb in s_vGenerateTxParameter

This removes pvTxDataHd pointer assignment.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:09 -07:00
Malcolm Priestley
bd3f51f1ad staging: vt6656: rxtx.c parse out struct vnt_tx_datahead_a_fb
Parse struct vnt_tx_datahead_a_fb from s_uFillDataHead and
move to struct vnt_rts_a_fb structure returning duration down
functions.

This removes pvTxDataHd pointer assignment.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:09 -07:00
Malcolm Priestley
5b852f5352 staging: vt6656: rxtx.c Parse struct vnt_tx_datahead_g_fb
Parse struct vnt_tx_datahead_g_fb from s_uFillDataHead and
move to struct vnt_rts_g_fb/struct vnt_cts_fb structure returning
duration down functions.

This removes pvTxDataHd pointer assignment.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:09 -07:00
Malcolm Priestley
78363fd187 staging: vt6656: rxtx.c Parse struct vnt_tx_datahead_g
Parse struct vnt_tx_datahead_g from s_uFillDataHead and
move to struct vnt_rts_g/struct vnt_cts structure.

This removes pvTxDataHd pointer assignment.

The duration_id(uDuration) field is now returned in s_vGenerateTxParameter.

The return of s_uFillDataHead temporary or'ed to retain functionality of
other functions and is removed at the end of this patch series.

Since pvTxDataHd is now null a small vendor hack to vDMA0_tx_80211/csMgmt_xmit
to do with Disassociation-packet is also changed correct head position.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:09 -07:00
Malcolm Priestley
0a0f4b6959 staging: vt6656: rxtx.c change tx functions to return u16
s_vGenerateTxParameter, s_vFillCTSHead, s_vFillRTSHead, vnt_rxtx_rts* functions
to return u16

Initially this is the duration_id field for ieee80211_hdr

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:56:08 -07:00
Kamlakant Patel
d974ce4f3b Staging: MTD: Micron SPINAND Driver support
This patch adds support for Micron SPINAND via MTD.

Signed-off-by: Mona Anonuevo <manonuevo@micron.com>
Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:53:48 -07:00
Thomas Cort
77e73e8c90 Staging: rtl8712: fix spaces before semicolons
Resolve all of the 'WARNING: space prohibited before semicolon'
checkpatch warnings for rtl8712.

Signed-off-by: Thomas Cort <linuxgeek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:50:54 -07:00
Matthijs Kooijman
2d1155478f staging: dwc2: Make dwc2_hw_params.host_channels large enough
The hardware offers a 4-bit register containing the number of host
channels. However, the values of these register mean 1-16 host channels,
not 0-15. Since the dwc2_hw_params struct stores the actual number of
host channels supported instead of the raw register value, it should be
5 bits wide instead of 4.

Before this commit, hardware with 16 host channels would overflow the
field, making it appear as 0 channels.

This bug was introduced in commit 9badec2 (staging: dwc2: interpret all
hwcfg and related register at init time).

Reported-by: Dinh Nguyen <dinguyen@altera.com>
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:50:54 -07:00
Shalin Mehta
ab06e0f20e staging: speakup: str initialization replaced with NULL where it was initialized with int
Fixed warnings in all of three files where the string was initilized with an integer instead of NULL

Signed-off-by: Shalin Mehta <shalinmehta85@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:50:54 -07:00
Aaro Koskinen
72b80113a6 staging: octeon-usb: cvmx-usb.h: make comments to fit into 80 columns
Make comments to fit into 80 columns.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:12 -07:00
Aaro Koskinen
ab09e5c148 staging: octeon-usb: cvmx-usb.c: make comments to fit into 80 columns
Make comments to fit into 80 columns.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen
d0adff6acd staging: octeon-usb: cvmx-usb: delete unused macros
Delete unused cvmx_read_csr / cvmx_write_csr macros.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen
5bffcff517 staging: octeon-usb: eliminate CVMX_PREFETCH_PREFX
Eliminate CVMX_PREFETCH_PREFX.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen
1e50e9ac31 staging: octeon-usb: eliminate CVMX_PREFETCH_PREF0
Eliminate CVMX_PREFETCH_PREF0.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen
10828735df staging: octeon-usb: delete CVMX_PREFETCH128
Delete unused macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen
5e77a281eb staging: octeon-usb: inline CVMX_PREFETCH0
Inline CVMX_PREFETCH0 macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen
e50aa24e79 staging: octeon-usb: replace CVMX_CLZ with __fls()
Replace CVMX_CLZ macro with __fls().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen
e43de55ce2 staging: octeon-usb: delete redundant flags from cvmx_usb_open_pipe()
Delete redudant flags parameter.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen
951a444c61 staging: octeon-usb: delete redundant flags from __cvmx_usb_submit_transaction()
Delete redundant flags parameter.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen
5dc0316c1b staging: octeon-usb: delete cvmx_usb_isochronous_flags
Delete unused flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen
9be317e69e staging: octeon-usb: delete redundant flags from cvmx_usb_initialize()
The function will always figure out the used clock internally, so delete
a redudant parameter and the flag.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Linus Torvalds
6d15ee4928 Merge git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm NULL deref fix from Gleb Natapov.

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  Fix NULL dereference in gfn_to_hva_prot()
2013-10-03 08:56:41 -07:00
Linus Torvalds
afe05d41e2 Merge branch 'for-curr' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC fix from Vineet Gupta:
 "Chrisitian found/fixed issue with SA_SIGINFO based signal handler
  corrupting the user space registers post after signal handling"

* 'for-curr' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: Fix signal frame management for SA_SIGINFO
2013-10-03 08:55:50 -07:00
Linus Torvalds
c15f5bbc94 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Ben Herrenschmidt:
 "Here are a few powerpc fixes, all aimed at -stable, found in part
  thanks to the ramping up of a major distro testing and in part thanks
  to the LE guys hitting all sort interesting corner cases.

  The most scary are probably the register clobber issues in
  csum_partial_copy_generic(), especially since Anton even had a test
  case for that thing, which didn't manage to hit the bugs :-)

  Another highlight is that memory hotplug should work again with these
  fixes.

  Oh and the vio modalias one is worse than the cset implies as it
  upsets distro installers, so I've been told at least, which is why I'm
  shooting it to stable"

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/tm: Switch out userspace PPR and DSCR sooner
  powerpc/tm: Turn interrupts hard off in tm_reclaim()
  powerpc/perf: Fix handling of FAB events
  powerpc/vio: Fix modalias_show return values
  powerpc/iommu: Use GFP_KERNEL instead of GFP_ATOMIC in iommu_init_table()
  powerpc/sysfs: Disable writing to PURR in guest mode
  powerpc: Restore registers on error exit from csum_partial_copy_generic()
  powerpc: Fix parameter clobber in csum_partial_copy_generic()
  powerpc: Fix memory hotplug with sparse vmemmap
2013-10-03 08:54:39 -07:00
Nicholas Bellinger
db60df88ec target: Fail on non zero scsi_status in compare_and_write_callback
This patch addresses a bug for backends such as IBLOCK that perform
asynchronous completion via transport_complete_cmd(), that will call
target_complete_failure_work() -> transport_generic_request_failure(),
upon exception status and invoke cmd->transport_complete_callback()
-> compare_and_write_callback() incorrectly during the failure case.

It adds a check for a non zero se_cmd->scsi_status within the first
invocation of compare_and_write_callback(), and will jump to out plus
up se_device->caw_sem before exiting the callback.

Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Tested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-10-03 04:24:07 -07:00
Nicholas Bellinger
d8855c154e target: Fix recursive COMPARE_AND_WRITE callback failure
This patch addresses a bug when compare_and_write_callback() invoked from
target_complete_ok_work() hits an failure from __target_execute_cmd() ->
cmd->execute_cmd(), that ends up calling transport_generic_request_failure()
-> compare_and_write_post(), thus causing SCF_COMPARE_AND_WRITE_POST to
incorrectly be set.

The result of this bug is that target_complete_ok_work() no longer hits
the if (!rc && !(cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE_POST) check
that forces an immediate return, and instead double completes the se_cmd
in question, triggering an OOPs in the process.

This patch changes compare_and_write_post() to only set this bit when a
failure has not already occured to ensure the immediate return from within
target_complete_ok_work(), and thus allow transport_generic_request_failure()
to handle the sending of the CHECK_CONDITION exception status.

Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Tested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-10-03 04:24:06 -07:00
Nicholas Bellinger
b7191253b3 target: Reset data_length for COMPARE_AND_WRITE to NoLB * block_size
This patch resets se_cmd->data_length for COMPARE_AND_WRITE emulation
within sbc_compare_and_write() to NoLB * block_size in order to address
a bug with FILEIO backends where a I/O failure will occur when data_length
does not match the I/O size being actually dispatched for the individual
per block READs + WRITEs.

This is done late enough in sbc_compare_and_write() after the memory
allocations have occured in transport_generic_new_cmd() to not cause
any unwanted side-effects.

Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Tested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-10-03 04:24:06 -07:00
Jack Wang
c807f64340 ib_srpt: always set response for task management
The SRP specification requires:

  "Response data shall be provided in any SRP_RSP response that is sent in
   response to an SRP_TSK_MGMT request (see 6.7). The information in the
   RSP_CODE field (see table 24) shall indicate the completion status of
   the task management function."

So fix this to avoid the SRP initiator interprets task management functions
that succeeded as failed.

Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
Cc: stable@vger.kernel.org # 3.3+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-10-03 04:23:17 -07:00