net: wireless: bcmdhd: Fix dhd_txcomplete() dead lock

For TX packet dhd_prot_hdrpull does nothing other than pull the prot
header from the skb. Use a NULL ifdix pointer to indicate a handling
of tx packet and skip most of the header parsing routine - we don't
need it for TX packet and we can skip extra unnecessary PROP_TXSTATUS
parsing. It will resloved dead lock case because we just exit
dhd_prot_hdrpull for TX path.

Change-Id: Ic41e1c549036baeb0fabfb0be4b8331a4bf60682
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
netfilter: qtaguid: Don't BUG_ON if create_if_tag_stat fails

If create_if_tag_stat fails to allocate memory (GFP_ATOMIC) the
following will happen:

qtaguid: iface_stat: tag stat alloc failed
...
kernel BUG at xt_qtaguid.c:1482!

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
net: wireless: bcmdhd: Increase PNO wakelock to 7 sec

Change-Id: Ib4d51cb3ee1c117c645dda663e08a1ee5954c81c
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
mali: mark kbase_pm workqueue WQ_MEM_RECLAIM

kbase_cpu_vm_close, which is run in reclaim if the oom killer fires,
waits on the kbase_pm worker.  Mark the kbase_pm worker WQ_MEM_RECLAIM
to make sure it can always run during reclaim, even if there is not
enough memory to spawn new kworkers.

Change-Id: Idf9df2bbf4c70533dc54de31dbe0419ba995eddd
Signed-off-by: Colin Cross <ccross@android.com>
gpu: mali: get rid of kbase_page_metadata

Use the lru list_head in the page struct to avoid having to allocate
a struct just to hold the list_head and page pointer.  Also avoids
storing the list_head inside the page for lowmem pages, removing a
cache flush on allocation.

Change-Id: I3400f3109c8839502debb50a754308449bf28f52
Signed-off-by: Colin Cross <ccross@android.com>
gpu: mali: add a carveout for gpu memory

Try to allocate gpu memory from a memblock region reserved during
boot to avoid mixing unmovable gpu pages in with all the movable
userspace pages.

All gpu allocations are order 0, so all the free pages are just
stored on a list at boot and allocated off the front of the list.

Change-Id: Idc98981fde85a429046d38ba2ec7c849a50f7713
Signed-off-by: Colin Cross <ccross@android.com>
mmc: dw_mmc: add to clear HLE interrupt

HLE(Hardware Locked Error) interrupt is raised when host controller
cannot load a command issued by software. When software sets the
start_cmd bit in the CMD register, host contoller tries to load
the command. If the command buffer is already filled with a command,
this error is raised. This error can not occur by the current mmc
stack.

Change-Id: I5d62f009d23f513d81b5199fc98483814c379b32
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
media: exynos: s5p-mfc: prevent suspend while MFC is in use

Change-Id: I6beecbdcb828c20af0f32c1af4d97a163867786a
Signed-off-by: Dima Zavin <dima@android.com>
media: exynos: mfc: do not release firmware buffer when drm is enabled

The release function already had this check but the error paths in
open did not.

Change-Id: Ida0173787b86ce9df7656dc8e62c07f13916747d
Signed-off-by: Dima Zavin <dima@android.com>
media: exynos: mfc: get rid of interruptible dev/ctx wait_events

All the current wait_events already have timeouts, so it will never
block forever. The issue is that the current driver does not properly
deal with wait_event returning early when interrupted by system calls.
It ofter ignores the erros and continues, or it will treat it as a
fatal error and tear down contexts while the hardware is still
actively using them. This results in page faults and unexpected
interrupts that crash the system.

So, we turn all the interruptible wait_events into non-interruptible.
This doesn't do anything about the case when the hardware truly times
out, but that problem would have already existed anyway. If the
hardware actually times out, then there's a good chance it is stuck
and will not continue using the state we are about to tear down
(obviously not guaranteed). It will, however, address the most common
case which is getting a signal due to suspend freezing userspace
threads.

Change-Id: If8e5b4335218ec8f8901b4ef7e765a1973bc8d55
Signed-off-by: Dima Zavin <dima@android.com>
mali: fix section mismatch

Fix a section mismatch between kbase_carveout_mem_reserve and
memblock_alloc_base by adding an __init annotation to
kbase_carveout_mem_reserve.

Change-Id: I348e67530b57325aefd9031574fed5700fee1456
Signed-off-by: Colin Cross <ccross@android.com>
usb: gadget: accessory: Fix section mismatch (again)

create_bulk_endpoints should not be __init since it is called when
accessory is enabled.

Change-Id: Iac6e9f29d53c93760e926efd8e7603432632acb4
Signed-off-by: Todd Poynor <toddpoynor@google.com>
android: logger: enforce GID and CAP check on log flush

Restrict log flushing to those in the logs group, or
anyone with CAP_SYSLOG.

Change-Id: I5d6977d1c0d60ffe8487771cc195789e5db95454
Signed-off-by: Charndeep Grewal <csgrewa@tycho.ncsc.mil>
cpufreq: interactive: trace actual speed in target speed decisions

Tracing adds actual speed since this is expected to be key to the
choice of target speed.

Change-Id: Iec936102d0010c4e9dfa143c38a9fd0d551189c3
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: change speed according to current speed and target load

Add a target_load attribute that specifies how aggressively the governor is
to adjust speed to meet the observed load.  New target speed is calculated
as the current actual speed (may be higher than target speed on SMP) times
the CPU load (as a fraction) divided by target load (fraction).

cpufreq_frequency_table_target() call use CPUFREQ_RELATION_L to set
the next higher speed rather than next lower speed.

Change-Id: If432451da82f5fed12e15c9421d7d27792376150
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: apply above_hispeed_delay to each step above hispeed

Apply above_hispeed_delay whenever increasing speed to a new speed above
hispeed (not just the first step above hispeed).

Change-Id: Ibb7add7db47f2a4306a9458c4e1ebabb60698636
Signed-off-by: Todd Poynor <toddpoynor@google.com>
media: exynos: mfc: fix ctx wake up of uninterruptible tasks

Change-Id: I8de46d0619f30799d4fead400ca289358d9aa4e5
Signed-off-by: Dima Zavin <dima@android.com>
mmc: dw_mmc: fix to clear interrupt pending when exception

The previous code could not clear raw interrupt pending when
If clock update is fail to CIU after error occurs.
The remaining raw interrupt blocks to issue next operation,
The host controller can not process no longer.

Bug: 7390764, 7638890

Change-Id: I39208cea8d889f04524fa2f4c2d7ce58e91db623
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
gpu: ion: Fix bug in zeroing pages in system heap

Pages are zeroed for security purposes when returned to the
ion heap.  There was a bug in this code preventing this
from happening.

Bug: 7573871
Change-Id: I79c22ee1da98f306199f3a192eaec4e81d5fd059
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
media: exynos: mfc: print some debug info in irq on invalid context

Change-Id: I5f857f2aad2c861ad26072555cfcfe217e618090
Signed-off-by: Dima Zavin <dima@android.com>