The close and close ack commands sent over the wire in the control channel
have reserved fields, which are left uninitialized. This leads to an
unintentional information leak.
Zero initialize these reserved fields before sending the commands over the
wire to plug the leak.
Change-Id: I533a1bd2a7946a17e76806f6c589ea00a993c6e9
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Three pages of log history in insufficent to capture the complete history
of some issues which hampers analysis. Increase the number of log pages to
fifteen to provide ample history for debugging issues.
Change-Id: I04e04f9dca84907995e200501dea9ab4a882f720
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Add initial set of device tree and board files to build
the mdmfermium target.
Change-Id: I9a0e90ea4e815f1fbbcd2a2ba1c5ab98f4a1c614
Signed-off-by: Venkatesh Yadav Abbarapu <vabbar@codeaurora.org>
When the first core of a cluster is brought out of reset, the
corresponding l2 is powered on and enabled for low power modes.
Where a core is being brought out of reset and its l2 is already
in power collapse, the l2 is brought out of power collapse and then
the core is brought out of reset. This allows the l2 to re-enter
power collapse before the core is brought out of reset. Prevent
all l2 low power modes until the core is brought out of reset.
Once the core is out of reset re-enable l2 low power modes.
Change-Id: I6fa6e7610a889884f0eeccaac388229bcee8065c
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Add SOC information like Chip ID, macros and dummy
socinfo definitions for msm8956.
Change-Id: Ica7c6d8c56b439a105a68d3931ee2c5ba96f527d
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Implementations may require the dumping of certain
critical sections of memory during a subsystem restart.
These should be relatively small sections that would
contain enough information for initial triage and
problem classification. Subsystems currently store
such additional information in SMEM; therefore dump
out SMEM memory when a subsystem crashes, if the
new enable_mini_ramdumps flag is set.
Change-Id: I38ea75c9275ad91d9319029c5b265895c70bf4b8
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
The smem driver relies on the SUBSYS_SOC_RESET notification
to call the API to collect the SMEM ramdump. Add a delay of
100msec on returning from the notification as a temporary
workaround as the ramdump userspace application is returning
pre-maturely before calling sync() and fclose().
Change-Id: I74f420dfb080ea50907b5a58090adeb3d3f7cdd5
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
It is useful to retrieve small memory areas from a device
when performing a subsystem restart. For example, shared
memory may contain logging information that can help
triage a problem. Implementations may choose to dump such
memory sections when the enable_mini_ramdumps flag is set.
Change-Id: I217ceed0a5d1ba3130757428b5f48cba4d1203ad
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
A module parameter modem_dbg_cfg is added to write the value to
QDSP6SS_DBG_CFG register for debugging purposes.
Change-Id: I899ddf5a6144377fb23998c9e8dadd3452f3cc62
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Turn on the necessary voltage rail for SPM before turning on the L2
cache for the CPU.
Change-Id: I8c6bfe26593584fc24e8f3864b94b08df55f3702
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
In some cases local clients transmit the data without GLINK_TX_REQ_INTENT
flag and fails if remote client not queued the matching rx_intent.
Add callback support to notify the local clients when remote client queue
an RX intent so that the client can track the remote intents.
CRs-Fixed: 847641
Change-Id: I649a054324ae7ed758a849345f41e3e26137f1f1
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Add support to request RPM to turn on/off DCC SW trigger.
This request can be used to enable/disable DDR training data verification
before DDR frequency switch.
After receiving enable request RPM assumes that DCC is configured in CRC
mode to verify DDR training data. Hence it starts to send SW trigger to
DCC to run CRC on configured data before DDR frequency switch.
Change-Id: I491bc3e41e11a5366162c65907f41f7cbcdd7809
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Add support for gladiator cache interconnect error
detection and reporting. The Gladiator is the cache
coherent interconnect in between two or more CPU
clusters. This driver helps detect the errors related to
snoop data transfer and Distributed Virtual Memory(DVM)
on READ/WRITE transactions.
Change-Id: Ic1aa2066df239672a8ed3d99a63318ed32a11af2
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Add support for enter/exit cycle sysfs nodes for io detection
There are some usecases which may benefit from different enter/exit
cycle load criteria for IO load. This change adds support for
that.
Change-Id: Iff135ed11b92becc374ace4578e0efc212d2b731
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
Add support for multi_enter_cycles/multi_exit_cycles per cluster
There are some usecases which may benefit from different enter/exit
cycle load criteria for multimode cpu load. This change adds support for
that.
Change-Id: I3408405307ca03b9bba3f03e216ef59b98f29832
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
Certain governors may stop sending out notifications once CPUs enter
idle at min frequency.If governor's notifications stop then single mode
will not exit for long time. It can happen only if the exit conditions are
set in such a way that the time taken to exit single mode exceeds the time
for the governor to ramp down, idle out and hence stop sending
notifications leaving the system in single mode indefinitely.
This change adds seperate enter/exit cycle sysfs nodes along with a per
cluster non-deferrable timer for single mode exit. The timer is armed only
when the load starts falling below the exit load threshold and is
cancelled when either the load starts going up or SINGLE mode is exited
due to exceeding exit cycle count. On expiry the timer resets SINGLE mode
and the enter/exit cycle counts.
Change-Id: I02dd3fa8af39ca320e80da6391eb2b1ea635a433
Signed-off-by: Tapas Kumar Kundu <tkundu@codeaurora.org>
table (of type msm_dump_table) is virtual address for app's base
table of memdump, which is converted to physical address and
holds it in the memdump.table_phys. This memory is not intended
to be freed. When kmemleak scans, it can't deduce that the reference
we are holding is via physical address and not virtual address.
Hence, kmemleak will treat this as a leak as it can't find
a reference to this variable. Supress this by using kmemleak_not_leak.
Change-Id: I5236c940688829a3b5f255c5ee9fcf309cf8ebb7
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Handle de-asserting CLAMP_QMC_MEM bit before enabling the memories,
as per the HPG.
Change-Id: Icac8f0ef4fd28b57ab5c42e5558dbc18c890f483
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
cpu_data & cpu_buf are virtual addresses,which are
converted to their physical addresses by using
virt_to_phys() API. Then this is added to the mem dump
apps data table by calling msm_dump_table_register().
This memory is not intended to be freed. When kmemleak
scans, it can't deduce that the reference we are
holding is via physical address and not virtual address.
Hence, kmemleak will treat this as a leak as it can't
find a reference to this variable. Supress this by
using kmemleak_not_leak.
Change-Id: I4ee30c87a29d66f34a5c8a6c18f2ebc59760e981
Signed-off-by: Kishan Kumar <kishank@codeaurora.org>
When the first core of a cluster is brought out of reset, the
corresponding l2 is powered on and enabled for low power modes.
Where a core is being brought out of reset and its l2 is already
in power collapse, the l2 is brought out of power collapse and then
the core is brought out of reset. This allows the l2 to re-enter
power collapse before the core is brought out of reset. Prevent
all l2 low power modes until the core is brought out of reset.
Once the core is out of reset re-enable l2 low power modes.
Change-Id: I5f47b6c5a309edad9c0864b3623b6ea6d3eff7d7
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
Add support to configure the performance cluster cpu retention
ldo voltage. This value needs to be configured when a core is
coldbooted. The core will then be able to enter retention at
the programmed retention voltage.
Change-Id: Idf46c31edfb2be7ce364070baea5550048301a14
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
Add support to load the modem debug policy firmware during
modem boot. This debug policy will be consumed by modem once
it's powered up.
Change-Id: I319d71a74bd27347e445d13519cb71e6c7843e76
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
It might not always be ideal for the SSR framework to trigger a
graceful shutdown on behalf of the subsystem driver. Add the
"qcom,pil-force-shutdown" property to subsystem dt entries to
indicate this exception for the subsystem.
Change-Id: Ia382750ee9b6befe9940a1aca0bf1c7404e1e3fe
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Export the ION memory alloc and free functions so that
other drivers can use these APIs.
Change-Id: I4f1beb51d59f14585c00873626ee79b8627832b7
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Upon initialization, SMEM scans the partition table to extract
information for any partitions that APSS is part of and the partition
information is stored for debug purposes. If the APSS processor is not
part of the edge, then it is skipped and no information about the
partition is logged.
Log non-APSS partition information to assist in system triage.
Change-Id: I1609bb6c6f4f22637b7a709c4c09df783a45fa96
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
correct the msmid of 8976 to the recommended value.
Change-Id: Id25dcf48f88c71c7bf9add4ef5f89ca8162b656f
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Packets received under the dynamic mtu feature do not have a valid payload
size in the header, so the correct size is computed based on data from
SPS. This computation is incorrect, which results in the client
processing extra data in the scenario where their protocol requires the
packet to be dropped.
Correct the payload length handling for this scenario.
CRs-Fixed: 830835
Change-Id: I37e2d1bfe390657b9cdc2fcd530762d3daf97036
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
In CRC mode DCC can perform CRC on configuration data or system memory
after receiving SW or HW trigger.
Change-Id: Iab0a6ffa92ef6e311054756cfe85d1b2b91743c9
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Fix bug due to use of uninitialized 'prev_off' variable.
Change-Id: I773f64209b395eb9f2fc82a53d4a2f1b79b081eb
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
DCC (Data Capture and Compare) is a DMA engine which is used to save
configuration data or system memory contents during catastrophic failure
or SW trigger.
It also can perform CRC over the same configuration or memory space.
Change-Id: Ic8a804250ab8b7ac501bd186d2e6f7506bb9b21a
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
Allocate memory to dump VSENSE registers at the time of crash.
Change-Id: Ibd896873bc40b723071c66ca7cf1a4bc9b38ad5e
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
One failure path in glink_tx() does not log a failure message and the
loopback server does not log the return code which causes ambiguity when
triaging logs.
Add logging of missing error path and the return code.
Change-Id: I2ef27c4d71f00c19600b2e2f53f1655f87bbfb18
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
The intent request completion variable is re-initialized after returning
from the prior wait. The redundant re-initialization of that completion
variable causes the receive intent event to be missed when that event
happens just before the wait.
Remove the redundant re-initialization of intent request completion
variable.
Change-Id: I3a7851ae5837496824898b827f490f27eb0e3afa
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Glink_pkt driver clients have to call the new IOCTL to queue an intent
to receive the data from remote side.
To ensure compatibility with smd_pkt clients add auto-intent queuing
in the read() call when glink_pkt client fails to queue an intent.
Change-Id: Iee8fca114f47921788c19d40247a768038985daa
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Initial boot sequence has changed for L2 and performance cluster
cores. Update the sequence to reflect hardware needs on msm8976.
Change-Id: I86831ebba58979ddf6d6a02517146c7126b036bd
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
The memory allocated from the general cma heap cannot be remapped
using ioremap. This problem was encountered on msm8909 when trying
to dump the venus memory.
Hence, handle the ramdump_read mapping using dma_remap/dma_unremap
instead of ioremap_nocache/iounmap.
Change-Id: Ia161851578c2e27f9364cf7c229bc5fd40e43d24
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
QMI indication messages are delivered to the client along with the QMI
header. This leads to QMI message decode failure.
Pass the QMI indication messages excluding the QMI header to the client.
Change-Id: I988dbf99038a647e1572a18e79d2d455b55f7bde
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Currently xpu violation is happening as the allocated piece of
memory is being accessed from the apps. Change the attribute to
DMA_ATTR_NO_KERNEL_MAPPING so that apps cannot access the
allocated piece of memory.
Change-Id: Icbda155c3d9ea28570e7d17240ee23f8f12061a9
CRs-Fixed: 825907
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Bam_dmux sometimes calls sps_connect() during time sensitive operations.
Sps_connect() internally has some memory allocations which may stall
during low memory conditions and can cause a timeout in bam_dmux.
SPS supports a configuration flag which changes these memory allocations
to hold memory.
Use this flag to prevent allocations from stalling and
leading to timeouts.
Change-Id: I506d5664e07baf56f4caa10d1868b1795a4439d9
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Bam_dmux sometimes calls sps_connect() during time sensitive operations.
Sps_connect() internally has some memory allocations which may stall
during low memory conditions and can cause a timeout in bam_dmux.
SPS supports a configuration flag which changes these memory allocations
to atomic. Use this flag to prevent allocations from stalling and
leading to timeouts.
Additional flag added is resulting in error instead of timeout.
Reverting change Icde45f7b08a4b4a2b664c40d088fd338b48ac8fa as the issue
is not solved. Commit id d2393c2628.
Change-Id: I0e33168fb328be540a22ee214d81ea181c1beaa3
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
The UL_TIMOUT_DELAY of 1sec is very high in CDRX usecase where
the Modem and the network agree that no data will be exchanged for
a set amount of time. In this case A2 want to power collapse early
which is done by UL unvote from BAM DMUX.
Add a flag to reduce the UL_TIMEOUT_DELAY for early UL unvote from
BAM DMUX to allow A2 early power collapse.
CRs-Fixed: 826107
Change-Id: Iea99d59f0eadf2f385c66e3280a194be38c6d003
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
The kernel text region may be xpu protected. Disable xpus before modifing
assembly code.
Change-Id: Ide2d8d788a28b0f6db007f87a4cb76daa1ad2f7f
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
The cpaccess driver writes to the kernel text section during normal
operation. Add an API to disable any protection of this region by the
scm-mpu driver.
Protection is not reenabled after cpaccess operations since this is
expected to be an uncommon usecase.
Change-Id: I83caa906b94f4a522a203c1170f1d913681fc704
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
The default behavior for xpus is to zero out the protected region when
it is unlocked. Pass a flag to the scm call to leave the memory region
unchanged.
Change-Id: Ib714d6db93bed2940006f8c0196b59da3fbd3161
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
The core currently just returns an error code if an intent is queued on
an intentless transport.
Instead, track the intent in the core, but do not notify the remote side
about it (as the transport cannot support it).
Change-Id: I6a88a3473c6e4f237cfc01631782c01d4f75009f
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
Remove the mdmferrum changes as they are not applicable
anymore.
Change-Id: Ifbe0a3a1b8e17dcf414f9412c343835cedef0f62
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Fix the memory leak in common_log_register_log_buf() function
when registering log_first_idx with the memory with dump v2 driver.
Also use kmemleak_not_leak when msm_dump_data_register() calls
are successful to ensure that kmemleak doesn't report it as a memory
leak.
CRs-Fixed: 832905
Change-Id: I36eaeebf821f64dd7503ec823aca3c7aec846bd0
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Add C1 FSM control settings based on the low power mode
selected.
Change-Id: I36a4614220de042feccd2862077c290fe46a0fd8
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
If modem loading fails during pil_boot, the allocated mba region
is freed. But the region is still in locked state as the MBA does not
know about the modem loading failure. This leads to XPU violation,
when the locked mba region is accessed by other modules.
Hence, before freeing the MBA region, notify the MBA about the failure
so that MBA can remove memory protection.
Change-Id: Ib3489504f2aa49dc886ea9a5f2eae3da57fcf7d4
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
There is a memory leak in the error path when modem metadata
authentication fails. Free the MBA region to fix this.
Change-Id: I3b33af58bba6532c7714070a62dce1dd99c63601
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
The size variable reading from userspace in IOCTL call
is using architecture specific data type size_t which
depends on 32-bit or 64-bit platform.
Remove the platform dependence code by using generic data type
uint32_t for the size variable.
Change-Id: I462c8e136403694354b4f85636625d9e1a6da1b4
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
The smem transport debugfs initialization expects the transport
to be already registered with glink to avoid creation of required
directory structure twice. Interrupt information is also not present
in the current debugfs entry.
Fix the debugfs entry by initializing it after the smem transport gets
registered with glink core. The interrupt information is also updated.
Change-Id: I93e7326fedc85dfc8bbce5bf886e17ba4fc4e478
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
The TZ subsystem now supports SMP2P communication, so add the necessary
support to allow the apps subsystem to talk to the TZ subsystem.
Change-Id: I09512a9af6f5f8da486156c7e063fd1155ece402
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
The mock processor ID in SMP2P is currently one greater than the last
actual processor ID. If a new processor is added, this requires updating
the mock processor ID as well, which requires updating the DT files for
all targets.
Update the mock processor ID to 16, which leaves room to add several new
processors.
Change-Id: I2ea82c38f5e100ddb3229b90380ddd1769cdbeb9
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
The helper functions to get transport state and channel state name
use wrong array in array size function.
Fix the array size check by using correct array.
Change-Id: Ie725355df0f42b31e49373abf89fbaf38072b7a1
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
As the memory allocated for rx_work_info structure is not zeroed
out, the tracer_pkt flag may take any garbage value leading to
loopback test failure for non-tracer packets.
Fix the loopback test failure by initializing the allocated memory
for the specified structure to zero.
Change-Id: I388018c5853ca2c67dbc2a99fed5075b8224454f
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
The remote SSR ack unit test currently uses the subsystem name
associated with the interrupt config, which may not be the correct name
to use with the subsystem_restart() API.
Introduce a table containing the possible names of each subsystem, and
modify the unit test to try each name with the subsystem_restart() API
until the correct name is found. If none of the names in the table work,
print an error message indicating this issue.
Change-Id: I0dc2f65a67f44ca67de48d6eb28e58fa7a666be5
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
This change fixes the compilation errors seen when DEBUG_FS is disabled.
Change-Id: I009c1192533c9fc40c7a84eb4fecc3b0859fec59
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
SMD transitional transport plugin uses different signal bits compare
to the normal TIOCM signals to indicate the DTR, CTS, CD and RI bits.
Map the SMD transitional signal into TIOCM_X format so that user space
glink clients can depend only on TIOCM signals.
Change-Id: I864fbe1b8a28f22182e7b645747c57dd95549940
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
With the official announcement of 8976, remove all references to its
internal code name, and replace them with 8976.
Change-Id: I6d507418e5259908addedf2975e391200b4e0c83
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Add the MSM SoC ID information for supporting
the APQ8052 target.
Change-Id: Id23033e1897b61ed288eac1bac2ab12eda6c4783
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
In kernel 32-mode, SID address being 33bit is truncated.
To address this issue, update audio drivers to fetch
SMMU SID info from audio ion driver and fill the upper 32 bits
accordingly for 32-bit mode.
Change-Id: Ie2fa573def36d7b346d6a96249239ef1ecc7f8e0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
The SMD driver currently does not listen for SLPI SSR events.
Update the driver to listen for SLPI SSR events by adding an element for
SLPI in the driver's restart notifiers list.
Change-Id: I7ffc3f822e615d0e52a36965398033e21c98c634
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
The SMEM driver currently does not listen for SLPI SSR events.
Update the driver to listen for SLPI SSR events by adding an element for
SLPI in the driver's restart notifiers list.
Change-Id: I7a3be62638e52ea75fc5783d298d233bd6117ab1
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
The local and remote signal get APIs are using INT return type
to return both negative error codes and unsigned INT value as
signal causes problem if the most significant bit set in signal field.
Use extra parameter to pass the unsigned signal value to the caller
and return 0 for success and negative error code for failure.
Change-Id: I3f4f3c0a5551af3094c24e5d6463f14298c9ffe7
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
As new level based voting is introduced for CX/MX, add the support to take
input from DT for min/max levels.
Change-Id: Icf7aeb8029d141fe1e5f187f2e75aeb04f06c1b7
Signed-off-by: Taniya Das <tdas@codeaurora.org>
TIOCMGET ioctl is returning the local signal of the channel and
user space client has no option to get the remote signals.
Send the remote signals of the channel in TIOCMGET ioctl.
Change-Id: I3525c2b1aeadd2206d5a2437fe29ccd7961845a3
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
The present code allows apr_register call to proceed
for invalid destination id. Return immediately if
detination is invalid.
Change-Id: I61085bce1f895a91ef0097b9152ffce486de2272
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
The current debugfs directory structure has channel directory under
a directory named with the corresponding subsystem. This results in
wrong channel information in case of channel migration scenario as
same channel name can exist on different transports on the same
subsystems.
Modify the directory name to have subsystem_transport format to avoid
the issue.
Change-Id: I600bfce5b693c5ae1bcb6ae07a2b5608a5107da6
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
The transport and edge name is passed to next function without
validation. This may lead to invalid dereferencing in case the
name is NULL.
Check both of them for NULL before passing on to the next function.
Change-Id: I6f4c5e5011902fa70ecbaa16842d5100347d55d3
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
The glink transport entry in debugfs have version and features
data in wrong order.
Fix the entry by swapping the version with features.
Change-Id: Icfea327fc551561f2870708c11d20ea58d48f06d
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
If the local feature set does not match with the remote feature set, G-Link
Core negotiates the feature set with the local transport. But it does not
cache the feature set negotiated by the local transport. This results in an
infinited feature negotiation loop.
Cache the negotiated local feature set in the transport context.
Change-Id: I2068fb4437031bf55738ccc49d05c0c0a82f3771
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Update G-Link to support tracer packet to profile the performance of
G-Link and its transports.
Change-Id: I18266f339cd7a12d1ee31507dd8043f9adce7706
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
There is a race condition between channel deletion from list and freeing
the channel context pointer by decrementing the reference count. The
channel can be closed between list deletion and decrementing the
reference count in ch_close_ack.
Fix the race condition by doing list deletion and reference count
decrement at one place.
Change-Id: I94df0feb4145405c99a84dc38d81fe5e4cb3e3ed
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
Add a new device tree property "qcom,qdsp6v56-1-8," to support a new
qdsp6 1.8 version. Add the corresponding steps to enable memories of
the new version.
Change-Id: I6658e5fedcfa0569222cc2c9acdd1df51999b90f
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Driver name apr is conflicting from the SMD driver, causing fake probe
calls to apr driver, changing the driver name from apr to adsp_audio.
Differentiate the pinctrl names for the 2 different gpio sets for
different configuration.
Change-Id: Ic6e1af3d26663575e63098f3b8d0f48e073b9dc6
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
The start addresses for different L2 low power modes could
be different between HLOSes. So HLOS cannot rely on secure
world to correctly program the L2 SPM.
Program L2 spm start address in HLOS and allow secure world
to configure only spm enable bit.
Change-Id: I3ae5d7a1574808a7fc33ab7d62294592fdc1fdf8
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
In the glink_ssr client's close function, the subsystem information
structure is obtained using the get_info_for_edge() function. This
function returns NULL if no subsystem information structure is found for
the requested edge. The close function does not check whether NULL was
returned, which could lead to a perceived NULL pointer dereference.
However, this is not possible since the edge info is configured from the
device tree before the channel is opened and should always be valid.
Add check to ensure that the design assumption that get_info_for_edge()
is valid is still true.
Change-Id: If88cbc1419669fa240667ae92ce2e78e49ad970c
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
When processing an open command, the smem native transport allocates some
memory to store the name of the channel, which gets passed up to the core.
The core makes a copy of the name, so the memory can be freed once the call
to the core returns. The transport does not free this memory, leading to a
leak.
Free the memory allocated for the channel name after calling into the core
to plug the leak.
Change-Id: Ia789c06a7f7104c4e1f145996dc006d07d292752
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
In error case the glink_open() API returns different error codes
in pointers and assigning these error code pointer to the handle
will fail NULL check conditions.
Initialize the handle pointer to NULL when glink_open() fails.
Change-Id: I2ea24005c127da4ff5d8aabbeaac9944d061c518
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
mmap() implementation requires the page align address to map
but the glink rx buffers are not always page align so mmap() API
is not working correctly.
Remove the mmap() API implementation.
Change-Id: Ic01e938a665e08b3004bb8e86b05b92195c7d6f5
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Kernel QMI interface is not reading the remove client command
posted to control ports and hence not releasing the port specific
wake lock acquired by the IPCROUTER.
Read the remove client command to release the wake lock held by
IPCROUTER.
CRs-Fixed: 815051
Change-Id: I77a6c40d59d84887b9df83c646dcf79174b0a68a
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
The maximum Q6 frequency row value is now one less than previous
due to a redundant row in the table.
Change-Id: I4dd6bdc4fdd2630a64a06c092553d3681777dd6b
Acked-by: Jennifer L. Zenner <jzenner@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
SMP2P interrupt is masked to avoid waking up the remote core on
modifying the sleep state bit, but the remote side cannot always
poll for the awake status.
Trigger the SMP2P interrupt to notify the remote core about item update.
Change-Id: I898695558e25d2c0a753f0811a5ea5f30e5deedf
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
A Glink client requires that the poll processing be atomic and cannot
tolerate a context switch. Change the poll() implementation so that packet
processing is done on the calling context.
Change-Id: I0d429691a7dd01ebc1ddf2357e6115984f6043cc
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Add support in G-Link Loopback Server to open the control channel towards
sensors processor.
CRs-Fixed: 805925
Change-Id: Ie0266f51199b1a8ccf1b18aee6bead2c3c7c93b8
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
L2 and core initialization sequences on msmterbium are different
from existing targets, so add the new sequences.
Change-Id: I9660d4cc7d6b8c39b2fbdb2d360bb221205aac68
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
The glink_ssr driver currently attempts to open a new glink_ssr channel for
every link_up notification it receives. Since each subsystem information
structure only stores one channel handle, this can cause communication
failures when more than one link_up notification is received for the same
edge.
Once an edge's glink_ssr channel is opened successfully, unregister from
receiving link-up notifications on that edge. When the channel is closed,
re-register for notifications on that edge. This ensures that only one
glink_ssr channel is opened for each link-up notification.
Change-Id: I45dd649e1b003e0398e07b478eece10d0d5271b8
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
In ssr/unregister_transport scenario, remote disconnect is faked
to all clients and the channels are moved to a dummy transport
to be closed in future. The dummy transport is deleted once all
the channels on it are fully closed. This may lead to a race
condition where the dummy transport can be deleted while some
channels are still being moved to it.
Fix the race condition by first moving the channels to dummy
transport together and fake remote disconnect to the clients
one by one so that dummy transport will be deleted only
after all the channels are closed.
Change-Id: I0a8e78e562594751b2984f4df4d6030c5abb5d41
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
Use memcpy_toio() to write 64-bit address to imem instead of
writel_relaxed which is causing truncation as its a 32-bit api.
Change-Id: I0c0922e1eeff72bacb788bd70e6381e9c1dcf7fd
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
Some legacy SMD clients still use the deprecated streaming channel type,
but are looking to migrate to Glink. To facilitate this, add support for
correctly handling streaming type SMD channels.
Change-Id: I3371fc9d2d94d99cdc3e5a58cccf507ee1dbd985
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
The glink_queue_rx_intent API accepts a void * as one of its parameters
for use by the client. The client can choose to use this parameter as an
opaque value, which is then returned to the client when the intent is
consumed. It should be valid to allow the client to specify NULL for this
parameter, indicating that the client does not require this facility. The
implementation of the glink_queue_rx_intent API does not allow NULL to be
specified.
Fix the glink_queue_rx_intent API to allow the client to specify a NULL
private pointer, which is a valid usecase.
Change-Id: I09eb32b727999e6d66404148a40ecde2f895fa7e
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Glink packet driver create the device node with same name as
the channel name which creates dependence for clients on channel name.
Decouple the channel and device name to allow clients to write generic
drivers using same device node by removing the dependence on transport
channel names.
Change-Id: I60ef9dbd14b442a9bc05d73f8489c43b79a35b85
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Virtual mpm enable, detect and detectcl3 and status writes are 3
words off the actual field position. Fix the calculation.
Change-Id: I7df1124023266eb1c09d0f40e3653f7bf9a4951a
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Signed-off-by: Anil Kumar Mamidala <amami@codeaurora.org>
The disconnect and reconnect bam events access the hardware which may not
be permitted during subsystem restart due to the risk of a stalled access.
Put an explicit sync event between SSR and the disconnect/reconnect events
to eliminate any risk of hardware accesses which are not permitted.
CRs-Fixed: 771505
Change-Id: I206c1cf6f18955320aa20c1dac56eb2173675c4c
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Clients can now query for the maximum size allowed for
themselves. Depending on the maximum allowed size for the
client, each of them can send allocation request accordingly.
Change-Id: Iee337ee617b935c04cbb8956fcc51c90d000506b
Signed-off-by: Katish Paran <kparan@codeaurora.org>
For some MSM targets stream ID of ADSP SMMU used for
Audio IO buffers needs to be appended to IOVA addresses
before the address is shared with ADSP. Add a mechanism
to pass the Stream ID information from devicetree and
append to the buffer addresses in the Audio ION driver.
Change-Id: Id243dfb1dff89f044222206a49088b091a70a362
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
The existing channel clean up process wait till all clients
invoke close to finish the link_down process. This may lead
to undesired delay for ssr/unregister transport case.
Fix the channel clean up by deleting the channel context in
glink_close after faking a close_ack.
Change-Id: Id25e591fba504939bc7cdeaebc22cd70c8943bdd
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>
When configuring Q2S the corresponding SPM needs to be disabled.
If the SPM is enabled, the SPM may end up getting triggered while
the q2s is being configured.
Also relocate the Q2S register initialization to avoid initializing
the register twice for the online cpus.
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Change-Id: If8857e05c403e9bd4cca3fd008761bd48319b8f3
After every register write, read the same register to confirm
that the write has complete. Also, remove any memory barriers,
that are redundant due to the register read.
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
Change-Id: I4d310d6b9d99bf5781fe36894d2275e1a23c501a
RPM Master stats now supports additional info such as time stamps
for last entered and last exited from XO and total accumulated time
spent in XO shutdown. Add support to get and print this info when
rpm master stats is queried.
Change-Id: I06a0fd42e0c1dfaa9e41e02ca3cccafca62a501d
Signed-off-by: Karthik Parsha <kparsha@codeaurora.org>
If msm_performance module and some other module with the
core hotplug capability (like core_ctl) co-exist and
both of them try to hotplug the cores system inconsistencies
can occur. To avoid such behavior sysfs nodes needed for hotplug
support in msm_performance module are compiled out.
Change-Id: I25e8404ce0581e718d6b55cd0e1f5c7da8e92db5
Signed-off-by: Prachee Ramsinghani <pracheer@codeaurora.org>
The mutex protecting the in_ssr flag in the edge information structure is
locked and unlocked in places where this flag is already protected by an
RCU, and in functions which may be called in atomic context.
Remove these uses of the mutex. Protection of the flag is maintained by the
RCU in these cases.
Change-Id: I2be88be0b42fd403437ff53d9d6acd7f1c3f4fa1
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
The interrupt state (whether the interrupt is enabled or disabled) is not
stored in the edge information strucutre in the SMEM native transport. This
state could be useful for debugging and should be stored.
Modify the edge information structure to store the current interrupt state,
and modify the transport to update this state when it changes.
Change-Id: I7726bfbfb94e8a7d94ae1d1d7c608079348930e9
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
The interrupt state (whether the interrupt is enabled or disabled) is
not stored in the edge information structure in the SMD transitional
transport. This state could be useful for debugging and should be
stored.
Modify the edge information structure to store the current interrupt
state, and modify the transport to update this state when it changes.
Change-Id: I549a21364f2754a1af819b53cf00dd272855ce6d
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
APR services can be implemented on the adsp block which may be present
on modem/lpass depending on the msm architecture.
This change will enable the apr driver to read from device tree,
the hardware block on which APR services are implemented and expose them
to other modules
Change-Id: I967c29a6c60df600b0b5c9e0de58a5491c31a478
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Currently QMI interface registers a platform driver to know about
service arrival/exit events. This causes problem for the clients
who registers their callback in probe function.
Fix the service event notification by creating a control port to
receive specific service events.
Change-Id: Ife889ac76a98e93dc7f23296c86e646b181f3b35
Signed-off-by: Atish Kumar Patra <apatra@codeaurora.org>