mali-t6xx: fix null pointer deref whn dumping MMU page tables

At the moment when if we perform an instrumented dump of the MMU page tables,
the munmap call back will try to free physical pages that are supposed to be
in the memory region allocated for the dump but that are not there,
thus resulting in a NULL pointer exception followed by kernel panic.

In order to solve this, in "kbase_free_phy_pages()" (that is called by the
munmap callback) we need to check the memory region flags to see if
KBASE_REG_IS_MMU_DUMP flag is set.  If it is set then we have to skip the
 call to free the physical pages.

Bug:  7432454
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@arm.com>
Change-Id: I37d5c9f634ae08a1e8340671b15287354c75fd64
mali-t6xx: debug patch to trace "dep_item[0]" list abuse

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@arm.com>
Change-Id: I563a4c3c8696fa85505cc97379fb375df034c9bf
ARM: EXYNOS: manta: modify eMMC's drive stregnth to LV4

Bug: 7390764

Change-Id: I0c75ba51eac511301f69f10ef09286a6492eb42b
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: add h/w reset for mmc card

This patch adds h/w reset to support mmc core sequence
for mmc card. This patch provides more stability on mmc driver.

Bug: 7118793

Change-Id: I2b8a7553f48ce9622aaad843e4679b09e5d49760
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
ARM: EXYNOS: manta: add h/w reset function for eMMC

This patch adds h/w reset function to board file with using EMMC_EN
gpio pin. And other eMMC's pins should be set to output low for
power off.

Bug: 7390764

Change-Id: I5073f00fc5b2554a03d0d81ce67ce4e439e9d057
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: add DW_MMC_QUIRK_HW_RESET_PW quirk

This patch adds DW_MMC_QUIRK_HW_RESET_PW quirk for supporting
hardware reset using power off/on of card instead of reset pin
that is explicit in ext_csd regs.

Bug: 7390764

Change-Id: Ieb151ccae0bbc6d2d9c2120472afbbc82ccd5908
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: remove wait_prvdata_complete bit setting

This patch removes wait_prvdata_complete bit setting of CMD reg in
abnormal status. This bit is used for waiting for previous data transfer
completion before sending command. In abnormal status, it is not needed.

Bug: 7390764

Change-Id: I8c55f19184d6716a99d8e4da0ffe770789961fac
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: fix to check data busy on request func by CMD13

CMD13 is used to check the card state whether card is busy or not
after block write. If busy time is long, CMD13 should be issued many times.
Instead of that case, old patch was added to reduce cpu load.
But it was not considered for some erase operations which takes long
times over a few seconds. If it was taking time over a few seconds,
though it returned error, it was not error.
This patch fixes CMD13 is able to issue every 1 seconds.

Bug: 7336393, 7118793

Change-Id: I82ae59e0ebb0a07b9660e509ed848dfe73333255
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
ARM: EXYNOS: manta: Enable DW_MMC_QUIRK_HW_RESET_PW

This enables resetting the emmc chip when transaction errors are detected.

Change-Id: Ia5771acc8d69ae49735f996448c1c061342783d0
Signed-off-by: Ken Sumrall <ksumrall@android.com>
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>
s3c-fb: add register dump to debugfs

Bug: 7572971
Change-Id: I78a86db637a090791258d541e8bf4f4c5e138e50
Signed-off-by: Greg Hackmann <ghackmann@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>
ARM: exynos: manta: reserve 384MB for mali driver

Call kbase_carveout_mem_reserve to create a 384MB carveout for
use by the Mali GPU driver.  This will avoid sprinkling unmovable
pages mapped into the gpu all over the kernel's memory.

Change-Id: I3227556e175319553c25751a8447ed43be99dbcf
Signed-off-by: Colin Cross <ccross@android.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>
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-tv: add to clear interrupt after changing to HDMI internal interrupt

Add to clear interrupt after changing to HDMI internal interrupt
and call hpd_work only in unplug state of irq-handler.
Skip to check HPD_STATUS in hpd_work.

Bug: 7368925
Change-Id: Icd0a0ad4bdcd51811ae7d67caabaa93884b67291
Signed-off-by: Jun Kim <junkim@samsung.com>