505 Commits

Author SHA1 Message Date
SecureCRT
29e0f0df9d mmc: msm_sdcc: Add prog done interrupt support
Enable prog done interrupt for stop command(CMD12) that is sent
after a multi-block write(CMD25). The PROG_DONE bit is set when
the card has finished its programming and is ready for next data.

After every write request the card will be polled for ready status
using CMD13. For a multi-block write(CMD25) before sending CMD13,
stop command (CMD12) will be sent.  If we enable prog done interrupt
for CMD12, then CMD13 polling can be avoided. The prog done interrupt
means that the card is done with its programming and is ready for
next request.
2012-08-23 00:34:36 +08:00
SecureCRT
81d981629c mmc: msm_sdcc: Fix possible circular locking dependency warning
In the context of request processing thread, data mover lock is
acquired after the host lock.  In another context, in the completion
handler of data mover the locks are acquired in the reverse order,
resulting in possible circular lock dependency warning. Hence,
schedule a tasklet to process the dma completion so as to avoid
nested locks.
2012-08-23 00:10:19 +08:00
SecureCRT
04d584c634 drivers/mmc/host/msm-sdcc: remove dead config options
CONFIG_MMC_MSM7X00A_RESUME_IN_WQ and CONFIG_MMC_EMBEDDED_SDIO don't exist
in Kconfig and is never defined anywhere else, therefore removing all
references for it from the source code.
2012-08-23 00:00:26 +08:00
SecureCRT
7c81b7476d ksm: check for ERR_PTR from follow_page() 2012-08-17 01:49:14 +08:00
SecureCRT
8b041c69af mm/ksm.c is doing an unneeded _notify in write_protect_page. 2012-08-17 01:40:53 +08:00
SecureCRT
c95ed3371a staging: zram: fix zram locking
Staging: zram: Replace mutex lock by a R/W semaphore
Staging: zram: Add a missing GFP_KERNEL specifier in zram_init_device()
2012-08-17 01:21:55 +08:00
SecureCRT
cc0db50c33 ksm: remove unswappable max_kernel_pages
ksm: fix bad user data when swapping
thp: ksm: free swap when swapcache page is replaced
2012-08-17 01:19:24 +08:00
securecrt
0c4a37e304 change MSM_NAND_DMA_BUFFER_SIZE to SZ_1M 2012-08-15 18:07:29 +08:00
securecrt
cdcb35c854 pmem_adsp (user-space) as non-cached
pmem_venc (user-space) as non-cached
2012-08-15 18:06:24 +08:00
securecrt
fced437cd2 pmem: Check for valid virtual address while flushing
pmem: Correctly account for aligned blocks
2012-08-15 18:04:29 +08:00
securecrt
e04d028ecf reduced the log size 2012-08-15 18:03:44 +08:00
securecrt
9c3257d859 android: logger: Allow a UID to read it's own log entries
staging: logger: hold mutex while removing reader
staging: android: logger: clarify non-update of w_off in do_write_log_from_user
staging: android: logger: clarify code in clock_interval
staging: android: logger: reorder prepare_to_wait and mutex_lock
staging: android: logger: simplify and optimize get_entry_len
staging: android: logger: Change logger_offset() from macro to function
Staging: android: fixed white spaces coding style issue in logger.c
android: logger: bump up the logger buffer sizes
2012-08-15 14:56:37 +08:00
securecrt
d6b41b0def staging: android: lowmemorykiller: sysfs node and notifications
android, lowmemorykiller: remove task handoff notifier
staging: android: lowmemorykiller: Fix task_struct leak
staging: android/lowmemorykiller: Don't unregister notifier from atomic context
staging: android, lowmemorykiller: convert to use oom_score_adj
staging: android/lowmemorykiller: Do not kill kernel threads
staging: android/lowmemorykiller: No need for task->signal check
staging: android/lowmemorykiller: Better mm handling
staging: android/lowmemorykiller: Don't grab tasklist_lock
staging: android: lowmemorykiller: Don't wait more than one second for a process to die
Staging: android: fixed 80 characters warnings in lowmemorykiller.c
staging: android: lowmemorykiller: Ignore shmem pages in page-cache
staging: android: lowmemorykiller: Remove bitrotted codepath
staging: android: lowmemkiller: Substantially reduce overhead during reclaim
staging: android: lowmemorykiller: Don't try to kill the same pid over and over
2012-08-15 13:37:30 +08:00
securecrt
9b8229cafb Staging: android: binder: Don't call dump_stack in binder_vma_open
Staging: android: binder: Fix crashes when sharing a binder file between processes
drivers:staging:android Typos: fix some comments that have typos in them.
fs: Remove missed ->fds_bits from cessation use of fd_set structs internally
Staging:android: Change type for binder_debug_no_lock switch to bool
Staging: android: binder: Fix use-after-free bug
2012-08-14 16:48:25 +08:00
securecrt
e20f7d7077 base: genlock: Remove genlock_release_lock and associated ioctl
base: genlock: allow synchronization with a single gralloc handle
base: genlock: remove BIT macro usage
2012-08-14 13:45:36 +08:00
securecrt
8bdae42d95 net: netfilter: enable bandwidth control
to be able to set mobile data limit
2012-08-01 10:55:06 +08:00
securecrt
c6e8ee54ff msm: kgsl: rework ib checking
Separate ib parse checking from cffdump as it is useful
in other situations. This is controlled by a new debugfs
file, ib_check. All ib checking is off (0) by default,
because parsing and mem_entry lookup can have a performance
impact on some benchmarks. Level 1 checking verifies the
IB1's. Level 2 checking also verifies the IB2.
2012-07-26 16:14:35 +08:00
securecrt
d842173fc6 msm: kgsl: Add markers to identify IB sequence start and end
Add nop packets in ringbuffer at the start and end of IB buffers
subnmitted by user space driver. These nop packets serve as markers
that can be used during replay, recovery, and snapshot to get valid
data for a GPU hang dump
2012-07-26 15:37:36 +08:00
securecrt
1672c9446f msm: kgsl: Optimize page_alloc allocations
User memory needs to be zeroed out before it is sent to the user.
To do this, the kernel maps the page, memsets it to zero and then
unmaps it.  By virtue of mapping it, this forces us to flush the
dcache to ensure cache coherency between kernel and user mappings.
Originally, the page_alloc loop was using GFP_ZERO (which does a
map, memset, and unmap for each individual page) and then we were
additionally calling flush_dcache_page() for each page killing us
on performance.  It is far more efficient, especially for large
allocations (> 1MB), to allocate the pages without GFP_ZERO and
then to vmap the entire allocation, memset it to zero, flush the
cache and then unmap. This process is slightly slower for very
small allocations, but only by a few microseconds, and is well
within the margin of acceptability. In all, the new scheme is
faster than the default for all sizes greater than 16k, and is
almost 4X faster for 2MB and 4MB allocations which are common for
textures and very large buffer objects.

