summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-09-18mediatek:adjust usb20 pull-up flowandroid-6.0.0_r0.6android-mediatek-sprout-3.10-marshmallowyang-cy.chen
Problem: USB function will switch back to "Chagring only" from MTP automatically on some PC, and this was caused by UsbDeviceManager can't get USB connect event on time.If response time is more than 1 sec, UsbDeviceMange will switch to default "Chagring only". Solution: Don't do USB power on/off flow when cable already connected with PC. Only need to set/clean MUSB_POWER_SOFT_CONN bit to speed-up PC re-enumeration. Bug num:23576696 Change-Id: I729c34757ccfbcd5259ccd417d3c10c9ad37cbfa Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com> (cherry picked from commit dd0cfe8854284436a0747a1dfdf03e50d4b35951)
2015-09-02sprout: defconfig: setting svelte config maxcpus to 2 coresyang-cy.chen
Bug num:23596982 Change-Id: If999ad1d64e91d4fab5091c1252ac7206edf7bd8 Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com>
2015-08-28mediatek:Deactivate sensor before event reportedyang-cy.chen
Description: Change the driver to follow SMD definition of below's link, the sensor must be deactivated before the event is reported through the HAL. (https://source.android.com/devices/sensors/report-modes.html#one-shot) Bug num:23206214 Change-Id: Icf62808b153e5013113b0716154de0207e6a4657 Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com> (cherry picked from commit b84e5aaf213f57327f4edc6d95301d91ef0ca95b)
2015-08-27mediatek: Sprout kernel has exploitable and wrong file openingyang-cy.chen
Problem: Use flip_open to read file from SD card. Solution: Remove defected code since don't use it now. Bug num:23420393 Change-Id: I23c7dfb841311d9f21fef15b5c7a33eee8403e41 Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com> (cherry picked from commit d7897ff67c9c7b73f1e3d48741e39af40672393a)
2015-08-14Mediatek: Proximity and Ambient sensor CTS failyang-cy.chen
Description: Test Case: CTS Verifier APK, CTS Sensor test item, TestBatchAndFlush Fail at 'SensorTest:WaitForFlush | sensor='cm36283 Proximity sensor' ... and 'SensorTest:WaitForFlush | sensor='cm36283 ambient sensor' ... Note: Before test, QA also should calibrate magnetometer, and ensure no magnetic fieldinterference. Problem: Ambient sensor issue: In stable light environment, raw data is stable output, however, kernel input layer filter the same data to sensor HAL. Proximity sensor issue: In this case, there is not outside object to trigger p-sensor event , so software need to start a timer directly report a faraway event. And the Other reason, sometimes the data reported to android layer before the case call flush(). Solution: make sure proximity timer can run when ps is enabled. Bug num:23005172 Change-Id: I2eb85681420b352d93f8ff722a53dd110d614980 Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com> (cherry picked from commit 962a4186c997f15e72558c421e0e72fd62270474)
2015-08-12mediatek: FM Radio play current(=79.22mA) too highyang-cy.chen
Problem: Using DRAM as playback buffer will block system enter deep idle power mode, and will consume more power during FM playback. Solution: Using SRAM instead of DRAM , and which can enter deep idle power mode for power saving Bug num:23097414 Change-Id: Ida0d97bf63d3bc6e707e823403ac38e071508de1 Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com> (cherry picked from commit 92f5ce3794774f00a8cbb7f600dfafaebccc8b4b)
2015-07-23mediatek: ccci: SIM1/SIM2 tests fail on first bootCylen Yao
Problem: SIM1/SIM2 tests fail on first booting after download Bug num: 18905043 Details: At first boot the system need more time to get ready, so modify MD2 boot timeout value from 10 to 30. Change-Id: I1f86e3fd489e5193832129377b80d579c63540c8 Signed-off-by: Cylen Yao <cylen.yao@mediatek.com> (cherry picked from commit 4ef693f7d4a21e8f0e71b6cb9b84f605867c1503)
2015-07-22Build Config for android-mediatek-sprout-3.10-m-devBaligh Uddin
Change-Id: Idc8e0ec601e2931c30289c6e11acecde54529579
2015-07-09ext4 crypto: fix return value for ext4_es_scan()Theodore Ts'o
Between 3.10 and 3.18, the abstraction to scan for objects in the slab cache which can be freed when the system is under memory pressure changed. When I backported the ext4 code from 3.18 to the 3.10 kernel, I didn't get the return value required by the calling conventions for the scan function correct, which could potentially cause the memory reclaimer to loop indefinitely. Change-Id: I1712fedf96fd91c911fb4d019d7ef76f6c4c1808 Signed-off-by: "Theodore Ts'o" <tytso@google.com>
2015-07-01mediatek: fix memory leak of slabtrace toolyang-cy.chen
Problem: Use single_open as the .open function in file_operations and seq_release as the .release function will cause a memory leak. Solution: using single_release as the .release function. Bug num: 22213471 Change-Id: I79c6a77fc74e6c4117751b5b033a2c60b48e5283 Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com>
2015-06-26sprout*_defconfig: remove CONFIG_ANDROID_LOGGER in defconfigsJin Qian
Android logger driver has been removed a few months ago. Change-Id: Ifa01d0bfc6defdd2b7349bd29a05c31145ca09aa
2015-06-21Revert "Revert "sprout: defconfig: svelte limit_mem configuration""Jin Qian
This reverts commit ce37991091215252403ddf765975eb6ca4966114. Change-Id: I48761c6492d4a4409047aa93dcb045babef12250
2015-06-16mediatek:camera sensor log reductionyang-cy.chen
Problem: too many log message Solution: remove camera sensor log Bug num:19851723 Change-Id: I8342b3611910c86a85368b51d1e920169bb5b04a Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com>
2015-06-11sprout*_defconfig: Adjust EXT4 config options due to ext4 3.19 meregeJin Qian
Disable EXT3 and enable use EXT4 for EXT2 and EXT3. Disable EXT4 posix_acls Change-Id: I3cc9d2211112acc0bc5276e6ae4e1d0915e275e9
2015-06-11of: add empty of_find_node_by_path() for !OFAlexander Shiyan
Add an empty version of of_find_node_by_path(). This fixes following build error for asoc tree: sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_probe': sound/soc/fsl/fsl_ssi.c:1471:2: error: implicit declaration of function 'of_find_node_by_path' [-Werror=implicit-function-declaration] sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL); Change-Id: I7baac946f86578badaf8d223359878f435fd3d64 Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Rob Herring <robh@kernel.org>
2015-06-11Merge branch 'android-3.10' into android-mediatek-sprout-3.10Jin Qian
d0aa434 Merge remote-tracking branch 'ext4-3.19/for-android-3.10-common' into android-3.10 5862c50 cpufreq: Iterate over all the possible cpus to create powerstats. 607437e ext4 crypto: allocate bounce pages using GFP_NOWAIT ... 7449299 net/unix: sk_socket can disappear when state is unlocked 6f4f0dc selinux: enable genfscon labeling for sysfs and pstore files Change-Id: Iaa138b29a77e2699148097b8fd8ed952a3df0398
2015-06-11mediatek: alsps: als & ps drivers don't workCylen Yao
Bug num: 21755012 Problem: CTS: SystemFeaturesTest#testSensorFeatures failing When the PARA partition is empty, cm36283 doesn't work. That's because we did the wrong error handling. Solution: The only thing we need to do is to apply default information instead of only returning error. Change-Id: I03e601de7ce69b22edaa791bdf9b2327301ab675 Signed-off-by: Cylen Yao <cylen.yao@mediatek.com>
2015-06-09Revert "sprout: defconfig: svelte limit_mem configuration"Jin Qian
This reverts commit 016ad0f3c5188f9f83f84b0ffc048607f33c4d9e. Change-Id: If5187af946fcc58bdcaaea3178490e421ed9580b
2015-06-08Merge remote-tracking branch 'ext4-3.19/for-android-3.10-common' into ↵Mohamad Ayyash
android-3.10
2015-06-08cpufreq: Iterate over all the possible cpus to create powerstats.Ruchi Kandoi
For architectures which support a single policy for multiple cpus, powerstats will not be initalized for all the cores. This change will make sure powerstats is initialized for all the cores. Also minor changes to increase code readability. Bug: 21498425 Change-Id: I938f45e92ff6d5371c32c4d0e37274e6de66769c Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-06-05sprout: defconfig: svelte limit_mem configurationjinqian
Set limit_mem=423M Change-Id: I5cb8ecec523ed5c658ee18372af4a62a778bf5b4
2015-06-04ext4 crypto: allocate bounce pages using GFP_NOWAITTheodore Ts'o
Previously we allocated bounce pages using a combination of alloc_page() and mempool_alloc() with the __GFP_WAIT bit set. Instead, use mempool_alloc() with GFP_NOWAIT. The mempool_alloc() function will try using alloc_pages() initially, and then only use the mempool reserve of pages if alloc_pages() is unable to fulfill the request. This minimizes the the impact on the mm layer when we need to do a large amount of writeback of encrypted files, as Jaeguk Kim had reported that under a heavy fio workload on a system with restricted amounts memory (which unfortunately, includes many mobile handsets), he had observed the the OOM killer getting triggered several times. Using GFP_NOWAIT If the mempool_alloc() function fails, we will retry the page writeback at a later time; the function of the mempool is to ensure that we can writeback at least 32 pages at a time, so we can more efficiently dispatch I/O under high memory pressure situations. In the future we should make this be a tunable so we can determine the best tradeoff between permanently sequestering memory and the ability to quickly launder pages so we can free up memory quickly when necessary. Change-Id: I3dbb5eb9a3aa04f40e551338eee5e8d06f352fe8 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-04ext4 crypto: release crypto resource on module exitChao Yu
Crypto resource should be released when ext4 module exits, otherwise it will cause memory leak. Change-Id: Ie298e73bd766768707a7af440691ce2f418f5acc Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-04ext4 crypto: handle unexpected lack of encryption keysTheodore Ts'o
Fix up attempts by users to try to write to a file when they don't have access to the encryption key. Change-Id: Iabdd438b26b409eaccf9c847fcf9c3ab52f1959e Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-04ext4 crypto: allocate the right amount of memory for the on-disk symlinkTheodore Ts'o
Previously we were taking the required padding when allocating space for the on-disk symlink. This caused a buffer overrun which could trigger a krenel crash when running fsstress. Change-Id: I4e05ff207748192036de58bc5af91ae4c357b5b4 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: clean up error handling in ext4_fname_setup_filenameTheodore Ts'o
Fix a potential memory leak where fname->crypto_buf.name wouldn't get freed in some error paths, and also make the error handling easier to understand/audit. Change-Id: I251041ff2df61dcc2a818539783cfc0de2e2933a Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: policies may only be set on directoriesTheodore Ts'o
Thanks to Chao Yu <chao2.yu@samsung.com> for pointing out we were missing this check. Change-Id: I823edbeddf6cc5086e4d17262d7c497368b1acb7 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: enforce crypto policy restrictions on cross-renamesTheodore Ts'o
Thanks to Chao Yu <chao2.yu@samsung.com> for pointing out the need for this check. Change-Id: I957a4e4be043582972d3c8799f18826fc136d567 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: encrypt tmpfile located in encryption protected directoryTheodore Ts'o
Factor out calls to ext4_inherit_context() and move them to __ext4_new_inode(); this fixes a problem where ext4_tmpfile() wasn't calling calling ext4_inherit_context(), so the temporary file wasn't getting protected. Since the blocks for the tmpfile could end up on disk, they really should be protected if the tmpfile is created within the context of an encrypted directory. Change-Id: I05e04109aa38878aba970d537de0316326a96fe1 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: make sure the encryption info is initialized on opendir(2)Theodore Ts'o
Change-Id: Ie78f2f807c0b3bc5959d2b601f18826f2658984d Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: set up encryption info for new inodes in ext4_inherit_context()Theodore Ts'o
Set up the encryption information for newly created inodes immediately after they inherit their encryption context from their parent directories. Change-Id: Ie2a48cde918eaf8ad978a8a698de24627b363955 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: fix memory leaks in ext4_encrypted_zerooutTheodore Ts'o
ext4_encrypted_zeroout() could end up leaking a bio and bounce page. Fortunately it's not used much. While we're fixing things up, refactor out common code into the static function alloc_bounce_page(). Change-Id: I44023c01de7ec97ad43bfa85cd7d3b97b22ee0c0 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: use per-inode tfm structureTheodore Ts'o
As suggested by Herbert Xu, we shouldn't allocate a new tfm each time we read or write a page. Instead we can use a single tfm hanging off the inode's crypt_info structure for all of our encryption needs for that inode, since the tfm can be used by multiple crypto requests in parallel. Also use cmpxchg() to avoid races that could result in crypt_info structure getting doubly allocated or doubly freed. Change-Id: I4ae5c07d0e5d99ec1e26eeb49d833c4a284d9a5f Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-06-04ext4 crypto: require CONFIG_CRYPTO_CTR if ext4 encryption is enabledTheodore Ts'o
On arm64 this is apparently needed for CTS mode to function correctly. Otherwise attempts to use CTS return ENOENT. Change-Id: I3f597f5f88e806dbeed75a7123c3d6bb7e608350 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@google.com>
2015-06-04ext4 crypto: shrink size of the ext4_crypto_ctx structureTheodore Ts'o
Some fields are only used when the crypto_ctx is being used on the read path, some are only used on the write path, and some are only used when the structure is on free list. Optimize memory use by using a union. Change-Id: I66de766a0f1122463edf3280ff0c2923be2472b8 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@google.com>
2015-06-04sched: cpufreq: update power usage only if cpufreq_stat is enabledAmit Pundir
Call acct_update_power() to track power usage of task only if CONFIG_CPU_FREQ_STAT is enabled, otherwise we run into following build failure: --------------- kernel/built-in.o: In function `account_user_time': kernel/sched/cputime.c:155: undefined reference to `acct_update_power' kernel/built-in.o: In function `__account_system_time': kernel/sched/cputime.c:208: undefined reference to `acct_update_power' make: *** [vmlinux] Error 1 --------------- Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2015-06-02mediatek:CMDQ log reductionyang-cy.chen
Problem: too many CMDQ log Solution: remove unnecessary CMDQ log Bug num:19851723 Change-Id: I0fa2c9f506026240cad32f875803a6cbcfc1b74a Signed-off-by: yang-cy.chen <yang-cy.chen@mediatek.com>
2015-06-01uid_cputime: Extends the cputime functionality to report power per uidRuchi Kandoi
/proc/uid_cputime/show_uid_stats shows a third field power for each of the uids. It represents the power in the units (uAusec) Change-Id: I52fdc5e59647e9dc97561a26d56f462a2689ba9c Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-06-01sched: cpufreq: Adds a field cpu_power in the task_structRuchi Kandoi
cpu_power has been added to keep track of amount of power each task is consuming. cpu_power is updated whenever stime and utime are updated for a task. power is computed by taking into account the frequency at which the current core was running and the current for cpu actively running at hat frequency. Change-Id: Ic535941e7b339aab5cae9081a34049daeb44b248 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-05-30cpufreq_stats: Adds the fucntionality to load current values for each frequencyRuchi Kandoi
for all the cores. The current values for the cpu cores needs to be added to the device tree for this functionaly to work. It loads the current values for each frequecy in uA for all the cores. Change-Id: If03311aaeb3e4c09375dd0beb9ad4fbb254b5c08 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-05-28ext4 crypto: get rid of ci_mode from struct ext4_crypt_infoTheodore Ts'o
The ci_mode field was superfluous, and getting rid of it gets rid of an unused hole in the structure. Change-Id: I0f4c38a1162fa9c6da8a3529b7477ff5560c21df Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@google.com>
2015-05-28ext4 crypto: use slab cachesTheodore Ts'o
Use slab caches the ext4_crypto_ctx and ext4_crypt_info structures for slighly better memory efficiency and debuggability. Change-Id: If47986e2e29fa181d113864dcd9d1cae79c72639 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@google.com>
2015-05-28ext4: clean up superblock encryption mode fieldsTheodore Ts'o
The superblock fields s_file_encryption_mode and s_dir_encryption_mode are vestigal, so remove them as a cleanup. While we're at it, allow file systems with both encryption and inline_data enabled at the same time to work correctly. We can't have encrypted inodes with inline data, but there's no reason to prohibit unencrypted inodes from using the inline data feature. Change-Id: Ia90b7e24bcf9ebabef529b710d70bd8ba71a17a4 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@google.com>
2015-05-28ext4 crypto: reorganize how we store keys in the inodeTheodore Ts'o
This is a pretty massive patch which does a number of different things: 1) The per-inode encryption information is now stored in an allocated data structure, ext4_crypt_info, instead of directly in the node. This reduces the size usage of an in-memory inode when it is not using encryption. 2) We drop the ext4_fname_crypto_ctx entirely, and use the per-inode encryption structure instead. This remove an unnecessary memory allocation and free for the fname_crypto_ctx as well as allowing us to reuse the ctfm in a directory for multiple lookups and file creations. 3) We also cache the inode's policy information in the ext4_crypt_info structure so we don't have to continually read it out of the extended attributes. 4) We now keep the keyring key in the inode's encryption structure instead of releasing it after we are done using it to derive the per-inode key. This allows us to test to see if the key has been revoked; if it has, we prevent the use of the derived key and free it. 5) When an inode is released (or when the derived key is freed), we will use memset_explicit() to zero out the derived key, so it's not left hanging around in memory. This implies that when a user logs out, it is important to first revoke the key, and then unlink it, and then finally, to use "echo 3 > /proc/sys/vm/drop_caches" to release any decrypted pages and dcache entries from the system caches. 6) All this, and we also shrink the number of lines of code by around 100. :-) Change-Id: I948f7844d425c0ce616f800446ecb0b6bea686f8 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-05-28ext4 crypto: separate kernel and userspace structure for the keyTheodore Ts'o
Use struct ext4_encryption_key only for the master key passed via the kernel keyring. For internal kernel space users, we now use struct ext4_crypt_info. This will allow us to put information from the policy structure so we can cache it and avoid needing to constantly looking up the extended attribute. We will do this in a spearate patch. This patch is mostly mechnical to make it easier for patch review. Change-Id: I208472675d0550df5f60b3b58652a9a1b434caed Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-05-28ext4 crypto: don't allocate a page when encrypting/decrypting file namesTheodore Ts'o
Change-Id: Ib0deff3a9aff318d8f2be6b4a550168d4771ccc2 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-05-28ext4 crypto: optimize filename encryptionTheodore Ts'o
Encrypt the filename as soon it is passed in by the user. This avoids our needing to encrypt the filename 2 or 3 times while in the process of creating a filename. Similarly, when looking up a directory entry, encrypt the filename early, or if the encryption key is not available, base-64 decode the file syystem so that the hash value and the last 16 bytes of the encrypted filename is available in the new struct ext4_filename data structure. Change-Id: Ia76a5e51770840c57a53180cd89476f2e9b8c966 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-05-28ext4 crypto: add padding to filenames before encryptingTheodore Ts'o
This obscures the length of the filenames, to decrease the amount of information leakage. By default, we pad the filenames to the next 4 byte boundaries. This costs nothing, since the directory entries are aligned to 4 byte boundaries anyway. Filenames can also be padded to 8, 16, or 32 bytes, which will consume more directory space. Change-Id: I2d4ab2b76797ab93fada683f405e3876e0cff9dc Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-05-28ext4 crypto: simplify and speed up filename encryptionTheodore Ts'o
Avoid using SHA-1 when calculating the user-visible filename when the encryption key is available, and avoid decrypting lots of filenames when searching for a directory entry in a directory block. Change-Id: Ifff4c07a80740112e2e984d2da3105e2fe41ab68 Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>
2015-05-28ext4 crypto: sync up the mainline 4.1-rc1 mergeTheodore Ts'o
There were some last minute changes that weren't reflected in the ext4 crypto patches that we were syncing with flounder. They were mostly whitespace changes, plus an error handling bugfix if there was a normal (non-crypto-related) bugs when adding a directory entry to an inode while creating a file. Change-Id: I01e1f8ee07aef2f826a27efcbfa85a825000f2bc Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@google.com>