SCSI: scsi_remove_target: fix softlockup regression on hot remove

commit bc3f02a795d3b4faa99d37390174be2a75d091bd upstream.

John reports:
 BUG: soft lockup - CPU#2 stuck for 23s! [kworker/u:8:2202]
 [..]
 Call Trace:
  [<ffffffff8141782a>] scsi_remove_target+0xda/0x1f0
  [<ffffffff81421de5>] sas_rphy_remove+0x55/0x60
  [<ffffffff81421e01>] sas_rphy_delete+0x11/0x20
  [<ffffffff81421e35>] sas_port_delete+0x25/0x160
  [<ffffffff814549a3>] mptsas_del_end_device+0x183/0x270

...introduced by commit 3b661a9 "[SCSI] fix hot unplug vs async scan race".

Don't restart lookup of more stargets in the multi-target case, just
arrange to traverse the list once, on the assumption that new targets
are always added at the end.  There is no guarantee that the target will
change state in scsi_target_reap() so we can end up spinning if we
restart.

Acked-by: Jack Wang <jack_wang@usish.com>
LKML-Reference: <CAEhu1-6wq1YsNiscGMwP4ud0Q+MrViRzv=kcWCQSBNc8c68N5Q@mail.gmail.com>
Reported-by: John Drescher <drescherjm@gmail.com>
Tested-by: John Drescher <drescherjm@gmail.com>
Signed-off-by: Dan Williams <djbw@fb.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
SCSI: scsi_dh_alua: Enable STPG for unavailable ports

commit e47f8976d8e573928824a06748f7bc82c58d747f upstream.

A quote from SPC-4: "While in the unavailable primary target port
asymmetric access state, the device server shall support those of
the following commands that it supports while in the active/optimized
state: [ ... ] d) SET TARGET PORT GROUPS; [ ... ]". Hence enable
sending STPG to a target port group that is in the unavailable state.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 3.0.45
board-msm7x30: bt: Cleanup not proper when BT chip not detected

As apart of BT power on even if bluetooth chip is not detected,
bluetooth power on sequence is going ahead which is causing a
kernel panic.

Signed-off-by: Ram Mohan Korukonda <rkorukon@codeaurora.org>
(cherry picked from commit 1747cde74a9eaebd3a8794311e0404f60523989a)

Change-Id: I8425f6703595b652358f0399bbec8d8a39c1966d
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
Merge "board-msm7x30: bt: Cleanup not proper when BT chip not detected"
msm: audio: qdsp5v2: Switch audio drivers to ION.

PMEM is deprecated, Move drivers to ION.

Change-Id: Ie4c1f676d151f26f983d1ed64038ecd0465e1b52
Signed-off-by: Sidipotu Ashok <sashok@codeaurora.org>
Merge "msm: audio: qdsp5v2: Switch audio drivers to ION."
msm_fb: display: Add support vsync driven composition for 7x30

This patch will queue multiple surfaces and commit those
surfaces into mdp at same instance so that surfaces will
be blended and displayed at same time for 7x30. Hardware vsync event
is delivered to the user space frame work via uevent. Both
queue and commit are controlled by frame work and synchonized
with vsync event. Therefore frame rate will match with vsync rate.

Change-Id: I59d672d12f69bd964eb59c78ba0b86ddec57fe74
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
defconfig: hercules: Enable more debugging options

Change-Id: Ic1828a621262b2836cf303627c7b1645493231d8
Merge "msm_fb: display: Add support vsync driven composition for 7x30"
Add T769 and I577 support

These patches add (mostly) working support for the Samsung SGH-T769 (TMOUS
Blaze 4G) and SGH-I577 (AT&T Exhilarate) to the JellyBean branch of the
msm8660-common kernel. They are largely just ifdefs, in many cases added onto
the T989 (hercules) definitions. There are a few hardware specific ifdefs to
define platform specific values. There are also two files that I took
completely from the T769 and I577 sources for drivers that only exist on
those two platforms within cyanogenmod (therefore I assumed they were the
right ones).

This patch set does NOT fix the cypress-touchkey.c driver. I'm still working
on that.