The downside is that if there isn't enough vmalloc room for the
allocation that we are forced to fallback to a slow page by
page memset/flush, but this should happen rarely (if at all) and
is only included for completeness.
2012-07-26 14:45:24 +08:00
securecrt
394bda433a msm: kgsl: Map a guard page on the back of GPU MMU regions
Add a guard page on the backside of page_alloc MMU mappings to protect
against an over zealous GPU pre-fetch engine that sometimes oversteps the
end of the mapped region. The same phsyical page can be re-used for each
mapping so we only need to allocate one phsyical page to rule them all
and in the darkness bind them.
2012-07-26 14:04:25 +08:00
securecrt
4822aef009 msm: kgsl: Change name of vmalloc allocator
Change the vmalloc allocation name to something more appropriate since
we do not allocate memory using vmalloc for userspace driver. We
directly allocate physical pages and map that to user address space. The
name is changed to page_alloc instead of vmalloc. Add sysfs files to
track memory usage via both vmalloc and page_alloc.
2012-07-26 13:52:28 +08:00
securecrt
e2ff78936f msm: kgsl: Do not dereference pointer before checking against NULL
The pagetable pointer was checked against NULL after being used.
Check against NULL first and then dereference it.
2012-07-25 21:10:10 +08:00
securecrt
41b9064ec2 msm: kgsl: don't clear gpuaddr when unmapping global mappings
Memory mapped through kgsl_mmu_map_global() is supposed to have
the same gpu address in all pagetables. And the memdesc will
persist beyond the lifetime of any single pagetable.
Therefore, memdesc->gpuaddr should not be zeroed for these
memdescs.
2012-07-25 21:08:59 +08:00
securecrt
121a2a91a5 msm: kgsl: Add GMEM size configuration in gpu list
To avoid msm or gpu specific code in the driver, added
GMEM size configuration parameter as a part of gpu list.
2012-07-25 20:39:13 +08:00
securecrt
efa80a4cc1 msm: kgsl: Cleanup header file macros
Remove macro logic for macros that are always defined.
2012-07-25 20:27:26 +08:00
securecrt
503977ed6b fix #4151332 2012-07-25 20:23:24 +08:00
securecrt
15793c0aaa msm: kgsl: Find a mem_entry by way of a GPU address and a pagetable base
Given a pagetable base and a GPU address, find the struct kgsl_mem_entry
that matches the object.  Move this functionality out from inside another
function and promote it to top level so it can be used by upcoming
functionality.
2012-07-25 19:54:21 +08:00
securecrt
41513329a1 msm: kgsl: Detach memory objects from a process ahead of destroy time
Previously, memory objects assumed that they remained attached to a
process until they are destroyed. In the past this was mostly true,
but worked by luck because a process could technically map the memory
and then close the file descriptor which would eventually explode. Now we
do the process related cleanup (MMU unmap, fixup statistics) when the
object is released from the process so the process can go away without
affecting the other holders of the mem object refcount.
2012-07-25 19:47:35 +08:00
securecrt
93d86da2ee msm: kgsl: handle all indirect buffer types in postmortem
Postmortem dump was not parsing CP_INDIRECT_BUFFER_PFE commands.
Snapshot was recently fixed to handle this, and this change
extends support to postmortem dump.
2012-07-25 19:41:35 +08:00
securecrt
543247cd01 msm: kgsl: return correct error code for unknown ioctls
Unknown ioctl code errors are supposed to be ENOIOCTLCMD,
not EINVAL.
2012-07-25 19:35:35 +08:00
securecrt
1b6fa28430 msm: kgsl: Update the GMEM and istore size for A320
Set the correct GMEM and istore sizes for A320 on APQ8064.
The more GMEM we have the happier we are, so the code will
work with 256K, but it will be better with 512K.  For the
instruction store the size is important during GPU snapshot
and postmortem dump.  Also, the size of each instruction is
different on A3XX so remove the hard coded constants and
add a GPU specific size variable.
2012-07-25 19:14:12 +08:00
securecrt
411b4bcb90 reduced the PMEM_ADSP size as the HW decoder still can't work on HD2 2012-07-25 19:12:41 +08:00
SecureCRT
0885149512 msm: kgsl: Add support for the A3XX family of GPUs
Add support for the A320, the first of the new generation
of Adreno GPUs.
2012-07-25 00:10:26 +08:00
SecureCRT
be4c38e2f5 msm: kgsl: handle larger instruction store for adreno225
This GPU has a larger instruction store, so more memory
needs to be reserved for saving shader state when context
switching.

