defconfig: express: Update defconfig

Change-Id: I41bdce629faa3151c0abb8010526dcac75c64f1a
defconfig: melius: Update defconfig

Change-Id: Ied3871b3dca7d50b3fb9be60d7774362376819b1
ARM: 7493/1: use generic unaligned.h

This moves ARM over to the asm-generic/unaligned.h header. This has the
benefit of better code generated especially for ARMv7 on gcc 4.7+
compilers.

As Arnd Bergmann, points out: The asm-generic version uses the "struct"
version for native-endian unaligned access and the "byteshift" version
for the opposite endianess. The current ARM version however uses the
"byteshift" implementation for both.

Thanks to Nicolas Pitre for the excellent analysis:

Test case:

int foo (int *x) { return get_unaligned(x); }
long long bar (long long *x) { return get_unaligned(x); }

With the current ARM version:

foo:
	ldrb	r3, [r0, #2]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 2B], MEM[(const u8 *)x_1(D) + 2B]
	ldrb	r1, [r0, #1]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 1B], MEM[(const u8 *)x_1(D) + 1B]
	ldrb	r2, [r0, #0]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D)], MEM[(const u8 *)x_1(D)]
	mov	r3, r3, asl #16	@ tmp154, MEM[(const u8 *)x_1(D) + 2B],
	ldrb	r0, [r0, #3]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 3B], MEM[(const u8 *)x_1(D) + 3B]
	orr	r3, r3, r1, asl #8	@, tmp155, tmp154, MEM[(const u8 *)x_1(D) + 1B],
	orr	r3, r3, r2	@ tmp157, tmp155, MEM[(const u8 *)x_1(D)]
	orr	r0, r3, r0, asl #24	@,, tmp157, MEM[(const u8 *)x_1(D) + 3B],
	bx	lr	@

bar:
	stmfd	sp!, {r4, r5, r6, r7}	@,
	mov	r2, #0	@ tmp184,
	ldrb	r5, [r0, #6]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 6B], MEM[(const u8 *)x_1(D) + 6B]
	ldrb	r4, [r0, #5]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 5B], MEM[(const u8 *)x_1(D) + 5B]
	ldrb	ip, [r0, #2]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 2B], MEM[(const u8 *)x_1(D) + 2B]
	ldrb	r1, [r0, #4]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 4B], MEM[(const u8 *)x_1(D) + 4B]
	mov	r5, r5, asl #16	@ tmp175, MEM[(const u8 *)x_1(D) + 6B],
	ldrb	r7, [r0, #1]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 1B], MEM[(const u8 *)x_1(D) + 1B]
	orr	r5, r5, r4, asl #8	@, tmp176, tmp175, MEM[(const u8 *)x_1(D) + 5B],
	ldrb	r6, [r0, #7]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 7B], MEM[(const u8 *)x_1(D) + 7B]
	orr	r5, r5, r1	@ tmp178, tmp176, MEM[(const u8 *)x_1(D) + 4B]
	ldrb	r4, [r0, #0]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D)], MEM[(const u8 *)x_1(D)]
	mov	ip, ip, asl #16	@ tmp188, MEM[(const u8 *)x_1(D) + 2B],
	ldrb	r1, [r0, #3]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 3B], MEM[(const u8 *)x_1(D) + 3B]
	orr	ip, ip, r7, asl #8	@, tmp189, tmp188, MEM[(const u8 *)x_1(D) + 1B],
	orr	r3, r5, r6, asl #24	@,, tmp178, MEM[(const u8 *)x_1(D) + 7B],
	orr	ip, ip, r4	@ tmp191, tmp189, MEM[(const u8 *)x_1(D)]
	orr	ip, ip, r1, asl #24	@, tmp194, tmp191, MEM[(const u8 *)x_1(D) + 3B],
	mov	r1, r3	@,
	orr	r0, r2, ip	@ tmp171, tmp184, tmp194
	ldmfd	sp!, {r4, r5, r6, r7}
	bx	lr

In both cases the code is slightly suboptimal.  One may wonder why
wasting r2 with the constant 0 in the second case for example.  And all
the mov's could be folded in subsequent orr's, etc.

Now with the asm-generic version:

foo:
	ldr	r0, [r0, #0]	@ unaligned	@,* x
	bx	lr	@

bar:
	mov	r3, r0	@ x, x
	ldr	r0, [r0, #0]	@ unaligned	@,* x
	ldr	r1, [r3, #4]	@ unaligned	@,
	bx	lr	@

This is way better of course, but only because this was compiled for
ARMv7. In this case the compiler knows that the hardware can do
unaligned word access.  This isn't that obvious for foo(), but if we
remove the get_unaligned() from bar as follows:

long long bar (long long *x) {return *x; }

then the resulting code is:

bar:
	ldmia	r0, {r0, r1}	@ x,,
	bx	lr	@

So this proves that the presumed aligned vs unaligned cases does have
influence on the instructions the compiler may use and that the above
unaligned code results are not just an accident.

Still... this isn't fully conclusive without at least looking at the
resulting assembly fron a pre ARMv6 compilation.  Let's see with an
ARMv5 target:

foo:
	ldrb	r3, [r0, #0]	@ zero_extendqisi2	@ tmp139,* x
	ldrb	r1, [r0, #1]	@ zero_extendqisi2	@ tmp140,
	ldrb	r2, [r0, #2]	@ zero_extendqisi2	@ tmp143,
	ldrb	r0, [r0, #3]	@ zero_extendqisi2	@ tmp146,
	orr	r3, r3, r1, asl #8	@, tmp142, tmp139, tmp140,
	orr	r3, r3, r2, asl #16	@, tmp145, tmp142, tmp143,
	orr	r0, r3, r0, asl #24	@,, tmp145, tmp146,
	bx	lr	@

bar:
	stmfd	sp!, {r4, r5, r6, r7}	@,
	ldrb	r2, [r0, #0]	@ zero_extendqisi2	@ tmp139,* x
	ldrb	r7, [r0, #1]	@ zero_extendqisi2	@ tmp140,
	ldrb	r3, [r0, #4]	@ zero_extendqisi2	@ tmp149,
	ldrb	r6, [r0, #5]	@ zero_extendqisi2	@ tmp150,
	ldrb	r5, [r0, #2]	@ zero_extendqisi2	@ tmp143,
	ldrb	r4, [r0, #6]	@ zero_extendqisi2	@ tmp153,
	ldrb	r1, [r0, #7]	@ zero_extendqisi2	@ tmp156,
	ldrb	ip, [r0, #3]	@ zero_extendqisi2	@ tmp146,
	orr	r2, r2, r7, asl #8	@, tmp142, tmp139, tmp140,
	orr	r3, r3, r6, asl #8	@, tmp152, tmp149, tmp150,
	orr	r2, r2, r5, asl #16	@, tmp145, tmp142, tmp143,
	orr	r3, r3, r4, asl #16	@, tmp155, tmp152, tmp153,
	orr	r0, r2, ip, asl #24	@,, tmp145, tmp146,
	orr	r1, r3, r1, asl #24	@,, tmp155, tmp156,
	ldmfd	sp!, {r4, r5, r6, r7}
	bx	lr

Compared to the initial results, this is really nicely optimized and I
couldn't do much better if I were to hand code it myself.

Change-Id: I91ea5a5e83de4bbdbb53883fe0dbf00719a8e382
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
power: Avoids bogus error messages for the suspend aborts.

Avoids printing bogus error message "tasks refusing to freeze", in cases
where pending wakeup source caused the suspend abort.

Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Change-Id: I913ad290f501b31cd536d039834c8d24c6f16928
msm: wlan: Squashed update of wifi regulatory database

msm: wlan: update db.txt for Taiwan

After pulling in regulatory information for Taiwan
from the compliance team the data for Taiwan was
inconsistent as it allowed 80MHz bandwidth for
frequency range which was less than 80MHz which was
resulting in failure to parse the regulatory rules
for Taiwan.

Change-Id: Ibfabf26c1481b37d163b755734491ba27b1a4195
CRs-Fixed: 582871
Signed-off-by: Mihir Shete <smihir@codeaurora.org>

msm: wlan: update db.txt

Update the db.txt with new information from regulatory compliance team.
This considers changes posted as on Nov 15th, 2013: Various country updates
and corrections

CRs-Fixed: 579446
Change-Id: Ief60fc89c7d7ef67744bf20ced9eb5e6ed060ea9
Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>
Signed-off-by: Arif Hussain <arifhussain@codeaurora.org>

msm: wlan: update db.txt

Update the db.txt with support for channel 144 for US country code

CRs-Fixed: 599829
Change-Id: Ief1b534be297eb05bd28b0c93a8cc2df11a6722b
Signed-off-by: Tushnim Bhattacharyya <tushnimb@codeaurora.org>

msm: wlan: update db.txt

Update db.txt by removing AD & BL from the list as recomened by
QCA regulatory compliance team

CRs-Fixed: 608532
Change-Id: I7b32feb32235e84e94100ee3a0986de1faaef88f
Signed-off-by: Tushnim Bhattacharyya <tushnimb@codeaurora.org>

msm: wlan: db.txt: add channel144 entry for supporting
countries

Ch 144 can be enabled in many countries. Enable it all countries that
are mapped to FCC3, FCC6 and APL7 (5GHz) RDs.

Change-Id: I1e11883a8085a900684eadd8f7a6f8f442cae3fb
CRs-Fixed: 614319
Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>

msm: wlan: db.txt: enable mid 5GHz channels of WORLD reg domain

Patch enables the mid 5GHz channels for passive scanning on
WORLD regulatory domain.

Change-Id: I0e5b2a04afaa39b94a05e072ec1979e7d9ca0d14
CRs-Fixed: 614247
Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>

msm: wlan: db.txt: Set min of Tx power of AP/STA mode

Update US reg domain to pick the min of Tx power limit for db.txt
in case the entries are different for STA and SAP. So picking
23(AP) over 24(STA).

Change-Id: Id3be427e69b6e20a6a84f4f8291e4dbf53dea045
CRs-Fixed: 630538
Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>

msm: wlan: update db.txt with new compliance information

Update the db.txt with new compliance information.

Change-Id: I9aacf72dba51b746546777808e5abbe808e98746
CRs-Fixed: 625165
Signed-off-by: Santhosh Kumar Padma <skpadma@codeaurora.org>

wlan: Correct db.txt for a set of countries.

Correct the channel list and tx power values for countries
with alpha2 IL, MX, ZA and TW.

Change-Id: I735a153ef1e87c1022f175ac360d675071d1ec2a
CRs-Fixed: 640859
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

cfg80211: change regulatory rules for Indonesia

Change regulatory rules for Indonesia as per the
directive from regulatory compliance team.

Change-Id: If25a3100a94492191b322310406ae9047bd6f4a2
CRs-Fixed: 637303
Signed-off-by: Mihir Shete <smihir@codeaurora.org>

msm: wlan: update db.txt

Update db.txt to correct below:
1) CC=AU, AR, CA, SAP should not be operational in channels 120/124/128
2) Set 23dBm as the Tx power for FCC6 regulatory domains.
3) SAP Regulatory - Saudi Arabia country code should map to ETSI1,
upper 5 GHz channels 149 to 165 are not supported
4) Remove entry for KP. Update KR to map to APL9_WORLD
5) for JP, make it compliant to MKK5_MKKA2

Change-Id: Ib17685afa42a0892ff0576f64e68b6725df14b2f
CRs-Fixed: 639177
Signed-off-by: Manjunathappa Prakash <prakashpm@codeaurora.org>

msm: wlan: update db.txt for SA

Update regulatory database for country Saudi Arabia. Correct the
tx-power for a set of 5 GHz channels

Change-Id: I793d9acdb04d003212876df0fc439927d8d870ca
CRs-Fixed: 656369
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

net: wlan: correct db.txt for KR

Correct the regulatory database entry for KR.

Change-Id: I6186d483a8d66369abb7a2970b94cdcc84fa8468
CRs-Fixed: 663320
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: update db.txt

FCC3 & FCC6 RDs increase UNII-1 Tx Powers  per 2014-5-31 R&O
Change FCC6 to match FCC3 Power

Change-Id: I88da603d1bb4a967d3289c29df1a2f35e4dc0cf3
CRs-Fixed: 661799
Signed-off-by: Tushnim Bhattacharyya <tushnimb@codeaurora.org>

msm: wlan: update db.txt

Add Chad = ETSI1_World
Add Guyana = APL1_ETSIC
Add Cte d'Ivoire = FCC3_World

Change-Id: I5958f71d31aff370efa65fe80653349b3f02c281
CRs-Fixed: 661799
Signed-off-by: Tushnim Bhattacharyya <tushnimb@codeaurora.org>

msm: wlan: update db.txt

Change Egypt HT/VHT40 Flag = Y
Change Haiti =  FCC3_FCCA
Change S. Africa = FCC3_World
Change Tunisia VHT80 & HT/VHT40 Flags = Y
Change Venezuela = FCC2_ETSIC and CTL group = FCC
Change Indonesia = APL2_ETSIC and CTL group = FCC
Change APL2 RD to increase Tx Power = 30dBm (for Indonesia)

Change-Id: I89c28881edd9e454be562ea059d499b494eb21d0
CRs-Fixed: 661799
Signed-off-by: Tushnim Bhattacharyya <tushnimb@codeaurora.org>

msm: wlan: correct db.txt for TW

Enable channel 165 for TW

Change-Id: I4e6a2c3d6506d1cb14f2f756f1310410f6f7d790
CRs-Fixed: 691872
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: correct db.txt for country code RU

Current usable band is 5725-5825. But for
channel 165 (freq 5825), when desired
bandwidth is 20MHz, the band fit in check
fails. This fix updates the start and end
frequency of this country based on the valid
channel list.

Change-Id: I8e09bb32676f94023a14c4b3a5c26dd3ae495af7
CRs-Fixed: 699088
Signed-off-by: Manishekar Chandrasekaran <cmshekar@codeaurora.org>

msm: wlan: Update US wifi database for TDWR channels

Update the US regulatory database for TDWR channels.
Also update the tx power of US DFS channels.

CRs-Fixed: 725496
Change-Id: Iceb30a61579dad0ea9325853b5aabc9ab23caa62
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: Update/Add countries to wifi database  db.txt.

Add countries AF, BT, BF, CF, CX, GH, MV, MR, FM, ME, PW, SN,
TZ, TG and VU to the wifi database. Correct entries for AS, BM,
BS, LB, MP, MN, MU, NI, PG and PY that conform to 5G domain FCC3.
Also correct entries for CZ, DE, ES, GF, GP, MC, MQ, MW, OM, PF
that conform to 5G domain ETSI1.

CRs-Fixed: 725522
Change-Id: I382de6927f6e52a350c2b69ab238941450daa7b9
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: Add a set of countries to wifi database db.txt.

Add countries DM, MD, KN, LC, TC, LS, BL, AI, MF, PM, VC
and WF. to wifi database db.txt. Also correct the entry for
KR.

Change-Id: Ia48ae98733edca1314be692dd77c9cc9b7ca4935
CRs-Fixed: 725522
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: Update db.txt for 2 countries

Update db.txt for Bolivia and Marshall Islands. Also update
tx power for FCCA countries. Also correct the entry for JP
to not use 160 MHz.

CRs-Fixed: 725522
Change-Id: I9c1bdddfa13f84239b94ac2329f5fdf0bbf64972
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: Correct wifi database for a set of countries.

Correct wifi database for AE, AL, AR, AT, AU, AW, BD, BG, BN,
BR, CA, CF, CI, CO, CR and CX.

Change-Id: I76d739ce6501c06772f64e484f5e4dd30b00a2ba
CRs-Fixed: 725522
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>

msm: wlan: Correct db.txt entries

Update db.txt for countries PR, PW, RE, RS, RU, RW, SA,
SN, SR, TW, TD, TH, TT, UA, UG, PS, UY, UZ, VE, VN, VI,
VU, WS, YT, ZW

Change-Id: If92fcc4b27f944cd4b1338df1199c38340607d5f
CRs-Fixed: 725522
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
cpufreq: Persist cpufreq time in state data across hotplug

Cpufreq time_in_state data for all CPUs is made persistent across
hotplug and exposed to userspace via sysfs file
/sys/devices/system/cpu/cpufreq/all_time_in_state

Change-Id: I97cb5de24b6de16189bf8b5df9592d0a6e6ddf32
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
cpufreq: fix sleeping in atomic context when realloc freq_table for all_time_in_state

Commit 40cf2f8 (cpufreq: Persist cpufreq time in state data across hotplug)
causes the following call trace to be spit on boot:

BUG: sleeping function called from invalid context at mm/slub.c:936
in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
CPU: 6 PID: 1 Comm: swapper/0 Not tainted 3.10.9-20140624.172707-eng-gd6c0f69-dirty #50
Backtrace:
[<c0012270>] (dump_backtrace+0x0/0x10c) from [<c001256c>] (show_stack+0x18/0x1c)
 r6:ffff1788 r5:c0c020c0 r4:e609c000 r3:00000000
[<c0012554>] (show_stack+0x0/0x1c) from [<c07a2970>] (dump_stack+0x20/0x28)
[<c07a2950>] (dump_stack+0x0/0x28) from [<c0057678>] (__might_sleep+0x104/0x120)
[<c0057574>] (__might_sleep+0x0/0x120) from [<c00ff000>] (__kmalloc_track_caller+0x144/0x274)
 r6:00000000 r5:e609c000 r4:e6802140
[<c00feebc>] (__kmalloc_track_caller+0x0/0x274) from [<c00da098>] (krealloc+0x58/0xb0)
[<c00da040>] (krealloc+0x0/0xb0) from [<c050266c>] (cpufreq_allstats_create+0x120/0x204)
 r8:e4c4ff00 r7:c0d266b8 r6:0013d620 r5:e4c4e600 r4:00000001
r3:e535d6d0
[<c050254c>] (cpufreq_allstats_create+0x0/0x204) from [<c0502e38>] (cpufreq_stat_notifier_policy+0xb8/0xd0)
[<c0502d80>] (cpufreq_stat_notifier_policy+0x0/0xd0) from [<c00517cc>] (notifier_call_chain+0x4c/0x8c)
 r5:00000000 r4:fffffffe
[<c0051780>] (notifier_call_chain+0x0/0x8c) from [<c00519fc>] (__blocking_notifier_call_chain+0x50/0x68)
 r8:c0cd4d00 r7:00000002 r6:e609dd7c r5:ffffffff r4:c0d25a4c
r3:ffffffff
[<c00519ac>] (__blocking_notifier_call_chain+0x0/0x68) from [<c0051a34>] (blocking_notifier_call_chain+0x20/0x28)
 r7:c0e24f30 r6:00000000 r5:e53e1e00 r4:e609dd7c
[<c0051a14>] (blocking_notifier_call_chain+0x0/0x28) from [<c0500fec>] (__cpufreq_set_policy+0xc0/0x1d0)
[<c0500f2c>] (__cpufreq_set_policy+0x0/0x1d0) from [<c0501308>] (cpufreq_add_dev_interface+0x20c/0x270)
 r7:00000008 r6:00000000 r5:e53e1e00 r4:e53e1e58
[<c05010fc>] (cpufreq_add_dev_interface+0x0/0x270) from [<c05016a8>] (cpufreq_add_dev+0x33c/0x420)
[<c050136c>] (cpufreq_add_dev+0x0/0x420) from [<c03604a4>] (subsys_interface_register+0x80/0xbc)
[<c0360424>] (subsys_interface_register+0x0/0xbc) from [<c050035c>] (cpufreq_register_driver+0x8c/0x194)

Change-Id: If77a656d0ea60a8fc4083283d104509fa6c07f8f
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
cpufreq: prevents NULL pointer reference while all_time_in_state stats is
collected.

Platform cpufreq driver may not be initiated at the time
cpufreq_stats_init() and therefore allocation of all_cpufreq_stats is
moved.
Also makes sure that all_cpufreq_stats is created appropriately for the
devices which doesn't support hotplugging of CPUs.

Change-Id: Iaf033688cf0e6cfdb3d605edbcbb984946f8ed45
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
wlan: prima: Sync with kk_2.7

Change-Id: I346564446d81a9515d5a5d047598b96d0a89ca95
defconfig: Enable CONFIG_NETFILTER_XT_TARGET_IDLETIMER