crypto: arc4 - improve performance by adding ecb(arc4)

Currently arc4.c provides simple one-byte blocksize cipher which is wrapped
by ecb() module, giving function call overhead on every encrypted byte. This
patch adds ecb(arc4) directly into arc4.c for higher performance.

tcrypt results (speed ratios: new/old):

AMD Phenom II, x86-64 : x2.7
Intel Core 2, x86-64  : x1.9
Intel Atom N260, i386 : x1.4

Cc: Jon Oberheide <jon@oberheide.org>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto: arc4 - improve performance by using u32 for ctx and variables

This patch changes u8 in struct arc4_ctx and variables to u32 (as AMD seems
to have problem with u8 array). Below are tcrypt results of old 1-byte block
cipher versus ecb(arc4) with u8 and ecb(arc4) with u32.

tcrypt results, x86-64 (speed ratios: new-u32/old, new-u8/old):

                  u32    u8
AMD Phenom II   : x3.6   x2.7
Intel Core 2    : x2.0   x1.9

tcrypt results, i386 (speed ratios: new-u32/old, new-u8/old):

                  u32    u8
Intel Atom N260 : x1.5   x1.4

Cc: Jon Oberheide <jon@oberheide.org>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto: arc4 - now arc needs blockcipher support

Since commit ce6dd368 ("crypto: arc4 - improve performance by adding
ecb(arc4)) we need to pull in a blkcipher.

|ERROR: "crypto_blkcipher_type" [crypto/arc4.ko] undefined!
|ERROR: "blkcipher_walk_done" [crypto/arc4.ko] undefined!
|ERROR: "blkcipher_walk_virt" [crypto/arc4.ko] undefined!

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
ARM: msm: remove clock-debug
This is only used for development and testing, remove it.
--mrg666
ARM: msm: disable nohlt debugfs node
ARM: msm: disable MSM_SMD_LOGGING
also modify Makefile so that smd_rpc_sym.c is only compiled when
MSM_SMD_LOGGING enabled since it is only needed by smem_log.c
--mrg666
Linux 3.4.79
msm: kgsl: Protect against a potential overflow in kgsl_sg_alloc

Avoid allocating a scatterlist so large that it overflows the size
passed to the memory allocators.

CRs-fixed: 564448
Change-Id: Ic0dedbad2ab421ddec8f3be38d61c9bdf9ae5bd4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Add check for NULL value from dev_get_drvdata

Check to see if dev_get_drvdata returns NULL and handle it.

CRs-Fixed: 552580
Change-Id: Ic0dedbad426dbbe15896608213067ee7337f3b34
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Restrict the maximum memory entries for bulk cache sync

Restrict the maximum number of memory entries that can be specified
to a single bulk cache sync call to PAGE_SIZE / sizeof(unsigned int)
so that the allocation can always fit within one page.

CRs-fixed: 578062
Change-Id: Ic0dedbad07e1986cd6ccc5b260ffef82b5adb6d3
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Fix mem leak when page allocation fails

Page allocation may fail during OOM condition. Update
sglen and size to correct value (allocated) so that
they get freed in kgsl_sharedmem_free().

Change-Id: I1aa0ca77bb767523dfcf0f6cc3a21eac2b6b80e4
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
csdio: Remove the driver
The driver is a legacy driver that is not used any longer
and its implementation is neither correct nor compiles.

Change-Id: I9862c0f93ccad6079a616f6997987d4e187a137c
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
defconfig: remove support for /dev/mem and /dev/kmem on perf builds
Keeping /dev/mem and /dev/kmem exposed to userspace allows userspace
to peek/poke to these areas and is a security risk. Remove support for
/dev/mem and /dev/kmem on perf builds.

Change-Id: Icaed922d80e271670fb0571852833d452771376c
CRs-Fixed: 530719
Signed-off-by: Sarang Joshi <spjoshi@codeaurora.org>
Revert "rtc-cmos: Add an alarm disable quirk"

This is just to be in sync with mainline Linux, otherwise has no effect
on mako kernel
perf/arm: fix duplicate code
msm: kgsl: Update dispatcher/server-side sync

Refresh the dispatcher/server-side sync code with some general
fixes to functionality, stability and fault tolerance.

Change-Id: Ic0dedbad48161513a2670d3949fccbdbf14b8dff
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm: kgsl: Allow sync points to be created on the submitter's context

There are situations where a submitting thread may wish to create a
syncpoint on an already issued timestamp to pause a context until a
previous command has been retired.  Relax the restriction against
submitting a sync point against one's own context and only check to
make sure the user isn't submitting a syncpoint against a future
timestamp (which would be an certain deadlock).

Change-Id: Ic0dedbad883fc228da0d94c8416a88504f5d1377
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: consolidate preamble based context switch code

Move logic for handling preamble based context switch
to the core adreno code. This makes it less burdensome
to implement support for newer GPU families that won't
ever support legacy context switching.

Change-Id: Id9ad5936ff91dcdbc9de869baf0d0b9fcf1b5170
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Add IB submission gate for device suspend

Add IB submission gate to stop the system from making requests
while suspend is requested.  This will force users to wait for
the system to resume before making more requests.

Change-Id: I2460ef9b4237b586a31d4cea64b6dd74d30b08d9
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm: kgsl: Do not take active_cnt for events and waittimestamp

In the mists of time it was nessesary to take an active count
for waittimestamp and events because we did not want to run
the risk of suspending while the GPU was active.  Now that we
have the dispatcher we have much better control over the GPU
so the original risk is diminished.

The problem is that holding active_cnt prevents us from going
into nap and suspend and with server-side-sync a lot of the
events we are waiting for might take a very long time before
they even get dispatched on the GPU so we are essentially
keeping the clocks on waiting for other people.

z180 must take active count on its own.

Change-Id: Ic0dedbadcb608115938b198faebe333d19c6a8f6
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>