The initial vertex and pixel partitioning of the
instruction store also needs to be different.
2012-07-24 23:30:19 +08:00
securecrt
ee339b2bcb msm: kgsl: Write the retired timestamp on resume
Write the retired timestamp into the expected location. This fixes
userspace crashes after resume when the retired timestamp is read
as 0 instead of the expected last timestamp.
2012-07-23 18:59:50 +08:00
securecrt
148ebef127 reverse DEBUG_TRACE_VDEC 2012-07-23 14:37:40 +08:00
securecrt
544a54b32b ignore the version check 2012-07-23 14:13:02 +08:00
SecureCRT
b8450f4096 msm: kgsl: change timestamp frees to use kgsl_event
The timestamp memqueue was unsorted, which could cause
memory to not be freed soon enough. The kgsl_event
list is sorted and does almost exactly the same thing
as the memqueue did, so freememontimestamp is now
implemented using the kgsl_event list.
2012-06-23 19:03:55 +08:00
SecureCRT
4520a7c383 msm: kgsl: cancel events from kgsl_release
Events need to be cancelled when an fd is released,
to avoid possible memory leaks or use after free.

When the event is cancelled, its callback is called.
Currently this is sufficient since events are used for
resource management and we have no option but to
release the lock or memory. If future uses need to
distinguish between the callback firing and
a cancel, they can look at the timestamp passed to
the callback, which will be before the timestamp they
expected. Otherwise a separate cancel callback can
be added.
2012-06-23 18:52:06 +08:00
SecureCRT
f6acf3ab9f msm: kgsl: queue timestamp expired work more often
There are a some workloads where interrupts do not
always get generated, and as a result the timestamp
work was not triggered often enough.

