Commit Graph

155 Commits

Author SHA1 Message Date
Sarada Prasanna Garnayak 51b754d741 wcnss: fix the potential memory leak and heap overflow
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>
2017-04-26 02:30:10 -07:00
Anand Kumar 275df0b1bc wcnss: Avoid user buffer overloading for write cal data
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>
2016-07-27 00:55:32 -07:00
Padma, Santhosh Kumar f4ce5a5e1d wcnss: Expose dump stack functionality
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>
2015-12-16 01:24:43 -08:00
Anand N Sunkad b7c2015390 ARM: dts: msm: configure pc disable latency for 8976
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>
2015-11-30 22:14:38 -08:00
Anand N Sunkad ed22dd035d wcnss: Add NULL check before accessing pronto register
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>
2015-08-25 00:31:59 -07:00
Anand N Sunkad 6319fba82b wcnss:Avoid sending FIQ to pronto subsystem
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>
2015-08-14 05:22:28 -07:00
Anand N Sunkad d0e2624e63 wcnss: Enable Qos Ref clock for 8916/8939
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>
2015-06-30 21:47:54 -07:00
Hardik Kantilal Patel d37039c6f4 wcnss: Add VBATT support for MSM8952
- 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>
2015-06-16 04:09:29 -07:00
Linux Build Service Account cd175a7929 Merge "ARM: dts: msm: Enable wlan indication LED" 2015-06-13 04:47:35 -07:00
Shimrit Malichi 2d065cf7ef wcnss: Add support to WLAN indication LED
Turn on/off WLAN indication LED when WLAN service is
on/off respectively.

Change-Id: I5d11720a892b8914c758eec9c798e2bd93c233ef
Signed-off-by: Shimrit Malichi <smalichi@codeaurora.org>
2015-06-08 16:27:26 +03:00
Anand N Sunkad b8e668df5d wcnss: Add wrapper functions for init work functionalities
WLAN prop driver cannot access INIT_WORK and INIT_DELAYED_WORK API's.
To mitigate issue add wrapper functions in platform driver for
INIT_WORK and INIT_DELAYED_WORK kernel APIs.

CRs-Fixed: 847627
Change-Id: Ife3c4d2abe0109fdfa0c908a3ca619cbf8b666ee
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
2015-06-03 20:33:19 +05:30
Linux Build Service Account 25af3f00aa Merge "wcnss: Read Voltage and current for regulators from dtsi file" 2015-05-27 00:29:20 -07:00
Anand N Sunkad ebf327d67a wcnss: Read Voltage and current for regulators from dtsi file
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>
2015-05-25 10:42:36 +05:30
Siddharth Bhal 8324ac7411 wcnss: updating driver to use wcnss_reset_fiq api
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>
2015-05-21 15:42:09 +05:30
Linux Build Service Account d7e84922ef Merge "Revert "wcnss: dump PMU and SAW registers for pronto"" 2015-05-12 06:46:37 -07:00
Linux Build Service Account 2ab3c8dc78 Merge "wcnss: Ensure wcnss clocks are present before register dump" 2015-05-11 14:57:32 -07:00
Siddharth Bhal aed909d418 wcnss: Ensure wcnss clocks are present before register dump
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>
2015-05-11 14:09:38 +05:30
Hardik Kantilal Patel 364030aa39 wcnss: Avoid crash during shutdown in SSR
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>
2015-05-07 05:44:41 -07:00
Siddharth Bhal 987eee0909 Revert "wcnss: dump PMU and SAW registers for pronto"
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>
2015-05-07 11:49:41 +05:30
Linux Build Service Account f979712bbb Merge "wcnss: Add wrapper functions for work queue functionalities" 2015-04-08 22:12:17 -07:00
Anand N Sunkad cb552fae43 wcnss: Add wrapper functions for work queue functionalities
WLAN prop driver cannot access following functions directly.
To mitigate issue add wrapper functions in platform driver for
cancel_work_sync and cancel_delayed_work_sync kernel APIs.

CRs-Fixed: 804860
Change-Id: I990b3abd1fd678802e0728c882c18f83582a4075
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
2015-04-07 09:59:31 +05:30
Hardik Kantilal Patel 5150dcaf1c wcnss: Add condition to check for pronto ver4 hardware
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>
2015-03-22 21:46:57 -07:00
Linux Build Service Account 71e1033d0c Merge "wcnss: handle CBC complete event from firmware" 2015-02-23 19:07:11 -08:00
Siddharth Bhal 8eeb47383c wcnss: handle CBC complete event from firmware
Add case to handle cold boot calibration complete
event from firmware.

