In preparation for the forthcoming flurry of cherry-picks, match things
up with the 3.14 fork point by making the arm_smmu_ops variable
non-const. With this in place we should be able to cleanly cherry-pick
everything from the 3.14 fork point to the end of the msm-3.14 branch.
Change-Id: Ifa9d786e27be6d182edfecc1c05e033bc931cbd0
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
The memory to be mapped by the smmu needs to be uncached
since the bus is non-coherent. Pass coherent flag as false
to make sure that the memory is marked as uncached.
CRs-Fixed: 786121
Change-Id: Ie2849b1e1ec901e60e89706519cbd89d278e0b3e
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
IOMMU virtual addresses use the dma_addr_t type since they can be up to
64-bits. We're currently using an `unsigned int' to store our IOVA in
arm_iommu_map_sg, which could result in truncation. Use the correct
type for an I/O virtual address: dma_addr_t.
Change-Id: Ie63bf17268ca70d102ab9d472ed9bcc6f4a793d7
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
In arm_iommu_map_sg, currently we map each individual link in the given
scatterlist into the SMMU individually such that they may or may not be
virtually contiguous. However, in most (all?) of our use cases we
actually want the entire sg list mapped into the SMMU as a single
contiguous range. Use iommu_map_range to accomplish this.
Change-Id: Icf72ece50c3120a0091dbfab1523ff11da20f807
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
dma_ops should be const since they shouldn't be changing after being
defined (there's even a checkpatch warning for this). Convert existing
dma_ops to const.
Change-Id: Ic27ba9a0832b12cae43cd45c72f053335845fd8f
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Conflicts:
arch/arm64/include/asm/dma-mapping.h
arch/arm64/mm/dma-mapping.c
When CONFIG_ARM64_DMA_USE_IOMMU is not selected, drivers that make use
of the ARM DMA IOMMU mapping APIs currently don't link. First instinct
might be to add a dependency on CONFIG_ARM64_DMA_USE_IOMMU to those
drivers, but they might not actually want to do that because they might
have other ways of getting DMA-able memory.
Allow compilation when CONFIG_ARM64_DMA_USE_IOMMU is not selected by
providing necessary stub functions.
Change-Id: I172e00a0748c70676b8ff7555e217a1e6122e3e6
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
On systems with IOMMUs, it's useful to handle IOMMU mappings in the
dma-mapping layer. This is currently supported on arm but not arm64. Add
support in arm64 by gratuitously lifting most of the IOMMU-related stuff
from dma-mapping.c in arm.
The original arm work was done by Marek Szyprowski in [4ce63fcd91:
"ARM: dma-mapping: add support for IOMMU mapper"].
Change-Id: I1c3c8fe15049fe456751074398fd179ebd2ec64e
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[pdaly@codeaurora.org Disable upstream implementation]
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
It's incredibly useful to be able to see where reserved regions
were placed. Make those prints pr_info instead of just pr_debug.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Currently, the decision on which page protection to use
is limited to writecombine and coherent. Expand to include
strongly ordered memory and non consistent memory.
Change-Id: I7585fe3ce804cf321a5585c3d93deb7a7c95045c
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Reset the following files:
arm-smmu.c
iommu.c
include/linux/iommu.h
include/trace/events/iommu.h
to the git merge base between 3.18 and 4.4:
b2776bf714
Change-Id: I9aa58e08125e3a72d1e9742e26d4a6fab34b0ed5
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Move qpnp-power-on driver as input driver, also update
regulator related api in order to accomodate regualtor
framework
Signed-off-by: Jigarkumar Kishorkumar Zala <j_zala@codeaurora.org>
Dummy release event is sent when system resumes. This behavior
makes long press detection failed for some keys like POWER key
and HEADSET key. Add INPUT_PROP_NO_DUMMY_RELEASE to make it is
possible for some input to avoid this behavior.
Need add set_bit(INPUT_PROP_NO_DUMMY_RELEASE,inputdevice->propbit)
in specific drivers that don't want the DUMMY release event.
Change-Id: I30ba5045273aca9a4613b7f6dcdcf7a7173b5c27
Signed-off-by: Kun Liang <kunliang@codeaurora.org>
[joshc: Renumbered flag due to conflict, adapted to upstream
input_reset_device() changes upstream.]
Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
[abhimany: Renumbered flag due to conflict]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
The status of the CoreSight fuses can be derived from the AUTHSTATUS
register. This patch add support to read AUTHSTATUS, which could be used
by Coresight device drivers to determine if that component is functional
in hardware.
Change-Id: I6b7ac2a3558c238ac5fca452ddfb6c88eef14b8b
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
PMIC VADC_TM driver provides clients to set
threholds on supported VADC channels such as
vph_pwr and thermistors and receive notification
on threshold crossing.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
QPNP PMIC VADC driver provides clients ability
to read voltage channels supported by the PMIC such
as vph_pwr and board thermistors.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This snapshot is taken as of msm-3.18 commit dbdb6776f
(Merge "msm: camera: Add dummy sub module in sensor pipeline")
Fixup compilation to support int type for temperature
value as part of thermal ops API upgrade.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
SCM (Secure Channel Manager) driver is used to communicate
with the secure world entities like trustzone and hypervisor.
As a part of the communication we expect to give certain
input, output operands and the caller of the scm_callX
API would expect that output values or return values
of the scm_callX should not get corrupted (if they depend on it).
Due to Kasan instrumentation of the SCM driver following
code is getting instrumented with Kasan __asan_store8_noabort
APIs which would internally check if the memory access is allowed
and it is the functionality of the Kasan to check/instrument
the load and stores.
if (ret1)
*ret1 = r1;
if (ret2)
*ret2 = r2;
if (ret3)
*ret3 = r2;
All will be fine for the first *ret1 = r1; execution since
GCC has generated the code which saves the x1 value (r1)
into the another register but the execution of the
__asan_store8_noabort API after the saving of the register
corrupts the x2 and x3 when it returns. GCC has no knowledge
at this point to save the x2 and x3.
Due to this x2 and x3 is loaded with the Kasan shadow
offset value and Kasan shifted (>> 3) address.
Since x2 and x3 (r2 and r3 in the code above) would be used
as the ret2 and ret3 for the caller of the scm_callX API
the caller would get the wrong return values (if it needs them).
QSEECOM is one such driver which uses these ret2 and ret3 values
and due to this corruption QSEECOM driver was treating it as
SCM call failure, though the bug described above due to Kasan
instrumentation would be applicable to any caller needing
the right values of the ret2 and ret3.
SCM driver is very small and simple and we would not expect
the Out of bound or use-after-free errors for it, so it would
be fine to skip it from the Kasan instrumentation.
Change-Id: I8b2a17759295375c21abc520110f855f349faf4b
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Allow enabling KASAN on a per-directory or per-file basis rather than
for the entire kernel.
Change-Id: I9a491d3ab0df4c42302a258b9edb3b78cf4e1db0
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Some functions consume more than allowed stack frame
size with KASan enabled and GCC warns it as an error.
To avoid compilation warning, allow larger stack frame
size when KASan is enabled instead of changing each file.
Below is one of the warning messages for reference.
kernel/net/wireless/nl80211.c: In function 'nl80211_send_wiphy':
kernel/net/wireless/nl80211.c:1705:1: warning: the frame size
of 5488 bytes is larger than 2048 bytes [-Wframe-larger-than=]
Change-Id: I953018f459bf048366f0ba5ff7c980edcd9bbe07
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
KASan marks slub objects as redzone and free and the bitmasks for
that region are not cleared until the pages are freed. When
CONFIG_PAGE_POISONING is enabled, as the pages still have special
bitmasks, KAsan report arises during pages poisoning. So mark the
pages as alloc status before poisoning the pages.
==================================================================
BUG: KASan: use after free in memset+0x24/0x44 at addr ffffffc0bb628000
Write of size 4096 by task kworker/u8:0/6
page:ffffffbacc51d900 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x4000000000000000()
page dumped because: kasan: bad access detected
Call trace:
[<ffffffc00008c010>] dump_backtrace+0x0/0x250
[<ffffffc00008c270>] show_stack+0x10/0x1c
[<ffffffc001b6f9e4>] dump_stack+0x74/0xfc
[<ffffffc0002debf4>] kasan_report_error+0x2b0/0x408
[<ffffffc0002dee28>] kasan_report+0x34/0x40
[<ffffffc0002de240>] __asan_storeN+0x15c/0x168
[<ffffffc0002de47c>] memset+0x20/0x44
[<ffffffc0002d77bc>] kernel_map_pages+0x2e8/0x384
[<ffffffc000266458>] free_pages_prepare+0x340/0x3a0
[<ffffffc0002694cc>] __free_pages_ok+0x20/0x12c
[<ffffffc00026a698>] __free_pages+0x34/0x44
[<ffffffc00026ab3c>] __free_kmem_pages+0x8/0x14
[<ffffffc0002dc3fc>] kfree+0x114/0x254
[<ffffffc000b05748>] devres_free+0x48/0x5c
[<ffffffc000b05824>] devres_destroy+0x10/0x28
[<ffffffc000b05958>] devm_kfree+0x1c/0x3c
Memory state around the buggy address:
ffffffc0bb627f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0bb627f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffc0bb628000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffffffc0bb628080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffffffc0bb628100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
BUG: KASan: use after free in memset+0x24/0x44 at addr ffffffc0bb2fe000
Write of size 4096 by task swapper/0/1
page:ffffffbacc4fdec0 count:0 mapcount:0 mapping: (null) index:0xffffffc0bb2fe6a0
flags: 0x4000000000000000()
page dumped because: kasan: bad access detected
Call trace:
[<ffffffc00008c010>] dump_backtrace+0x0/0x250
[<ffffffc00008c270>] show_stack+0x10/0x1c
[<ffffffc001b6f9e4>] dump_stack+0x74/0xfc
[<ffffffc0002debf4>] kasan_report_error+0x2b0/0x408
[<ffffffc0002dee28>] kasan_report+0x34/0x40
[<ffffffc0002de240>] __asan_storeN+0x15c/0x168
[<ffffffc0002de47c>] memset+0x20/0x44
[<ffffffc0002d77bc>] kernel_map_pages+0x2e8/0x384
[<ffffffc000266458>] free_pages_prepare+0x340/0x3a0
[<ffffffc0002694cc>] __free_pages_ok+0x20/0x12c
[<ffffffc00026a698>] __free_pages+0x34/0x44
[<ffffffc0002d9c98>] __free_slab+0x15c/0x178
[<ffffffc0002d9d14>] discard_slab+0x60/0x6c
[<ffffffc0002dc034>] __slab_free+0x320/0x340
[<ffffffc0002dc224>] kmem_cache_free+0x1d0/0x25c
[<ffffffc0003bb608>] kernfs_put+0x2a0/0x3d8
Memory state around the buggy address:
ffffffc0bb2fdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc0bb2fdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffffffc0bb2fe000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
^
fffffc0bb2fe080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc0bb2fe100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Change-Id: Id963b9439685f94a022dcdd60b59aaf126610387
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
the pages allocated for thread info is used for stack. KAsan marks
some stack memory region for guarding area and the bitmasks for
that region are not cleared until the pages are freed. When
CONFIG_PAGE_POISONING is enabled, as the pages still have special
bitmasks, a out of bound access KASan report arises during pages
poisoning. So mark the pages as alloc status before poisoning the
pages.
==================================================================
BUG: KASan: out of bounds on stack in memset+0x24/0x44 at addr ffffffc0b8e3f000
Write of size 4096 by task swapper/0/0
page:ffffffbacc38e760 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x4000000000000000()
page dumped because: kasan: bad access detected
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 3.18.0-g5a4a5d5-07244-g488682c-dirty #12
Hardware name: Qualcomm Technologies, Inc. MSM 8996 v2.0 LiQUID (DT)
Call trace:
[<ffffffc00008c010>] dump_backtrace+0x0/0x250
[<ffffffc00008c270>] show_stack+0x10/0x1c
[<ffffffc001b6f9e4>] dump_stack+0x74/0xfc
[<ffffffc0002debf4>] kasan_report_error+0x2b0/0x408
[<ffffffc0002dee28>] kasan_report+0x34/0x40
[<ffffffc0002de240>] __asan_storeN+0x15c/0x168
[<ffffffc0002de47c>] memset+0x20/0x44
[<ffffffc0002d77bc>] kernel_map_pages+0x2e8/0x384
[<ffffffc000266458>] free_pages_prepare+0x340/0x3a0
[<ffffffc0002694cc>] __free_pages_ok+0x20/0x12c
[<ffffffc00026a698>] __free_pages+0x34/0x44
[<ffffffc00026abb0>] free_kmem_pages+0x68/0x80
[<ffffffc0000b0424>] free_task+0x80/0xac
[<ffffffc0000b05a8>] __put_task_struct+0x158/0x23c
[<ffffffc0000b9194>] delayed_put_task_struct+0x188/0x1cc
[<ffffffc00018586c>] rcu_process_callbacks+0x6cc/0xbb0
[<ffffffc0000bfdb0>] __do_softirq+0x368/0x750
[<ffffffc0000c0630>] irq_exit+0xd8/0x15c
[<ffffffc00016f610>] __handle_domain_irq+0x108/0x168
[<ffffffc000081af8>] gic_handle_irq+0x50/0xc0
Memory state around the buggy address:
ffffffc0b8e3f980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0b8e3fa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffc0b8e3fa80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
^
ffffffc0b8e3fb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0b8e3fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Change-Id: I90aa1c6e82a0bde58d2d5d68d84e67f932728a88
Signed-off-by: Se Wang (Patrick) Oh <sewango@codeaurora.org>
The commit 'a106f65b("dma-mapping: Add dma_remap functions")' is
defined remap functions for ARM arch only, so it will break other
architecture compilation.
So remap functions are excluded, if arch is not using DMA.
Change-Id: Id39fcbac74f30a0ab1b3ce0c780460017ea189e5
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
This property is no longer used in 4.4 kernel, hence remove it.
Change-Id: I8fe311d95359220fa8f44e9b39db61e01ee34f5b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This is handled in the ufs platform init. Drop the upstream
change that was missed in the ufs driver port to 4.4 kernel.
Change-Id: Ia3305f2b4f6c6eeafe3866833f2c98e186ad6632
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Enable the following MSM I2C related features:
- qcom-sps-dma driver which is the dma engine wrapper for BAM
- i2c-msm-v2 driver, the main MSM I2C driver.
- I2C CHARDEV that allows userspace to communicate with I2C framework.
Change-Id: Ibca06d935de61517ef1a927828789875fcdb7718
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Remove the use of PM_RUNTIME feature flag which is obsoleted on newer
kernel versions. Instead use PM feature flag to condiitionally compile
RPM callbacks.
Change-Id: I775c89f79b698bf3f20fdb655216027e58e7059d
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Remove the use of PM_RUNTIME feature flag in the driver as this flag
is obsoleted on newer kernel versions. Instead use PM flag to conditionally
compile RPM callbacks.
Change-Id: I92d4b9ac15d05c6144a68ddd41f29b00aa209fd2
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Remove the use of the PM_RUNTIME config flag in code. This feature flag
has been obsoleted on newer kernel versions, instead use the generic
PM feature flag to conditionally compile RPM callbacks.
Change-Id: Id78a31a3cb59694d07e24ba6f762d608354d758a
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
This commit adds a snapshot of the i2c-msm-v2 driver from kernel-3.18.
Kernel-3.18 baseline: e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1
Change-Id: I392a1761ecc324c4a229caf112b1dc4c32a3b9bf
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Modify the qcom-sps-dma driver to adapt to the framework changes in
dmaengine introduced between kernel-3.18 and kernel-4.4 .
Change-Id: I000e209af6cf26e652d6937af67eb3382d2d2262
Add a snapshot of the qcom-sps-dma driver from the 3.18 kernel branch.
3.18 baseline: e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1
Change-Id: Ifa64e83d25e6cca220a0435757da861e28f97480
This change adds a snapshot of SPI QSD driver from the 3.18 branch.
kernel-3.18 baseline: e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1
Change-Id: I6e2a4be429a2681603a12e5ecb6853582cd3ffbe
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Read the hi-power power-supply property in the
get_property callback to avoid warnings from the
power-supply framework.
Change-Id: I5a9bb9b625ceb308afab915db9ac784a567ffbfb
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Temperature sensor (TSENS) driver provides clients to
read on die temperature sensors and set temperature
thresholds for thermal mitigation.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This snapshot is taken as of msm-3.18 commit dbdb6776f
(Merge "msm: camera: Add dummy sub module in sensor pipeline")
Commit 0b46b8a7 (clocksource: arch_timer: Fix code to use
physical timers when requested) introduces the use of
physical counters and requires clients to use api
arch_counter_get_cntvct(). Accordingly update tsens_poll()
to the new API to prevent a BUG_ON() during bootup.
Fixup TSENS to use supported int type for temperature value.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
batterydata-lib.h limits function declarations to certain CONFIGs and
provides stub function definitions for everyone else. Remove the function
defintions and provide function declarations to everyone.
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
QTI charger drivers have outgrown thier home in power and deserve their
own sub-directory. Move all QTI charger drivers and their depedencies to
a new sub-directory of power called qcom-charger.
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Many of the older SMB charger drivers are no longer present therefore
remove the config entries for them.
Duplicate config entries are present. Remove them.
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Embedded power measurement (EPM) driver allows
clients to read supported current and voltage
channels for power measurements.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This snapshot is taken as of msm-3.18 commit dbdb6776f
(Merge "msm: camera: Add dummy sub module in sensor pipeline")
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>