On platforms where the power supply for 11AD is external
the wil6210 driver has to vote for the VDD and VDDIO regulators.
This patch adds such voting and guarantees the required
voltage for each regulator.
Change-Id: I472fe6b0600557bc4e623a3dd1b6352fd4a86e27
[merez@codeaurora.org: using regulator_set_load]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Add 11ad as a subsystem (WIGIG) within the subsystem_restart
framework, in order to allow proper support for recovery from
11ad firmware crashes, and support automated collection of
crash dumps for offline analysis and bug reporting.
Change-Id: I7acbe8860e046cdba2ce027f91ed2fa995a70c70
Signed-off-by: Lior David <liord@codeaurora.org>
[merez@codeaurora.org: fixed merge conflicts]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Added a simple interface for platform to perform crash
recovery.
When firmware crashes, wil driver can notify the platform
which can trigger a crash recovery process. During
the process the platform can request a ram dump
from the wil driver as well as control when firmware
recovery will start. This interface allows the platform
to implement a more advanced crash recovery, for
example to reset dependent subsystems in proper order, or
to provide its own notifications during the recovery process.
Change-Id: I2545d220b779c24931b6263249449f37bcad75a4
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: ea3ade75db690dc47c78a77d71dfd7c2df3bb15d
Git-repo: https://github.com/kvalo/ath.git
Signed-off-by: Maya Erez <merez@codeaurora.org>
When network interface is stopping, some resources may
be already released by the network stack, and Rx frames
cause kernel OOPS (observed one is in netfilter code)
Proper solution is to drop packets pending in reorder buffer.
Change-Id: Id043d466135f20fe980814380e6f01e2554c22e3
Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: dea16eddb4753129dbcd8dc8d1a58ff0cc4ea38c
Git-repo: https://github.com/kvalo/ath.git
Signed-off-by: Maya Erez <merez@codeaurora.org>
"iter" is -1 at the end of the loop and not zero. It means we don't
print a warning message.
Change-Id: I532bd54fbdafb92e71205c317ae5d467c4cd5f3b
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: f94c48d6c315a580b60b062c0360561b61faa311
Git-repo: https://github.com/kvalo/ath.git
Signed-off-by: Maya Erez <merez@codeaurora.org>
In __wmi_send we check if fw is ready at the beginning of the function.
While we wait for the completion of the previous command, system suspend
can be invoked and reset the HW, causing __wmi_send to read from HW
registers while it is not ready.
Taking the wmi_mutex in the reset flow when setting the FW ready bit
to zero will prevent the above race condition.
Change-Id: I5d2e823a27beaeaaf5b8b1e25457c158efd3ea46
Signed-off-by: Maya Erez <merez@codeaurora.org>
Some platforms don't support the wigig_en GPIO.
Changing wigig_en to be an optional property allows
removing the redundant setting of this GPIO in platforms
that do not support it.
Change-Id: Iad33d3876c1657cc4cc6b779b11d1c634f58a243
Signed-off-by: Maya Erez <merez@codeaurora.org>
msm root-complex does not maintain parent/child relationship
with PCIe devices. Due to this, suspend operation may be carried
out asynchronously between PCIe device and root-complex.
In cases where 11ad refuses to suspend for any reason, the
root-complex connected to it may get suspended in parallel,
causing inconsistency between root-complex and 11ad device.
Disabling async suspend ensures proper ordering of suspend
between PCIe device and root-complex.
Change-Id: I42749d6af229721dc420b55b91e78bf58923d67f
CRs-Fixed: 933571
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
hostap in Android issues private ioctls in some scenarios,
specifically P2P and WPS.
Currently 11ad driver supports WPS but not P2P, when WPS
is enabled IE related to WPS in P2P is sent through
private ioctl and fails which blocks WPS.
Add handling of this command so that WPS could be
enabled outside of P2P flow.
Change-Id: Id67174ad128b47a6b6244b1fe48b0e535b397247
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Sleep clock may be used by 11ad chip to support
low power modes.
Change-Id: I00c9c5f3d24fa47463f5d0fe4aecc97ab09334b9
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
[merez@codeaurora.org: fixed merge conflicts]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Config space was not properly restored when
resuming from suspend.
Change-Id: I6b9188f3989957eb44c93302d7958d422bb29e81
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Set DOMAIN_ATTR_ATOMIC attribute to SMMU driver so that
it can handle DMA map/unmap operations from atomic context
which is required by 11ad driver
Change-Id: I7e538e6c41e5f40ff01dcfc9cbecf860ded22057
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Delay is required to wait for the PCIe endpoint to become
stable after power on before de-assertion of PERST to
the endpoint by PCIe root complex.
Change-Id: Ib064e936fa0540646e6751d7c3b739c0beb48e60
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Failure of memory allocation for context was
not properly checked. Added proper check against
valid context value in relevant locations.
Change-Id: Ia74ddfb3c54e2781957e695a831c30f1356fed08
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Platform driver used to handle msm specific platform
requirement for 11ad chipset connected to msm platform
Takes care of platform support like:
- power switch through dedicated GPIO
- bus frequency voting
- SMMU attachment
Change-Id: I09c54ea747a5b4e0688b1b7d96e83ef134bb4215
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
[merez@codeaurora.org: fix merge conflicts]
Signed-off-by: Maya Erez <merez@codeaurora.org>
wil6210 11ad driver hook to platform specific
driver so that platform specific operations of msm
are properly executed.
Need to reorder init sequence to run wil_platform_init
before pci_enable_device. Assumption is platform init
may be required before device may be enabled, for example,
to turn on platform power for 11ad chip and run
PCIe enumeration.
platform uninit should be called after
pci_disable_device because platform uninit may render
pci device non-accessible.
Change-Id: Id36d20c2dcbf8704b1c4aec9e962117960c2eefe
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
[merez@codeaurora.org: fixed merge conflicts]
Signed-off-by: Maya Erez <merez@codeaurora.org>
New module (wil_platform) for handling platform specific tasks
Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[merez@codeaurora.org: fixed merge conflicts and change to ARCH_QCOM]
Signed-off-by: Maya Erez <merez@codeaurora.org>
Just temporarily disable aead alg related apis for 4.4 upgrade.
4.4 upstream cryto driver has a lot of changes on aead related APIS
and data structures, and hw crypto driver can not be compiled on 4.4.
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
This snapshot is taken as of msm-3.18 commit e70ad0cd
(Promotion of kernel.lnx.3.18-151201.)
Acked-by: Shabnam Aboughadareh <shabnama@qti.qualcomm.com>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
This reverts commit 8125696991.
The commit"cfg80211/mac80211: disconnect on suspend" forces disconnection
on wlan interfaces if wake on wireless is not enabled from the user space.
Wake on Wireless is enabled by default in wlan driver (CLD) and cfg80211
layer never aware of wake on wirless enabled status done in wlan driver.
To avoid the disconnection while going to suspend and keep wlan driver
in WOW mode by default, the commit "cfg80211/mac80211: disconnect on
suspend" should be reverted.
CRs-Fixed: 540571
Change-Id: I483fe0530f9f00c338680416449215af326e3df1
Signed-off-by: Ganesh Kondabattini <ganeshk@codeaurora.org>
This reverts commit f04c22033c.
The commit "cfg80211: export interface stopping function" exports a new
cfg80211_stop_iface() function, intended for driver internal interface
combination management and channel switching. The new function is used
by commit "cfg80211/mac80211: disconnect on suspend" which is reverted
in order to avoid the disconnection while going to suspend. Hence the
commit "cfg80211: export interface stopping function" should be reverted.
CRs-Fixed: 540571
Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>
AP stopped interface can be used to indicate that the AP mode has
stopped functioning, WLAN driver may have encountered errors that has
forced the driver to stop the AP mode.
When the driver is in P2P-Go mode, and when it goes thru automatic
recovery from firmware crashes, it uses this interface to notify the
userspace that the group has been deleted.
CRs-Fixed: 453060
Change-Id: Ifcd8d4f0c0b26f56a56fb8560aa474297b7521d4
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
When flag WIPHY_FLAG_DFS_OFFLOAD is defined, the driver would handle
all the DFS related operations. Therefore the kernel needs to ignore
the DFS state that it uses to block the userspace calls to the driver
through cfg80211 APIs. Also it should treat the userspace calls to
start radar detection as a no-op.
Change-Id: I9dd2076945581ca67e54dfc96dd3dbc526c6f0a2
CRs-Fixed: 630797
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
[neelanshm@codeaurora.org: Do not include the unrequired
change in util.c]
Signed-off-by: Neelansh Mittal <neelanshm@codeaurora.org>
This commit merges the following commits into one snapshot up to
msm-3.18 commit e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1.
8e465d5 msm: wlan: Update tx power limits of country UA
296bec0 msm: wlan: Update regulatory database for some countries
c0fc361 msm: wlan: Fix the DFS region for Japan
6f1cca3 msm: wlan: Update the wifi regulatory database for TW
2c5867a msm: wlan: Modify JAPAN regulatory rules
e430543 regdb: Update database with 60GHz for Japan
ccce8fb msm: wlan: Correct the parsing of db.txt
acf74a2 cfg80211: add space after the b/w in db.txt
b2b5b4e msm: wlan: update the dfs_region to db.txt
36c64bd msm: wlan: Add country KP
da5d9cb msm: wlan: Update db.txt for regulatory support.
Signed-off-by: Ryan Hsu <ryanhsu@codeaurora.org>
Taking the gratuitous ARP/unsolicited NA detection code from
mwifiex (but fixing it up to not have read-after-skb-end bugs),
implement the ability for userspace to request the behaviour
required by HS2.0 to drop gratuitous ARP and unsolicited NA
frames when proxy ARP service is enabled on the AP. Since this
behaviour is only mandatory for HS2.0 and may not always be
desired, make it optional - modify cfg80211/nl80211 for that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: be9efdecf8ecdcc6d2221845482e7359b33a603b
Git-repo : git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
Change-Id: I1e4083a2327c121073226aa6b75bb6b5b97cec00
CRs-fixed: 621827
[akholaif@codeaurora.org: only picked up the declaration
and definition of cfg80211_is_gratuitous_arp_unsolicited_na()]
Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>
This is to help the hardware configured in world
roaming mode to save power when not connected to
any AP.
CRs-Fixed: 542802
Change-Id: Ia643d0e9848dcd486832973bd6dd186edd7bd4ea
Signed-off-by: Mihir Shete <smihir@codeaurora.org>
Add new flag WIPHY_FLAG_DFS_OFFLOAD to the wiphy structure. When this
flag is defined, the driver would handle all the DFS related operations.
CRs-Fixed: 630797
Change-Id: I592722607788dc4e2167c90bb684071cc9fb6986
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
This is a snapshot of the icnss driver and associated files as of
msm-3.18 commit:
e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1 (Promotion of kernel.lnx.
3.18-151201.)
Signed-off-by: Yue Ma <yuem@codeaurora.org>
This is a snapshot of the cnss driver and associated files as of
msm-3.18 commit:
e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1 (Promotion of kernel.lnx.
3.18-151201.)
Signed-off-by: Yue Ma <yuem@codeaurora.org>
This is a snapshot of the cnss prealloc driver and associated files
as of msm-3.18 commit:
e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1 (Promotion of kernel.lnx.
3.18-151201.)
Signed-off-by: Yue Ma <yuem@codeaurora.org>
This is a snapshot of the wcnss driver and associated files as of
msm-3.18 commit:
e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1 (Promotion of kernel.lnx.
3.18-151201.)
Signed-off-by: Yue Ma <yuem@codeaurora.org>
The TYPE for a PMIC chip is always 0x51. There is no need to define it
for each PMIC chip.
Also the SUBTYPE of a PMIC chip doesn't change with versions. Have a
single definition of the SUBTYPE per PMIC chip.
Also, the driver uses integer indexes to get to the pmic name, instead
use the SUBTYPE to index in the pmic names array.
Change-Id: Ie1c43f3db0d4a395307253aad347ad93624a1203
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
An earlier commit 52a3101ed9b61787a49f3b5c298aa9240f4006dd
added a recursive dependency as part of CONFIG_DEBUG_SPINLOCK
lib/Kconfig.debug:585:error: recursive dependency detected!
lib/Kconfig.debug:585:symbol DEBUG_SPINLOCK_BITE_ON_BUG depends on DEBUG_SPINLOCK_PANIC_ON_BUG
lib/Kconfig.debug:593:symbol DEBUG_SPINLOCK_PANIC_ON_BUG depends on DEBUG_SPINLOCK_BITE_ON_BUG
Fix this by adding a choice menu.
Change-Id: I0e50103397bb71dec7056db5148cba988550b860
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Software running in non secure EL1(on arm64) and non secure
supervisor mode(on arm) should use virtual timer for time
stamping. Migrate users to arch_get_cnt_vct instead of using
arch_get_cnt_pct.
Change-Id: Ic3cf52a2ca3b0a2f83b926df26cecf479080320c
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Enable support for esoc interface layer with external
soc components on the msm debug and perf defconfigs.
Change-Id: I33a4b1f8cdda9a287e6715b23da8b3876abc2ab0
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Enable triggering wdog on kernel panic and enable panic
on data corruption.
Change-Id: I4798ff27ef470225607fdccc15e8fa3a6ebdb1eb
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Disable SPI on msmcortex debug and perf configs
since it fails to compile.
Change-Id: Ia9e4077428a0760f1428b81597503e92402bad2a
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
As per ARM the prefetch for store (prfm pstl1strm) in the arch_spin_trylock
routine can lead to some false positives, decreasing the lock performance.
On the Cortex-A57 / Cortex-A53, if the memory type is Shareable, then any
linefill started by a PST (prefetch for store)/PLDW instruction also causes
the data to be invalidated in other cores, so that the line is ready for
writing. This will also clear the exclusive marker associated with that
cache line (clearing the exclusive monitors).
So, in the scenario where we could have multiple cores trying to acquire
exclusive access to a cacheline, the removal of prefetch would help with
potentially increasing the chances of one of the cores making progress.
Example:
struct {
spinlock_t lock;
atomic_t count;
} x;
We have 2 cores trying to run the below code
spin_lock(&x.lock);
atomic_inc(&x.count);
spin_unlock(&x.lock);
lock and count are part of a struct so they fall into the same cacheline.
The lock function uses the trylock mechanism as part of debug spinlock.
1. Core1 has acquired the spinlock and is performing the ldxr, add, strx
loop in atomic_inc.
2. Core2 are trying to acquire the spinlock.
Core1 | Core2
ldxr | |
| | prfm pstl1strm
add | |
| | ldaxr
stxr (fails) | |
| |
Now, the prfm always clears the exclusive marker for the core1 ldxr,
so the stxr always fails. This prevents core1 from making progress and
releasing the spinlock that core2 is waiting for.
This could potentially go on forever and we end up breaking this pattern
if the timing changes or if an interrupt triggers.
This could happen with more cores trying to acquire the spinlock, cause
more prefetches and make the problem worse.
By removing the prfm, we allow the stxr @core1 to suceed and atomic_inc
completes, allowing core1 to unlock the spinlock and let core2 proceed.
Change-Id: I742ab9b6d98aded628e4dcf4a6ec68b8e2a4ec3e
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
[abhimany: resolve minor merge conflicts]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Currently dump_stack is printed once a spin_bug is detected for rwlock.
So provide an options to trigger a panic or watchdog bite for debugging
rwlock magic corruptions and lockups.
Change-Id: I20807e8eceb8b81635e58701d1f9f9bd36ab5877
[abhimany: replace msm with qcom]
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Currently we cause a BUG_ON once a spin_bug is detected, but
that causes a whole lot of processing and the other CPUs would
have proceeded to perform other actions and the state of the system
is moved by the time we can analyze it.
Provide an option to trigger a watchdog bite instead so that we
can get the traces as close to the issue as possible.
Change-Id: Ic8d692ebd02c6940a3b4e5798463744db20b0026
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Once a spinlock lockup is detected on a CPU, we invoke a Kernel Panic.
During the panic handling, we might see more instances of spinlock
lockup from other CPUs. This causes the dmesg to be cluttered and makes
it cumbersome to detect what exactly happened.
Call spin_bug instead of calling spin_dump directly.
Change-Id: I57857a991345a8dac3cd952463d05129145867a8
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Data corruptions in the kernel often end up in system crashes that
are easier to debug closer to the time of detection. Specifically,
if we do not panic immediately after lock or list corruptions have been
detected, the problem context is lost in the ensuing system mayhem.
Add support for allowing system crash immediately after such corruptions
are detected. The CONFIG option controls the enabling/disabling of the
feature.
Change-Id: I9b2eb62da506a13007acff63e85e9515145909ff
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
[abhimany: minor merge conflict resolution]
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>