msm: clock: Allow msm_clock_init to be invoked multiple times

In preparation for a series of changes that move MSM clock
controllers to the Linux device model, allow msm_clock_init
to be invoked multiple times (once for each clock controller).

Change-Id: I0d56612c660f020ea762feb468234813cff0db22
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/clock-debug.c
msm: clock: Fix list rate to handle rate > LONG_MAX

While at it, also convert the list_rate return type from int to long to be
consistent with the rest of the ops.

Change-Id: Ib5bc230d82472d17ddcc99956cb6f10ff21df5ff
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
msm: clock-debug: Update fmax_rates to print uV/uA values for each level

Example output after change:
/sys/kernel/debug/clk/a7sspll $ cat fmax_rates
                  reg 0     reg 1
         freq        uV        uV
            0         0         1
   1000000000   1800000         4
 [ 1900000000   1800000         5]
            0   1800000         7

Change-Id: I1563cd8f77d479e0c6c67ee3c93a66fbafb6d6f7
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
msm: clock-debug: Add support to show all the enabled clocks

Add a new debugfs file <debugfs>/clk/enabled_clocks to show all the
currently enabled clock, their rate and their dependency chain.

Example output:
cat /sys/kernel/debug/clk/enabled_clocks
Enabled clocks:
        gcc_lpass_q6_axi_clk:1:1 [0]
        gcc_mss_q6_bimc_axi_clk:1:1 [0]
        gcc_mss_cfg_ahb_clk:1:1 [0]
        gcc_boot_rom_ahb_clk:1:1 [0]
        xo_a_clk:2:2 [19200000]
        gpll0_ao:2:2 [600000000]
        kpss_ahb_clk_src:1:1 [19200000] ->
xo_a_clk:2:2 [19200000]
        bimc_msmbus_a_clk:1:1 [400000000] ->
bimc_a_clk:1:1 [400000000]
        qdss_clk:4:4 [1]
        qdss_clk:4:4 [1]
        qdss_clk:4:4 [1]
        qdss_clk:4:4 [1]
        qdss_clk:4:4 [1]
           ....
Enabled clock count: 42

Change-Id: I6eda59c7e61b77518676e3aa93895ccb792176ac
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/clock-debug.c
mdss: skip calls to removed debug print functions
workqueue: Added null check and warning

If work item is already in queue get_work_cwq() will return null.
so null check is added to avoid crash in delayed_work_timer_on()

CRs-Fixed: 586162

Change-Id: I5c885142fd72781cea90d6c9b3456ecc7f0778b6
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
cpufreq: ondemand: fix timer-related list corruption in store_powersave_bias()

The dbs_timer_init() call in store_powersave_bias() re-initializes the
dbs_info workqueue, call on dbs_timer_exit() to ensure
outstanding work is cleared prior to making this call. Also, grab the
percpu timer_mutex lock to avoid race conditions with respect to the
dbs timer.

Change-Id: I79f3d43eeb51d2d8e21edd0fe043d6583333951f
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
mmc: block: flush request requeue after timeout.

On some eMMC cards cache flush is taking longer than 30 sec timeout
after HPI issued and -EIO reported to the upper layers. This may result
into journaling issues as flush calls are issued by the file system
joulrnaling code.

This change increases flash cache timeout to 90 sec, in case of timeout
occurs, after HPI issued, flash request re-queued to the block layer queue
to execute it later and keep journaling logic valid.

Conflicts:
	drivers/mmc/card/block.c

Change-Id: I1e968c07056062fd9c8e14e5bc3e62b3b4b99c64
Signed-off-by: Panwar Vivek <vpanwa@codeaurora.org>

Conflicts:

	drivers/mmc/card/block.c

Signed-off-by: Maya Erez <merez@codeaurora.org>

Conflicts:

	drivers/mmc/card/block.c
mmc: core: increase timeout for disable cache operation

According to eMMC specification, there is no upper bound defined on
a flush request and the duration of flush operation is left to card
vendor's implementation. This means that it may take a very long
time to complete.