arch/arm/configs/cyanogenmod_*_defconfig
 * Added device configurations for T769 and I577

arch/arm/mach-msm/qdsp6v2/board-msm8x60-audio-APEX40.c
arch/arm/mach-msm/qdsp6v2/timpani_profile_apex40_tmo.h
 * Added these T769 specific files from the T769 ICS Kernel Sources (3.0.8)

arch/arm/mach-msm/qdsp6v2/q6voice.c
 * Added T769/I577 ifdef's
 * Initialize dev_rx_info within functions where CONFIG_VPCM_INTERFACE_ON_CSFB
   is set, but nothing is done in the big ugly ifdef (see line 1705 for
   example), for I577

drivers/i2c/chips/taos.c
drivers/media/video/msm/sec_isx012*
 * These drivers are only used by T769/I577, use their versions from their
   sources

drivers/video/msm/lcdc_ld9040.c
 * includes were borked...

Everything else... (based on ICS sources from both devices)
 * Added T769 and I577 to existing ifdefs where it made sense
 * Created some ifdefs for device specific hardware values
 * Added cases to exclude I577 in a few cases

Change-Id: I62245d4371e51c4d8ec63d63daf92b85abed5373
msm: audio: qdsp6v2: Fix the issue of memory unmap

- Target freeze observed during monkey run.
- Memory unmap getting called from interrupt context,
  which is causing scheduling during atomic operation.
- Avoid calling memory unmap from interrupt context.

CRs-fixed: 390582
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
(cherry picked from commit a64fae9ba272ba2f689f30bc7b33c8a1fe4445e5)

Change-Id: Ibfd73d97c2ea8734385ba5eeb8a009cb55ec7e49
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>
msm8x55_defconfig: Enable TUN driver support

Enable TUN driver support required in Android VPN service

CRs-Fixed: 388834

Change-Id: Id587b78d87602648b5b6aa9873bc7e1b83f41980
Signed-off-by: Anup Dasari <adasari@codeaurora.org>
Merge "msm8x55_defconfig: Enable TUN driver support"
Merge "msm: audio: qdsp6v2: Fix the issue of memory unmap"
defconfig: msm7630_surf: Set 500 mA as gadget vbus draw

Allow the USB gadget to draw 500 mA current from connected
Windows Host rather than 2 mA.

Change-Id: Ibb32052b535fbccc51eddd94417764607cd7c544
CRs-Fixed: 409166
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Temporary cypress-touchkey support for T769.

This is an older version of the driver, and should be reverted once
support is properly integrated into the main cypress-touchkey driver.

Change-Id: I9509ca7b770efa80826245322e3a7cf3ed5ddb27
msm: qdsp5v2: Fix for noise issue during VOIP call

Driver discards the downlink packets when input queue is full.
Added code to block processing of downlink packets in the write()
till a input queue free slot is available for write.

(Taken from ICS Change-Id: I1198d9d9a98f27d3bd74a7e2fef647373e6d56cf)

Change-Id: Iffa54c378725147d0a9716e902d35ce9ce3f9dae
Signed-off-by: Shashi Kumar <sulege@codeaurora.org>
mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it

commit 9957423f035c2071f6d1c5d2f095cdafbeb25ad7 upstream.

It seems the current (gcc 4.6.3) no longer provides this so make it
conditional.

As reported by Tony before, the mn10300 architecture cross-compiles with
gcc-4.6.3 if -mmem-funcs is not added to KBUILD_CFLAGS.

Reported-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kbuild: make: fix if_changed when command contains backslashes

commit c353acba28fb3fa1fd05fd6b85a9fc7938330f9c upstream.

The call if_changed mechanism does not work when the command contains
backslashes.  This basically is an issue with lzo and bzip2 compressed
kernels.  The compressed binaries do not contain the uncompressed image
size, so these use size_append to append the size.  This results in
backslashes in the executed command.  With this if_changed always
detects a change in the command and rebuilds the compressed image even
if nothing has changed.

Fix this by escaping backslashes in make-cmd

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Bernhard Walle <bernhard@bwalle.de>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>