The wcnss platform driver update the wlan calibration data
by the user space wlan daemon. The wlan user space daemon store
the updated wlan calibration data reported by wlan firmware in
user space and write it back to the wcnss platform calibration
data buffer for the calibration data download and update.
During the wlan calibration data store and retrieve operation
there are some potential race condition which leads to memory leak
and buffer overflow during the context switch.
Fix the above issue by adding protection code and avoid usage of
global pointer during the device file read and write operation.
CRs-Fixed: 2015858
Change-Id: Ib5b57eb86dcb4e6ed799b5222d06396eaabfaad3
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
compare size of allocated cal data buffer from heap
and count bytes provided to write by user to avoid
heap overflow for write cal data.
Change-Id: Id70c3230f761385489e5e94c613f4519239dfb1f
CRs-Fixed: 1032174
Signed-off-by: Anand Kumar <anandkumar@codeaurora.org>
Add changes to expose dump stack functionality which can be used
by driver to dump stack information when it requires.
CRs-Fixed: 943322
Change-Id: I0fde7142dea2c18daf6b1fb0c5ee4bb8a31a6be0
Signed-off-by: Padma, Santhosh Kumar <skpadma@codeaurora.org>
Configure PC disable latency value for 8976 target when pm_qos
request to disable power collapse for DDR during SSR and coldboot.
CRs-Fixed: 914674
Change-Id: I65a2ca8b4a94a337195e8c4e8e4743e38f57197e
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Avoid accessing of pronto register base address if wcnss
platform driver is not triggered by wlan.
CRs-Fixed: 891378
Change-Id: Idcad44bffcb4315c5d97db510f58592b4913e6ab
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Avoid sending FIQ to pronto subsystem during
power up sequence.
CRs-Fixed: 888411
Change-Id: Ia9c14d32bfcba93bb704d07f284cb3c618de8fbf
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Add support to enable Qos Ref Clock for Qos Box support.
CRs-Fixed: 860487
Change-Id: I46cd3fc809807050efb4f38372dce3d854141bcf
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
- Add ADC entry for wcnss which is use to listen low vbatt
notification from ADC.
- Prevent sending vbatt notification to FW incase of ADC
channel not present.
CRs-Fixed: 855069
Change-Id: If53a2d2089f292cbd87418d0a451bd11a0c95322
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
Turn on/off WLAN indication LED when WLAN service is
on/off respectively.
Change-Id: I5d11720a892b8914c758eec9c798e2bd93c233ef
Signed-off-by: Shimrit Malichi <smalichi@codeaurora.org>
Defining Voltage and current values for IRIS and pronto regulators
in static structure, is keep on increasing as a new target introduce.
To make it more dynamically, reading Current and Voltage values for
IRIS and pronto regulators from dtsi file.
CRs-Fixed: 841574
Change-Id: I3882aa9d78b267da68bdbd7e4f893f263eb48687
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Updating wcnss platform driver to use safer api wcnss_reset_fiq
instead of older api wcnss_reset_intr and removing the deprecated
api.
Change-Id: Ica6d91e6b62e03d83afddd521e78bf90e000ced7
CRs-Fixed: 841553
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
Adding wcnss 'measure' and 'debug' clock checks before dumping
wcnss pronto registers. This is required to ensure that registers
are dumped only when required clocks are present, otherwise it
could lead to undefined behavior.
CRs-Fixed: 815208
Change-Id: Iaa920b7f9ad02ef0a4e9e1537f2cd5de8be60b63
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
Wlan driver should not read registers from wcnss or
try to communicate with the chip when it is undergoing
a subsystem-restart. this flag will be used by the wlan
driver to protect register access and other prohibited
operations.
CRs-Fixed: 834133
Change-Id: I638ee9e6cbc25da77ca931191718cec3a7aa87d6
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
Remove dump of SAW2 registers in case of wcnss abort to
avoid kernel panic.
This reverts commit b9260881d1.
Change-Id: I5f4e0f6b07049db2055ec8aaa5290324a4406fb2
CRs-Fixed: 833996
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
Add support to check for pronto ver4 hardware is present
by reading a device tree entry.
CRs-Fixed: 810392
Change-Id: Ia0ac79047015bf078bc9a52470dd8fd1a2ba33b9
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
Get Battery voltage from vadc at boot time. If Battery voltage
is less then 3.5V then configure VDD_PA with 3.0V instead of
3.3V. Send indication of current battery voltage to WCNSS FW.
Change-Id: I5470f218c8e136ed12d9aa0b9892a9b53ea6d9f4
CRs-Fixed: 794209
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
Direct accessing of pnv pointer leads for NULL dereference.
To mitigate issue add NULL check before useing a pnv pointer.
Change-Id: I99f96db6a715ad17414572a47ecda1fd55ecceb8
CRs-Fixed: 790447
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Race condition is observed when removing pm_qos request to
avoid power collapse of BIMC.
Using Mutex lock to ensure proper synchronization in removing
pm_qos request and not remove request when already removed.
CRs-Fixed: 766358
Change-Id: I8976fec9d6f145e213a827894bb58aee23155971
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
wcnss_service is sends value zero to platform driver, to indicate cal data
is not present, but platform driver checking received value with macro
value -1, because of improper macro value check unnecessary delay is added.
To mitigate issue add proper macro value check and avoid the
unnecessary delay.
Change-Id: I8ff55c7e95c8b556063928d22940a16bee60e931
CRs-Fixed: 779421
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Sometimes dumping IRIS register along with PRONTO register
results in crash.
To mitigate issue get MUX control before dumping IRIS register.
Change-Id: Ie1e19a254ec1ae43c2713c86c4d35a2d9968bcd6
CRs-Fixed: 777663
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Dump IRIS register during Wdog bite and sending FIQ to confirm
if XO enable command was ever received or not.
Add debug log when SMD msg header is unavialable completely.
Change-Id: I0a6b2c4d3db5c12e340e08c4572bde91f94d0189
CRs-Fixed: 769672
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
To dynamically configure GPIO strength in firmware
send GPIO strength parameter as a part of power manager
indication to firmware.
Change-Id: Id840e63cce4a4e696185960afa9f416524d2eec3
CRs-Fixed: 765151
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Dump PMU and SAW registers in case of wcnss abort to know
status of watchdog and power collapse state during abort.
Change-Id: If19dc391c824d7c5f616c48d7e2723d1104ebf21
CRs-Fixed: 746668
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
This reverts commit 7db9a1a9f7.
Above commit depends on firmware code changes, As new code
changes that would be introduced removes this dependency,
hence reverting this commit.
Change-Id: I86479d05f98e48949a140e30efae4e311e1cbf00
CRs-Fixed: 744296
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Add support to check for pronto ver3 hardware is present
by reading a device tree entry
Change-Id: I01cd71ac6c00b6c1e4c5ea46b3f3c0b57a0dbd95
CRs-Fixed: 737209
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
Add case to handle cold boot calibration complete
event from firmware.
Change-Id: I3d3dce178fadd7f993ee31667c89bcebb02c388b
CRs-Fixed: 734932
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Dump CCU bridge error registers in case of wcnss abort.
Change-Id: Idc23da043e215a6ba687977cf2c72d42c276d228
CRs-Fixed: 735607
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Add pm_qos support to prevent power collapse of BIMC during
SSR and coldboot. Wakelock is also taken to prevent power
collapse of BIMC
CRs-Fixed: 727070
Change-Id: Ida638e85995735b629ad455dd48df996b37c2305
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
Move msleep() call to before WCNSS power check to avoid
WCNSS power state change during the 50 msec sleep.
Change-Id: I5adcaf82395dea2454f3059fb09363e4a5e106ae
CRs-Fixed: 717927
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
Added a debug print for the return type in case
of NV downlaod failed.
CRs-Fixed: 717777
Change-Id: I3287089cad83d37641c71da9829ef4e89d7aeca0
Signed-off-by: Kaushik, Sushant <skaushik@codeaurora.org>
To avoid ADC_TM interrupts at 3.5V battery threshold
Change WCNSS_VBATT_GUARD value from 200uV to 20mV.
Change-Id: Ib033f1c4e5b44101a867638942ff9cadd0cbc0df
CRs-Fixed: 705609
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>