When eMMC cache is disabled, the card has to flush all the data in its
cache. So this means that for certain cards, the driver is not waiting
long enough for the flush to complete during cache disable operation,
leading to data on the card being corrupted.

This change increases the timeout for cache disable operation, thus
preventing data corruption.

CRs-Fixed: 562350
Change-Id: If68328ab56b50c7596800f07ef92c0ab16a55ec0
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: David Ng <dave@codeaurora.org>
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
net: wireless: switch to standard directory
bcmdhd: prevent leak (per 94d1b436)
net: wireless: bcmdhd: fix for negative padding

Signed-off-by: Iliyan Malchev <malchev@google.com>
net: wireless: bcmdhd: Fix country checking

Bug: 11319610

Change-Id: I5c52ed594614d8039f167de3c98bd9f802b521df
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: fixed power consumption issue of P2P.

	solution : add wake_lock not to go to suspend during removing P2P GO
	interface in wl_cfg80211.c.
	Description of this issue :
	if device goes to suspend during removing the interface,
	we will fail to remove P2P GO virtual
	interface(p2p-p2p0-0).
	This will causes P2P GO still alive in firmware
	Bugnizer case id : 10874302
	This issue is reported by LG team.
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Conflicts:

	drivers/net/wireless/bcmdhd/dhd.h
net: wireless: bcmdhd: Fixed a problem of buganizer issue (11190960)

	Problem : if PNO scan occurs in Driver after p2p scan,
		  we failed to do PNO scan
	Root cause : In the wl_run_escan function, we still goes into
	p2p scan code even though current scan is PNO which is kind of
	legacy scan.

	Solution : we need to clear the staus of P2P scan before doing
	PNO SCAN.

Signed-off-by: Ecco Park <eccopark@broadcom.com>
net: wireless: bcmdhd: reduced the wakelock time of RX packet

	Reduce time : 1secs -> 500ms
	Problem : [Issue 11512235] 34% battery eaten overnight
		  [Issue 11374623] OS + Wifi used 41% of battery,
		  wlan_rx_wake
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Conflicts:

	drivers/net/wireless/bcmdhd/Makefile
	drivers/net/wireless/bcmdhd/dhd.h
net: wireless: bcmdhd: Change DTIM skip policy in suspend

	issue : WiFi continuously disconnects
	Root cause :
	Sometimes we got link down event due to beacon
	lost when device goes to suspend.
	This problem sometimes happens in case that DTIM is 3 and beacon
	100ms because we wake up on 900ms (100ms * 3 * 3) during
	suspend.
	This value(900ms) is too big to STA for sync up with AP time.
	This causes STA out of sync for time with the AP.
	Eventually STA got lost of beacon during long time (4secs).

	Solution :
	If the total dtim skip interval (beacon_interval *
	DTIM * 3) is greater than 300ms, we will not extend DTIM to DTIM
	* 3.
	Instead of that, we will use original value (DTIM) for wake up
	in suspend.
	Bug : 1343127 WiFi continuously disconnects

Signed-off-by: Ecco Park <eccopark@broadcom.com>

Change-Id: I6d89bd1c56127befe4d9606869396ee25b7911ef

Conflicts:

	drivers/net/wireless/bcmdhd/dhd.h
net: wireless: bcmdhd: Set MAX_DTIM_ALLOWED_INTERVAL to 600

Change-Id: Ie4d9cac1e0828651a142d64762b251537431ea99
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Enable IPv6 RA filter feature

1) We will block IPv6 Router Advertisement multicast packet in suspend mode to save power on device.

Bug: 11638281
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Conflicts:

	drivers/net/wireless/bcmdhd/dhd_linux.c
net: wireless: bcmdhd: enable TDLS_auto_mode

	Requirement :
	1. enable auto mode for SETUP request
	2. disable auto mode for TEARDOWN request
	bug : 11632025 TDLS hybrid mode support

Change-Id: Idc0cb60e65a45bb32b8beb2bb3daf72c9112eab6
Signed-off-by: Ecco Park <eccopark@broadcom.com>

Conflicts:

	drivers/net/wireless/bcmdhd/dhd_linux.c
	drivers/net/wireless/bcmdhd/wl_cfg80211.c