Change-Id: I3d3dce178fadd7f993ee31667c89bcebb02c388c
CRs-Fixed: 796303
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
2015-02-20 13:09:35 +05:30
Hardik Kantilal Patel 73cea1b336 wcnss: Add support to read the Battery voltage
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>
2015-02-19 00:30:18 -08:00
Hardik Kantilal Patel 4996e711ef wcnss: Avoid writing zero to PMU config register
Avoid writing zero to PMU config register while
taking MUX control.

Change-Id: Ib05cd43a8d3bc4df27e27fef9e1539834d72e77a
CRs-Fixed: 794268
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
2015-02-13 18:02:44 +05:30
Anand N Sunkad c4f95cd76a wcnss: add NULL check before accessing pnv pointer
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>
2015-02-05 16:36:56 +05:30
Siddharth Bhal fb8a287fc8 wcnss: avoid removing pm_qos request when already removed
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>
2015-01-26 20:47:55 -08:00
Anand N Sunkad 45d8b708e7 wcnss: add proper macro value check to avoid unnecessary delay
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>
2015-01-12 14:56:17 +05:30
Anand N Sunkad ca991bcdb6 wcnss: get MUX control before dumping IRIS register
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>
2015-01-09 20:05:47 +05:30
Anand N Sunkad dde5fcd287 wcnss: logging enhancement with IRIS register dump at Wdog bite
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>
2014-12-17 11:17:28 +05:30
Anand N Sunkad 69ce1115de wcnss: send GPIO strength parameter to firmware
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>
2014-12-03 02:04:30 -08:00
Linux Build Service Account f6cefed159 Merge "wcnss: dump PMU and SAW registers for pronto" 2014-11-13 18:56:48 -08:00
Siddharth Bhal b9260881d1 wcnss: dump PMU and SAW registers for pronto
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>
2014-11-13 14:30:03 +05:30
Anand N Sunkad 75145de910 Revert "wcnss: handle CBC complete event from firmware"
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>
2014-10-28 15:42:54 +05:30
Linux Build Service Account 474f32dd23 Merge "wcnss: add condition to check for pronto ver3 hardware" 2014-10-14 08:49:45 -07:00
Linux Build Service Account a2b0137487 Merge "wcnss: handle CBC complete event from firmware" 2014-10-14 03:47:14 -07:00
Siddharth Bhal 2ed06d5246 wcnss: add condition to check for pronto ver3 hardware
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>
2014-10-13 13:55:56 +05:30
Anand N Sunkad 7db9a1a9f7 wcnss: handle CBC complete event from firmware
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>
2014-10-12 11:16:47 +05:30
Anand N Sunkad 679fc88a13 wcnss: dump CCU bridge error registers for pronto
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>
2014-10-09 15:04:06 +05:30
Linux Build Service Account 59bc20b467 Merge "wcnss: add pm_qos support to prevent power collapse for BIMC" 2014-09-27 13:36:53 -07:00
Siddharth Bhal 66a8db1340 wcnss: add pm_qos support to prevent power collapse for BIMC
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>
2014-09-27 19:20:15 +05:30
Linux Build Service Account 6e0fcc125d Merge "wcnss: avoid msleep after WCNSS power state check" 2014-09-09 00:54:42 -07:00
Anand N Sunkad 4f9282694a wcnss: avoid msleep after WCNSS power state check
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>
2014-09-03 12:46:46 +05:30
Kaushik, Sushant 2c76d70a39 wlan: Add debug print NV download failure
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>
2014-09-01 16:26:06 +05:30
Linux Build Service Account f4f80f7448 Merge "wcnss: avoid wcnss reset in case of PIL success" 2014-08-30 19:36:56 -07:00
Siddharth Bhal 2411a90e6b wcnss: avoid wcnss reset in case of PIL success
Avoid wcnss reset after successful call to PIL.

Change-Id: Ia905641751df11d1311ca54dd6ed8769ca0679df
CRs-Fixed: 714148
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
2014-08-25 12:43:25 +05:30
Siddharth Bhal 4f6930ebed wcnss: add a2xb bus stall detection logic
Detect A2XB bus stall by profiling Read, Write and Cmd
fifo registers.

Change-Id: I33b45e79c52677ef998011511a6fc3fb76eecc24
Crs-Fixed: 705962
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>
2014-08-22 16:40:58 +05:30
Linux Build Service Account 4975ca4da6 Merge "wcnss: Change WCNSS_VBATT_GUARD value from 200uV to 20mV" 2014-08-15 04:51:39 -07:00
Anand N Sunkad 111a6bd0c2 wcnss: Change WCNSS_VBATT_GUARD value from 200uV to 20mV
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>
2014-08-14 11:23:19 +05:30