Queue timestamp expired work from adreno_waittimestamp(),
when the timestamp expires while we are not waiting.
It is possible in this case that no interrupt fired
because no processes were waiting.

Queue timestamp expired work when freememontimestamp
is called, which reduces the amount of memory
built up by applications that use this api often.
2012-06-23 17:48:20 +08:00
SecureCRT
5c1047c767 msm: kgsl: set the dma_address field of scatterlists
Ion carveout and content protect heap buffers do not
have a struct page associated with them. Thus
sg_phys() will not work reliably on these buffers.
Set the dma_address field on physically contiguous
buffers.  When mapping a scatterlist to the gpummu
use sg_dma_address() first and if it returns 0
then use sg_phys().

msm: kgsl: Use kzalloc to allocate scatterlists of 1 page or less

The majority of the scatterlist allocations used in KGSL are under 1
page (1 page of struct scatterlist is approximately 1024 entries
equalling 4MB of allocated buffer).  In these cases using vmalloc
for the sglist is undesirable and slow.  Add functions to check the
size of the allocation and favor kzalloc for 1 page allocations and
vmalloc for larger lists.
2012-06-23 17:02:28 +08:00
SecureCRT
a7bb935abb revert the pmem size to default configration 2012-06-23 17:01:57 +08:00
SecureCRT
361e591fe7 msm: kgsl: remove readl/writel use for dma memory
For dma_alloc_coherent() you don't need writel/readl because
it's just a plain old void *. Linux tries very hard to make a
distinction between io memory (void __iomem *) and memory
(void *) so that drivers are portable to architectures that
don't have a way to access registers via pointer dereferences.
You can see http://lwn.net/Articles/102232/ and the Linus rant
http://lwn.net/Articles/102240/ here for more details behind
the motivation.

msm: kgsl: Allocate physical pages instead of using vmalloc

Replace vmalloc allocation with physical page allocation. For most
allocations we do not need a kernel virual address. vmalloc uses up
the kernel virtual address space. By replacing vmalloc with physical
page alloction and mapping that allocation to kernel space only
when it is required prevents the kgsl driver from using unnecessary
vmalloc virtual space.
2012-06-22 16:49:00 +08:00
SecureCRT
8c39724a75 remove zImage before compile 2012-06-22 16:48:37 +08:00
SecureCRT
47e6ec131b reverse the GENLOCK 2012-06-22 16:20:22 +08:00
SecureCRT
376f66c119 msm: kgsl: convert sg allocation to vmalloc
kmalloc allocates physically contiguous memory and
may fail for larger allocations due to fragmentation.
The large allocations are caused by the fact that the
scatterlist structure is 24 bytes and the array size
is proportional to the number of pages being mapped.
2012-06-22 16:08:12 +08:00
SecureCRT
b4c5202bec msm: kgsl: make cffdump work with the MMU enabled
The tools that process cff dumps expect a linear
memory region, but the start address of that region can
be configured. As long as there is only a single
pagetable (so that there aren't duplicate virtual
addresses in the dump), dumps captured with the
mmu on are easier to deal with than reconfiguring
to turn the mmu off.
2012-06-22 15:38:14 +08:00
SecureCRT
a19d2698cc msm: kgsl: Add ION as an external memory source
Allow ION buffers to be attached via IOCTL_KGSL_MAP_USER_MEM
2012-06-22 15:24:51 +08:00
securecrt
91bbe54c4f msm: kgsl: Fixup per-process memory statistics
Make the framework for reporting per-process memory statistics a little bit
more generic.  This should make it easier to keep track of more external
memory sources as they are added.
2012-06-21 13:41:21 +08:00
securecrt
9d909cf27b msm: kgsl: Make sure kmemleak tool does not report incorrect mem leak.
Certain memory allocations are not properly tracked by kmemleak tool,
which makes it to incorrectly detect memory leak. Notify the tool by using
kmemleak_not_leak() to ignore the memory allocation so that incorrect leaks
report are avoided.
2012-06-21 13:01:23 +08:00