Add new scm_is_secure_device() API, so that
all platform drivers can check and take appropriate
action for secure and non-secure devices.
Change-Id: I5569f4aaf4bcbec2922a7745ec0fdc1ab423cc23
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
The following deadlock is observed.
Core 2 waiting on mapping->tree_lock which is taken by core 6
do_raw_spin_lock
raw_spin_lock_irq
atomic_cmpxchg
page_freeze_refs
__remove_mapping
shrink_page_list
shrink_inactive_list
shrink_list
shrink_lruvec
shrink_zone
shrink_zones
do_try_to_free_pages
try_to_free_pages(?, ?, ?, ?)
__perform_reclaim
__alloc_pages_direct_reclaim
__alloc_pages_slowpath
__alloc_pages_nodemask
alloc_kmem_pages_node
alloc_thread_info_node
dup_task_struct
copy_process.part.56
do_fork
sys_clone
el0_svc_naked
Core 6 after taking mapping->tree_lock is waiting on zbud pool lock
which is held by core 5
zbud_alloc
zcache_store_page
__cleancache_put_page
cleancache_put_page
__delete_from_page_cache
spin_unlock_irq
__remove_mapping
shrink_page_list
shrink_inactive_list
shrink_list
shrink_lruvec
shrink_zone
bitmap_zero
__nodes_clear
kswapd_shrink_zone.constprop.58
balance_pgdat
kswapd_try_to_sleep
kswapd
kthread
ret_from_fork
Core 5 after taking zbud pool lock from zbud_free received an IRQ, and
after IRQ exit, softirqs were scheduled and end_page_writeback tried to
lock on mapping->tree_lock which is already held by Core 6. Deadlock.
do_raw_spin_lock
raw_spin_lock_irqsave
test_clear_page_writeba
end_page_writeback
ext4_finish_bio
ext4_end_bio
bio_endio
blk_update_request
end_clone_bio
bio_endio
blk_update_request
blk_update_bidi_request
blk_end_bidi_request
blk_end_request
mmc_blk_cmdq_complete_r
mmc_cmdq_softirq_done
blk_done_softirq
static_key_count
static_key_false
trace_softirq_exit
__do_softirq()
tick_irq_exit
irq_exit()
set_irq_regs
__handle_domain_irq
gic_handle_irq
el1_irq
exception
__list_del_entry
list_del
zbud_free
zcache_load_page
__cleancache_get_page(?
So protect zbud_alloc/free/reclaim with spink_lock_bh
CRs-Fixed: 986783
Change-Id: Ib0605b38e7371c29316ed81e43549a0b9503d531
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Prevent driver from disabling the tear check when
going to LP1 state. This is needed for certain
panels in cases where there are more than one
frame update in LP1 state.
Change-Id: Ib80f06e0609d9d49584118504adf87da44455563
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
TRB Pool is allocated and de-allocated per endpoint when USB endpoint
is enabled and disabled respectively. In some instance, it has been
observed that usb_ep_disable() (for rmnet case, (u_bam.c) it is called
from set_alt or resume context i.e. interrupt context) and usb_ep_queue()
(for rmnet case, (u_bam.c) it is called from work queue context) are
racing for USB endless endpoint when USB bus suspend and resume is
happening quickly. It is causing NULL pointer dereference while accessing
TRB pool. Fix this issue by moving check if USB endpoint is enable or not
after acquiring dwc3->lock and before calling __dwc3_msm_ep_queue() which
prepares endless TRB.
CRs-Fixed: 986071
Change-Id: I842f6a82f3c454111ba68661cf835e86022e3e18
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
The uapi directory shouldn't contain compat definitions,
so move this file out of there.
Change-Id: Ieef35ec02157c253a137c1b1bce3c6518c7f1b31
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Currently for PMI8996, IBB_SPARE_CTL is configured to slower PFET turn off
while exiting out of TTW mode. As per the hardware documentation, this
setting needs to be modified to faster PFET turn off for both PMI8996,
PMI8994 and PMI8950. Modify it to improve IBB efficiency.
CRs-Fixed: 966167
Change-Id: I0693eb275eeab5c349b455da31a96ba6dbeb4cf9
Signed-off-by: Harry Yang <harryy@codeaurora.org>
As per the hardware documentation, update the following register
configurations in AMOLED mode.
IBB_NONOVERLAP_TIME_1
IBB_NONOVERLAP_TIME_2
IBB_SPARE_CTL
This is to improve the IBB efficiency.
CRs-Fixed: 966167
Change-Id: I127a2b895bfce4afcdac1ad6aba051347d621cbe
Signed-off-by: Harry Yang <harryy@codeaurora.org>
The transport "smd_trans" is required if far end is running SMD
instead of Glink. If far end is already running Glink, this property
is ignored in Glink layer and communication will be through Glink.
CRs-fixed: 986398
Change-Id: I76b59a9782ab77e1ee3b37afb1db6ec01340ea33
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
Commit 0717dcb898a085f863f65252d1ceec4e026e1183 ("uapi:
msm: mdp: Add color space in mdp_input_layer") adds
the csc params member on input layer but does not
pass the same configuration to sspp pipes. Post
Processing module will select the default CSC table
without this configuration.
The CSC configuration on MDSS hardware is not double
buffered. This needs additional input layer validation
check against CSC reconfiguration on staged pipes.
Change-Id: I3e6ea00fc426501cbbbeffa4545ed9cff711dcb4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
When underlying channel fails to send the APR buffer to the remote
end, APR should put the Tx buffer back into queue to avoid memory
leak.
CRs-fixed: 979283
Change-Id: I4f94daa3c9be748a30d532cf9cc8f3aa2284c060
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
There's a possible null pointer deference if APR open fails.
Add the fix to handle error case cleanup gracefully.
CRs-fixed: 979283
Change-Id: I4c0cc05bf08d2eae5c27a1dba0a33f4183f81cf3
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
Retention modes for testing only. The actual modes supported
would be a subset of these modes
CRS-fixed:975790
Change-Id: Ida27125d337f2a15ac152f49a14bdde254d3e535
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
'start' and 'stop' in the snapshot ringbuffer header are supposed to
be the dword offset that the data starts and stops at respectively.
For the current ringbuffer which is parsed 'start' and 'stop' are
equal to the CP wptr but all other ringbuffers are just dumped from
start to finish so 'start' and stop' should be 0 and KGSL_RB_DWORDS.
And having said that, why are we bothering to make the current
ringbuffer special anyway? In every case we are dumping the entire
ringbuffer so we might as well dump it in order. While messing about
in this code go a few more steps to make sure that we don't dump the
same ringbuffer more than once.
Change-Id: Ic0dedbada33adda660b7f0bf5eb165b0aa159004
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
HPS/DPS sequencer type is configured statically for PROD EPs
according to ipa3_ep_mapping table. This change adds the ability
to set a different HPS/DPS sequencer configuration for PRODs,
which mainly be used in testing
CRs-Fixed: 986167
Change-Id: I47dec10e757694596385f5118486603c702fe302
Signed-off-by: Nadine Toledano <nadinet@codeaurora.org>
Add a l2pc-cpu-mask-latency in device tree. This latency
is used in kgsl_pwrctrl_update_l2pc() API to avoid L2PC
on masked CPUs by giving reduced latency value.
Change-Id: I0447977bce5ed5c09a863b03bb42b9428686a9f5
Signed-off-by: Divya Ponnusamy <pdivya@codeaurora.org>
When disabling agregation on Q6 pipes during SSR
there is a possibility that index -1 is used. Make
a change to skip processing if ep index is not valid.
Change-Id: I7578e582d1eda0b181225af9d00ec8ad5fbe372d
Acked-by: Chaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
frame buffer allocated in recovery mode is not mapped for MDP3 pan display
control path resulting in IOMMU fault. Add mdss_smmu_map_dma_buf call in
mdp3_ctrl_pan_display and use mapped virtual address for DMA.
Change-Id: I4d37ccb86eaea4690862bef76ee3762ff952892a
Signed-off-by: Sachin Bhayare <sachin.bhayare@codeaurora.org>
This patch updates the stale pointer corrupted at
specific ssid ranges.
This patch also addresses wrong range tools value
updation.
CRs-Fixed: 980487
Change-Id: I2b8afcef25dceb76118b803c67f4c5656feae82b
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Deadlock is observed in zcache reclaim paths due to
different locking sequence.
Core#0: Core#1:
|spin_bug() |do_raw_write_lock()
|do_raw_spin_lock() |_raw_write_lock_irqsave()
|_raw_spin_lock_irqsave() |zcache_rbnode_isolate()
|zcache_flush_inode() |zcache_load_delete_zaddr()
|__cleancache_invalidate_inode() |zcache_evict_zpage()
|truncate_inode_pages_range() |zbud_reclaim_page()
|truncate_inode_pages() |zcache_scan()
|truncate_inode_pages_final() |shrink_slab_node()
|ext4_evict_inode() |shrink_slab()
|evict() |try_to_free_pages()
|dispose_list() |__alloc_pages_nodemask()
|prune_icache_sb() |alloc_kmem_pages_node()
|super_cache_scan() |copy_process.part.52()
|shrink_slab_node() |do_fork()
|shrink_slab() |sys_clone()
|kswapd_shrink_zone.constprop |el0_svc()
|balance_pgdat()
|kswapd()
|kthread()
|ret_from_fork()
The deadlock happens because alternate sequence are
followed while taking
zpool->rb_lock (protects zpool rb tree), and
rbnode->ra_lock (protects radix tree maintained by rbtree node)
Fix the sequence of locks being taken to avoid deadlock.
Change-Id: I32db23268f63eb8eb5aee30e4462c190e2e02f48
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Recommended value for A306a VBIF out registers is 0x10.
Change-Id: I5ea3f4203b7649007fa62bdfe70a41c8d86432ef
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
As violations were observed at streamOn followed
by SOF freeze when testgen is enabled after camif,
changes are made to enable testgen before camif.
CRs-Fixed: 982807
Change-Id: Ib7c3adb1f23fd6ae763383fda152ac63e4e00f74
Signed-off-by: Meera Gande <mgande@codeaurora.org>
Update IPA node to map the correct IPA clock.
This is done to avoid IPA clock gating on AP suspend.
Change-Id: Ic10949cd9e1eefffac6d744157e9f2a7df63ba5d
CRs-Fixed: 985868
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Characterization has shown that the initial VDD_APCC CPR revision
0 voltage margin adjustment for MinSVS is too aggressive. Raise
this adjustment by 40 mV to ensure stability on all parts.
Change-Id: I084e43f4805359c0381c730b26eb85764bd225b1
CRs-Fixed: 985850
Signed-off-by: David Collins <collinsd@codeaurora.org>
Secure memory will have 's' flag set in its flag fields.
This is needed to track secure memory of a process.
CRs-Fixed: 985767
Change-Id: I011dcc951b1db8adf763f85701aa869f6d4744d3
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
The global interrupt status register needs to be read in first
before being used/printed.
Change-Id: Ic8068c775b82a0802d0bd3236b4eeafe56b571f9
Signed-off-by: Tony Truong <truong@codeaurora.org>
Configure AGGR_SW_EOF_ACTIVE for WAN_CONS pipe in order to
allow modem to close aggregation on this pipe.
This is needed in order for modem to ensure
a QMAP command packet always resides in the end of aggregated frame.
Change-Id: I7412f1f0af8d2109853e311de815a1f1ec3220e3
CRs-Fixed: 979484
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Subsystem device add support for subsystem restart
recovery and ramdump device for cnss firmware dump
collection before the subsystem restart.
Refactor subsystem restart wrapper APIs to avoid the name
space collision in cnss platform driver compilation in dual
WiFi mode.
CRs-Fixed: 983677
Change-Id: Ib4a8d1a6d0ce8f1faa43ce0aa8312823b1ca3c15
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
PM QoS adds support to improve the wlan throughput.
The cnss platform driver export PM QoS API to wlan
host driver.
Refactor PM QoS wrapper APIs to avoid the name space
collision in cnss platform driver compilation in dual WiFi
mode.
CRs-Fixed: 983653
Change-Id: Id7a486f2f111476e73d5707eba36611a3530e9cf
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
Store WiFi DFS NOL list and return to wlan host driver
on query. It adds support for no link operation on radar
detection.
This export symbol supported by both SDIO and PCIe platform
driver. So add this API as a common API for both SDIO and PCIe
interface based wlan module and remove the duplicate API from
the SDIO and PCIe platform driver.
CRs-Fixed: 983618
Change-Id: Idc25806de6f919b88130a1633adbb7bc1048ecd5
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
Store WiFi unsafe Channel list and return to wlan host
driver on query. It adds support WiFi unsafe Channel list
for LTE-WiFi coexistence.
This export symbol supported by both SDIO and PCIe platform
driver. So add this API as a common API for both SDIO and PCIe
interface based wlan module and remove the duplicate API from
the SDIO and PCIe platform driver.
CRs-Fixed: 983607
Change-Id: I1698df3fb689ef17294e00032adde5ae635e76de
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
Currently the qmap control pkts are sent back to AP
from modem because of exception. The fix is
to use pkt_init to skip filtering/natting on IPA-HW to
reach modem instead. Also there is a requirement for
AP-side to send back qmap flow control acks immediately
after receiving the requets. The code change is to make
2st level high-watermark for those qmap control pkts to
not be dropped. Also rmnet_ipa driver won't stop queue
if the current pkt is qmap control pkt even when
outstanding pkts above the first level of
high-watermark.
Change-Id: I3074e4a37d74c491593e109c1df0c99da85a5e57
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Pointer map returned from dev_get_name may be null.
Add null check before derefering.
CRs-Fixed: 985337
Change-Id: I952ae63e9b909dde763b3024d90fe4553e852860
Signed-off-by: Meng Wang <mwang@codeaurora.org>
DSI software does not wait for MDP_DONE ISR
before sending new frame if burst mode feature is
enabled. It leads to race condition in below case
* MDP kicks off frame-N and mdp_busy sets to true
* MDP receives new frame-N+1 and waits for
PP_DONE interrupt before sending N+1 frame.
* MDP receives PP_DONE interrupt and kicks off
frame-N+1 (DSI_MDP_DONE interrupt is not received yet).
* Frame-N+1 kickoff sets the mdp_busy wait to true.
* DSI receives DSI_MDP_DONE interrupt for frame-N and
reset the mdp_busy to false.
* Any clock off call can turn off the clock at this moment.
DSI software must always execute busy_wait when kickoff
happens from mdp. That avoids the busy wait race condition.
Change-Id: I462cd5ad21d6ccc08dfb862e98fd6fafeef686d4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Allow the kgsl-event workqueue to run on any available
core. The other workqueues in KGSL were already unbound.
CRs-Fixed: 985082
Change-Id: I7e843b57541b7ddcb53848078f73b05c88238711
Signed-off-by: Jonathan Wicks <jwicks@codeaurora.org>
The video subcore RCGs should be force enabled during rate
scaling to workaround video firmware potentially disabling
the branch clock at the same time on msm8996.
CRs-Fixed: 971305
Change-Id: Ib0223ee33040c365d8a00bb796c44395102754f5
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Firmware running on HW blocks could be powering down the branch
clock or the RCG whilst software is doing frequency changes. If
this happens, the RCG behavior is undefined and may cause issues
with its functioning.
To work around this, use the RCG root_en bit and force turn it on
while scaling the rate. In addition, make the polling timeouts
configurable.
CRs-Fixed: 971305
Change-Id: If2db14c70614c47d673fc735f5f4bac276d4a3d9
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Force ISENSE calibration to stop before starting new calibration.
CRs-Fixed: 973565
Change-Id: I86dcbaa7feaecd630a027c5aca41d62a5855efda
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
There are high chances for hrtimer_interrupt() interrupt on
one of the core and other core executing sys_reboot simultaneously.
In such a situation we could see ipi_cpu_stop() marking a cpu
as 'offline' but hrtimer_wakeup() can schedule a task on
offline core, resulting BUG_ON in smp_send_reschedule().
In fact that the CPU is not really offline but ipi_cpu_stop()
is marking it as offline.
CPU0 CPU1 CPU2
sys_reboot()
kernel_restart()
machine_restart()
machine_shutdown()
smp_send_stop() ...
... ipi_cpu_stop() hrtimer_interrupt()
set_cpu_online(1, false) __run_hrtimer()
local_irq_disable() hrtimer_wakeup()
while(1) try_to_wake_up()
ttwu_do_wakeup()
check_preempt_curr()
smp_send_reschedule()
BUG_ON(cpu_is_offline(1));
This is easily reproducible in device continuous reboot testing.
Since the CPU is not really offline and hasn't gone through the
proper steps to be marked as such, let's mark the CPU as inactive.
Change-Id: Ia1daea407220578d4212ef6c65c4be837ca370fd
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
zbud_alloc if returns free object from pool must also
initialize it to 0 when asked to do so. The same is
already taken care if a fresh object is allocated.
CRs-fixed: 979234
Change-Id: Id171edf131df321385fcdcd7660d06da97689e3e
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
When sending holb monitoring command to uc there is a
possibility that IPA clock is off which can result in
unclocked access. Make change to enable IPA clock before
sending holb monitoring command to uc.
Change-Id: Ia8e7564372d4b4ec9f3ad35927e0d403d0695753
Acked-by: Chaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
The FD hardware needs to be reset everytime after halt
is called. Adding the reset sequence.
CRs-fixed: 961394
Change-Id: I129de341e619d8c8f6faa69d43c9d13ba21dd88f
Signed-off-by: Ashwini Rao <ashwinik@codeaurora.org>
Adapt CPP driver to SOC layer by replacing the msm specific
routines with SOC API which eases the portability of cpp driver
on to non-msm platforms.
Change-Id: I8cd6bdcaa9d310b770f2dfe66047c64316a309de
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
Some of the camera modules need to get the clock rate
back after rounded to a new value, Hence change the
msm_camera_clk_set_rate API to return the rounded
clock rate after setting it.
Change-Id: Ie3ed17ad6658e51448a769fd141aef63ff0c79fe
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
On MSMCOBALT, while enabling the gpu_gx_gdsc, the DEMET cells
need to be explicitly reset by using the domain_addr register.
CRs-Fixed: 922984
Change-Id: I794005ac976eff01e5ffff93e4a60970b15f5f05
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
On MSMCOBALT, while enabling the gpu_gx_gdsc, the DEMET cells
need to be explicitly reset by using the domain_addr register.
Add support in the gdsc driver to do this.
CRs-Fixed: 922984
Change-Id: I145a581a50719427b7303720a48cd421e2e1ef45
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
We need to skip checking for link state being in U3
when we receive a Function Suspend. Pass in this information
to GSI EP OP that checks if we are good to suspend channels
with IPA. We skip the check for U3 if we are handling Function
Suspend and check for U3 when we are handling Bus Suspend.
CRs-Fixed: 966352
Change-Id: I29ee0326edbe33b02884495ddc89484bef21e7e0
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>