[SCSI] be2iscsi: Fix returning Failure when MBX fails with Insufficient buffer error

When MBX command fails with insufficent buffer, check for the
response lenght returned. Return success if response length
is non-zero value which indicates valid data.

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix MBX Command issues

- Check Ready Bit before posting the BMBX Hi Address
- Fix the parameters passed to beiscsi_mccq_compl
  in beiscsi_open_conn()
- Fix tag value check in beiscsi_ep_connect.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix MSIX support in SKH-R to 32

This patch limits the max number of msix vectors to 32.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix freeing CXN specific driver resources.

Free CXN specific resource held by driver when login redirection
or connection retry happens. Login redirection was failing
because WRB/SGL were not allocated from the CID on which
doorbell was rung.

Fixed the issue raised by MikeC

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix MACRO for checking the adapter type

Fixed the code flow based on the MACRO defined to check for
adapter.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix support for DEFQ extension

Fix support for DEFQ extension which will be used by latest
adapters

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix displaying the FW Version from driver.

The mgmt_hba_attributes structure declared was not proper and
because of that the FW response returned for the MBX_CMD was not
matching. This issue went unnoticed as mgmt_hba_attribs structure
members were never used in the code path.

This fix of displaying the FW version had to change the mgmt_hba_attrib
structure also. The latest driver will also work with the older FW as
the issue was in the driver declaration.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
s390/zcrypt: ap bus rescan problem when toggle crypto adapters on/off

The bus rescan process was called simultaneously on
every device failure. This finally leads into race
conditions (double device add/remove actions).

This patch protects the rescan area by mutual exclusion
and improves ap_config_timer handling

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
[SCSI] be2iscsi: Fix displaying the Active Session Count from driver

This patch fixes the displaying of number of active
sessions in use.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix the Port Link Status issue

Check the Logical Link status also as part of the port link status.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi : Fix the NOP-In handling code path

When target send a NOP-IN with valid TTT, driver issues a NOP-OUT
and the task was not freed from driver. The task list available for
the session used to run out, and as no more task list were available
no more iSCSI commands were exchanged on that session.
This patches fixed the issue, by calling iscsi_put_task.

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix dynamic CID allocation Mechanism in driver

Number of CID assigned to a function from adapter can be dynamic. The CID count
for each function was fixed number before. Code Fix done so that adapters with
fixed/dynamic CID count will work with the driver.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix checking Adapter state while establishing CXN

Before tyring to establish a CXN with the target, check if the adapter is in
a stable state

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2scsi: Update copyright dates to 2013

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix possible reentrancy issue in be_iopoll

The driver creates "NAPI" context per core which is fine,
however the above routine declares the ret variable as static!
Thus there is only one instance of this variable!
When this routine is called from more than one thread of execution,
than the result is unpredictable.

         static unsigned int ret;
         .....

         ret = beiscsi_process_cq(pbe_eq);
                 <--------Another thread can enter here and change "ret".
         if (ret < budget) {
                ....
         }
                 <--------Another thread can enter here and change "ret".
         return ret;

Fix - remove the "static"

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
dmaengine: sirf: move driver init from module_init to subsys_initcall

if we initilize dma driver by module_init, there are still many devices
which will be initilized earlier than dma. these devices will fail to
get dma channel.
this moves dmaengine earlier than device_initcall and make dma available
for all devices.

Reported-by: Renwei Wu <Renwei.Wu@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
[SCSI] be2iscsi: Fix issue in passing the exp_cmdsn and max_cmdsn

Command Window value from the CQE was used to calculate the
max_cmdsn for that session.The command window value extracted
for SKH-R adapter was not proper. The value was extracted from
BE adapter completion event. Fixed the issue by getting the
cmd_wnd value from SKH-R CQE.

The exp_cmdsn and max_cmdsn values were not converted to BE format
before calling the __iscsi_complete_pdu(). Fixed the issue of converting
to BE format.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Bump the driver version to 10.0.467.0

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drm/radeon: fix handling of v6 power tables

The code was mis-handling variable sized arrays.

Reported-by: Sylvain BERTRAND <sylware@legeek.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Merge commit '8700c95adb03' into timers/nohz

The full dynticks tree needs the latest RCU and sched
upstream updates in order to fix some dependencies.

Merge a common upstream merge point that has these
updates.

Conflicts:
	include/linux/perf_event.h
	kernel/rcutree.h
	kernel/rcutree_plugin.h

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>