Fix the compilation issues seen when CONFIG_DEBUG_FS is disabled in ufs
and thermal header files.
Change-Id: I670ffd0f51c9727d1e15f9f49f1afea25904fa8e
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
The MEM_ACCEPT interface assumes that the Resource Manager (RM)
will always return an SG-List. This is not correct when the
caller provides an SG-List, in which case the RM will not return
an SG-List, as it doesn't need to, since the caller knows where
the memory has been mapped. Thus, if the caller specifies an SG-List,
and the MEM_ACCEPT call is successful, then simply return the SG-List
that they provided.
Change-Id: I0ba98adc2f8fc858b1a653da909026a9b626c965
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
The __full_va_sweep() function within the functional fast DMA
test assumes that the first available mapping within the IOVA
space will be address 0. This was true when the IOVA allocation
code unconditionally set the starting search address to 0 when
it tried to wrap around to find an IOVA. However, since that is
no longer the case, change __full_va_sweep() to ensure that
the starting search address is 0 before executing the test.
Change-Id: Ib264475769fc945c1b9c74225d4189f5a2d912a6
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
There are IOMMU domains that require use of both the upper and
lower portions of the IOVA space. To fulfill this requirement,
add support to the ARM SMMU driver to correctly configure a few
registers when initializing a context bank, as well as use the
correct set of page tables when handling IOVAs.
Change-Id: I9845354845495601de83bf946c96c36f2346ceb7
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This reverts commit f645ecc002.
Instead, when gsi_setup() is returning the response payload for
RNDIS_MSG_INIT_C, override the MaxPacketsPerTransfer,
MaxTransferSize and PacketAlignmentFactor fields with the
packet aggregation size that GSI supports for uplink.
Change-Id: I0ee1b16571ede0e2a9312a52eb7e2b67b1a67677
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This reverts commit 8d0058d89c.
Instead, set GSI IN aggregation size by directly reading the
RNDIS_MSG_INIT message's MaxTransferSize field.
Change-Id: Ia36ac79f4fce2c3e89a542cfa82c39c4c1b52700
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Introduce DOMAIN_ATTR_SPLIT_TABLES for IOMMU domains that will
use the upper portion of the IOVA space, in conjunction with the
lower portion of the IOVA space.
Change-Id: I9d786396f5306f920c1d023bba8c85dce041c83c
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
alloc_attr() might return NULL on memory allocation
failure which would lead to NULL pointer
de-reference, fix it by adding NULL check.
Change-Id: Iec7fee76a29c85355142a8bb475e2416807debd5
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
Shrink_page_list expects all pages come from a same zone
but it's too limited to use.
This patch removes the dependency so next patch can use
shrink_page_list with pages from multiple zones.
Change-Id: I34469b7f0a79f2b79e30e40033ba8b3e1dd5f2d0
Signed-off-by: Minchan Kim <minchan@kernel.org>
Patch-mainline: linux-mm @ 9 May 2013 16:21:25
[vinmenon@codeaurora.org: changes for node based lrus]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
These day, there are many platforms available in the embedded market
and they are smarter than kernel which has very limited information
about working set so they want to involve memory management more heavily
like android's lowmemory killer and ashmem or recent many lowmemory
notifier.
One of the simple imagine scenario about userspace's intelligence is that
platform can manage tasks as forground and background so it would be
better to reclaim background's task pages for end-user's *responsibility*
although it has frequent referenced pages.
This patch adds new knob "reclaim under proc/<pid>/" so task manager
can reclaim any target process anytime, anywhere. It could give another
method to platform for using memory efficiently.
It can avoid process killing for getting free memory, which was really
terrible experience because I lost my best score of game I had ever
after I switch the phone call while I enjoyed the game.
Reclaim file-backed pages only.
echo file > /proc/PID/reclaim
Reclaim anonymous pages only.
echo anon > /proc/PID/reclaim
Reclaim all pages
echo all > /proc/PID/reclaim
Change-Id: Iabdb7bc2ef3dc4d94e3ea005fbe18f4cd06739ab
Signed-off-by: Minchan Kim <minchan@kernel.org>
Patch-mainline: linux-mm @ 9 May 2013 16:21:24
[vinmenon@codeaurora.org: merge conflict fixes]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
On some systems the firmware may not describe all the ports
connected to a component (e.g, for security reasons). This
could be especially problematic for "funnels" where we could
end up in modifying memory beyond the allocated space for
refcounts.
e.g, for a funnel with input ports listed 0, 3, 5, nr_inport = 3.
However the we could access refcnts[5] while checking for
references, like :
[ 526.110401] ==================================================================
[ 526.117988] BUG: KASAN: slab-out-of-bounds in funnel_enable+0x54/0x1b0
[ 526.124706] Read of size 4 at addr ffffff8135f9549c by task bash/1114
[ 526.131324]
[ 526.132886] CPU: 3 PID: 1114 Comm: bash Tainted: G S 5.4.25 #232
[ 526.140397] Hardware name: Qualcomm Technologies, Inc. SC7180 IDP (DT)
[ 526.147113] Call trace:
[ 526.149653] dump_backtrace+0x0/0x188
[ 526.153431] show_stack+0x20/0x2c
[ 526.156852] dump_stack+0xdc/0x144
[ 526.160370] print_address_description+0x3c/0x494
[ 526.165211] __kasan_report+0x144/0x168
[ 526.169170] kasan_report+0x10/0x18
[ 526.172769] check_memory_region+0x1a4/0x1b4
[ 526.177164] __kasan_check_read+0x18/0x24
[ 526.181292] funnel_enable+0x54/0x1b0
[ 526.185072] coresight_enable_path+0x104/0x198
[ 526.189649] coresight_enable+0x118/0x26c
...
[ 526.237782] Allocated by task 280:
[ 526.241298] __kasan_kmalloc+0xf0/0x1ac
[ 526.245249] kasan_kmalloc+0xc/0x14
[ 526.248849] __kmalloc+0x28c/0x3b4
[ 526.252361] coresight_register+0x88/0x250
[ 526.256587] funnel_probe+0x15c/0x228
[ 526.260365] dynamic_funnel_probe+0x20/0x2c
[ 526.264679] amba_probe+0xbc/0x158
[ 526.268193] really_probe+0x144/0x408
[ 526.271970] driver_probe_device+0x70/0x140
...
[ 526.316810]
[ 526.318364] Freed by task 0:
[ 526.321344] (stack is not available)
[ 526.325024]
[ 526.326580] The buggy address belongs to the object at ffffff8135f95480
[ 526.326580] which belongs to the cache kmalloc-128 of size 128
[ 526.339439] The buggy address is located 28 bytes inside of
[ 526.339439] 128-byte region [ffffff8135f95480, ffffff8135f95500)
[ 526.351399] The buggy address belongs to the page:
[ 526.356342] page:ffffffff04b7e500 refcount:1 mapcount:0 mapping:ffffff814b00c380 index:0x0 compound_mapcount: 0
[ 526.366711] flags: 0x4000000000010200(slab|head)
[ 526.371475] raw: 4000000000010200 ffffffff05034008 ffffffff0501eb08 ffffff814b00c380
[ 526.379435] raw: 0000000000000000 0000000000190019 00000001ffffffff 0000000000000000
[ 526.387393] page dumped because: kasan: bad access detected
[ 526.393128]
[ 526.394681] Memory state around the buggy address:
[ 526.399619] ffffff8135f95380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 526.407046] ffffff8135f95400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 526.414473] >ffffff8135f95480: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 526.421900] ^
[ 526.426029] ffffff8135f95500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 526.433456] ffffff8135f95580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 526.440883] ==================================================================
To keep the code simple, we now track the maximum number of
possible input/output connections to/from this component
@ nr_inport and nr_outport in platform_data, respectively.
Thus the output connections could be sparse and code is
adjusted to skip the unspecified connections.
Change-Id: I467e11aaad00b163b7f0d82357cf9c4bcd970a4c
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Reported-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Tested-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Git-commit: a59f11c764b0f57e99d915a3aaebcb098e8e3b4a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
As part of v4l2_fh_open call at rtc6226 driver
open time memory is allocated via kzalloc() and
the same memory is not released at the time of
rtc6226 driver open failure case.
Remove the open and release v4l2_fh file as
it not required for rtc6226 driver.
Change-Id: I98195b9b0731d5392b82c3d12e393c6ffaad702c
Signed-off-by: himta ram <hram@codeaurora.org>
Propagate following changes from 4.19 to 5.4 for I2C and GSI driver.
'commit 22cec88da571 ("i2c: i2c-qcom-geni: Add lock and unlock tre
support in I2C GSI mode")',
'commit 3adda53e090d ("i2c: i2c-qcom-geni: Enable shared flag in GSI
mode only")',
'commit 6f84a3f8ca30 ("i2c: i2c-qcom-geni: Enhance IPC logging debug
infra in I2C")',
'commit d06ac0169fb7 ("i2c: i2c-qcom-geni: Correct the IEOB/IEOT
sequence for I2C GSI tres")'.
Change-Id: I8ab0b4d580b16041b751f0be3de717d32238a374
Signed-off-by: Vipin Deep Kaur <vkaur@codeaurora.org>
Small BW votes that translate to less than a single BCM unit are
currently truncated to zero. Ensure that non-zero BW requests always
result in at least a vote of 1 to BCM.
Change-Id: I144b22c11d19e29bebd19685b4d1a0e2b14a6abd
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
On certain PMICs like PM8350B, IBB can be configured in single or
dual or auto phase based on the panel configuration. Though dual
or auto phase is mostly used, forced single phase configuration
is needed for some hardware. Add support for it.
Change-Id: Ib7e9957485a45dccbcd0e9dc35e7a370a28ea52a
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
commit 0a1de26d3d ("regulator: qpnp-amoled: Add set_load()
callback for IBB regulator") added set_load() in IBB regulator to
configure phase control. However, load current threshold is set
to 30 A instead of 30 mA. Fix it. Also, when load current is set
to 0, switch to auto dual phase as per hardware recommendation.
While at it, fix the indentation for related macro definitions.
Change-Id: I513b2436874b47f0856423eac8a6786651d1f8ba
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
While switching from HW to SW control mode, HW may be busy updating
internal required signals. Add a check that polls for PWR_ON status
bit to ensure that the GDSC switches to SW mode before software starts
to use SW mode.
Change-Id: Ie6bd5c5e8c073fb70c696eeb6e911219108f9260
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
Add missing export symbol for wdog trigger available API.
Change-Id: Ib9fa8de3c8fa906bc8d09073e1df5509aa0c55e2
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Secondary VM resources are accessible only after it is booted.
Change-Id: I589c191f0724106208e35705e50a3c3a66df5f8f
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
The coresight driver is freeing up d_req as part of notify
from write_complete. Accessing write_done form qdss_close,
wait_for_completion will be stuck there causing watchdog
bark.
Fix this by making f_qdss independent of coresight driver
from initializing complete. Initialization of completion
now occurs from alloc_req.
Change-Id: Ie6b1cd445ed6bb38c1a555f6c4c41068090e4fac
Signed-off-by: Udipto Goswami <ugoswami@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Removing the APIs related to ctrl_read since those are
not used by any client of f_qdss.
Change-Id: Idf7f1ffd8afe8a72f83e036a7986d35f2f71bea8
Signed-off-by: Udipto Goswami <ugoswami@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
When qdss_close is called we try to dequeue the pending and started
requests and then free those requests. But when async completion is
enabled the completion callback could be called after freeing up
that request which may lead to list corruption. Handle this by
ensuring that the requests are freed only after the completion
callback is done for all the requests.
Change-Id: I3e5b1bad06f281422a71c84a617feb65027c2c84
Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
When qdss_close is called the pending requests sent to the
controller are not stopped and as a result the completion
call back can occur at any time. If the qdss bridge driver
frees the requests before the completion callback may result
in use after free. Call dequeue on the pending requests in
qdss close so that the requests are terminated instantly.
Change-Id: I2752a598e8b104a6803064343743f591adc924e4
Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Currently, ucsi_qti_notify() is checking the received data from
charger firmware (PPM) to see if there is any connector status
response with partner accessory information (e.g. analog audio).
It does this based on setting a flag (cmd_requested_flags) when
UCSI_GET_CONNECTOR_STATUS command is sent from UCSI framework to
PPM so that the response for that command can be read and clients
registered for getting notification on partner accessory can get
notified. However, in a certain scenario, multiple response for
different commands can be received from PPM. See a possible
example below.
1. UCSI framework sends UCSI_GET_CONNECTOR_STATUS command
2. ucsi_glink driver sets cmd_requested_flags, waits for response
3. UCSI framework sends UCSI_GET_CURRENT_CAM command
4. ucsi_glink driver gets a response for UCSI_GET_CONNECTOR_STATUS
and schedules notify_work since ucsi_qti_notify() is called
with cmd_requested_flags set.
5. ucsi_glink driver gets a response for UCSI_GET_CURRENT_CAM and
this can end up reading "flags" because cmd_requested_flags is
not cleared yet. However, this causes a buffer overflow because
ucsi_qti_read() passes "val" pointer passed from UCSI framework
which is of 1 byte length and ucsi_qti_notify() ends up reading
"flags" which is at an offset 2 of length 9 bytes.
6. ucsi_qti_notify_work() clears cmd_requested_flags.
Fix this by checking the message length in ucsi_qti_notify()
to ensure that status->flags is read only when a response is
received for UCSI_GET_CONNECTOR_STATUS. Also, relocate the
clearing of "cmd_requested_flags" flag.
CRs-Fixed: 2678391
Change-Id: Iac1d5c58e1ed2fd0f3bc153da23cddf0700cc097
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Presently, clients must re-register to receive IRQ lend notification.
Every client presently must do this and there is no use-case to require
clients to re-register to receive IRQ lend notification. Return the
internal IRQ lend state to WAIT_LEND after release, instead of
unregistered.
Change-Id: I17504e2850ae60e68d755b587ff6d0c3e78926d9
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Presently, hh_irq_wait_for_lend translates supplied vm_name to vmid.
However, if this function is called prior to RM populating this table,
then wait_for_lend call fails with -EINVAL. Translating vm_name to vmid
in wait_for_lend is unnecessary, and only done because it was convenient
in private data structure. Thus, add vm_name to the private data
structure and translate vm_names upon receiving a lend notification.
Change-Id: Iaa51aaab42508ffa121a550afa0568a048327dca
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Incorrect unit of BW vote was used by CVP driver when voting
for DDR bandwidth. Fix the issue in this change.
Change-Id: I916f54750fa6b9858a02a50a851cf83e2e06c8b1
Signed-off-by: George Shen <sqiao@codeaurora.org>
CVP driver can handle DSP2CPU command and CPU2DSP command
at same time.
Change-Id: I2b609896aadd22554e44fb5ecb4a613b70d96903
Signed-off-by: George Shen <sqiao@codeaurora.org>
This change is for general scheduler improvements.
Change-Id: I8e0a1d29ec170f6b628d63e685600da80c1aca8a
Signed-off-by: Amir Vajid <avajid@codeaurora.org>