| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sequence for both rddm and fw download are initialized to be 0.
They are incremented by 1 in bhi_probe() and upon real transfer
takes place.
Issue is in SSR case, sequence is incrementing in a way like 1,
3, 5 and etc as observed. The increment in bhi_probe() seems
unnecessay as there's no real transfer.
Fix is to initialize sequence to 1 and increment by 1 when real
transfer takes place in bhi_bhie_transfer().
Change-Id: I210840cd1f7fecc300ecb69da8a50fbb1d200562
Signed-off-by: Jia Ding <jiad@codeaurora.org>
CRs-Fixed: 2147433
|
| |
|
|
|
|
|
|
|
|
| |
To prevent un-initialized address returning from MHI
state transition lookup table, move mhi_states_transition_str
array out of stack
CRs-Fixed: 2111049
Change-Id: Ife5f907a711cc0c615161f2b2a677275d6773686
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Few functions have variables which might get used with out
proper initialization. Initialize variables to default values.
CRs-Fixed: 2087109
Change-Id: I7645940e8d466e0ef67a5b8b7702b18b160cc10f
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
It's possible for POR to fail and endpoint not enter correct reset
state. Add a timeout when waiting for MHI state BHI transition event
during firmware download.
CRs-Fixed: 2062442
Change-Id: I6af16ec1a514d50b9e984e3fb16696d23e605ba0
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
Add support for bus master to trigger PCIe device into ram dump
mode to collect device ram dump. RDDM capabilities are extended to
support under kernel panic as well.
CRs-Fixed: 2055981
Change-Id: I18f7d5784992df70aafc6e41d248ced3fac37181
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
PCIe linkdown event can trigger anytime. During linkdown event
abort any work MHI host doing that require PCIE link.
CRs-Fixed: 2055975
Change-Id: Idba907c7977594dc08575e0020a7afa4868bc0e4
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
msleep is not accurate for small delays. Use usleep_range
for accuracy.
CRs-Fixed: 1117121
Change-Id: I9a076f843875bd83a21c96d4e4ea0510e82ce352
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
In order to bind devices with variable PCIe device IDs with same device
tree node, make PCIe device ID optional parameter in device tree node.
If PCIe device ID not specified in device tree, any device can be bind
with the node.
CRs-Fixed: 2040899
Change-Id: Iaedcb40db15fa0e8c5c30eb147c904a10cd7569d
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Not all endpoints support all channels supported by MHI host. Only allow
clients to register if requested channel is supported by endpoint.
CRs-Fixed: 2053250
Change-Id: Ib4bd8d21b8f43d693da30b8fafe2cb9d2e128a17
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
During MHI INIT, memory is allocated for firmware and
rddm vector table. This memory is not freed when DE_INIT
is called.
CRs-Fixed: 2053206
Change-Id: I85b2644189915dd25d8ac31190f16799f86cbd12
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
Fix a potential buffer overflow that could occur
during firmware download by storing buffer address
locally instead of inside MHI context.
CRs-Fixed: 1109397
Change-Id: If27ba602cdafdc8d25a94fdc0d74e8970bf0b0f4
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Doorbell pointers are 64bit addresses. Use correct
data type when passing the address.
CRs-Fixed: 2038601
Change-Id: Ie8e42d38944c0529386b90f5a6d37dcd77c19184
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |/
|
|
|
|
|
|
|
|
| |
MHI clients allowed to communicate with external
soc via MHI during shutdown. Only disable MHI
communication after receiving shutdown notification.
CRs-Fixed: 2037184
Change-Id: If69f61a244a6175256753dea361085fa5f9afeac
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Add support for subsystem restart and shutdown processing
for slave mode and master mode.
CRs-Fixed: 1097560
Change-Id: I8c60605d202d38a7a8f8fb587a179f95ec402692
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
mhi clients can manage both hardware and software event rings.
Process incoming data based on event ring type instead of
channel type.
CRs-Fixed: 2018326
Change-Id: Ifa2de76034224c19a846f7be153400888f8c66de
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
When a client ask MHI host to processed X number of events, only count
transfer events as part of processed events. All other events are internal
events.
CRs-Fixed: 2018324
Change-Id: I4cfcae0ba187348442c3fc45b76d7c4b01f687bd
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
MHI clients expects MHI to finish initializing before clients
probe. Move MHI to subsys init to guarantee MHI will finish
executing before device drivers with module_init starts.
CRs-Fixed: 2006891
Change-Id: I44e3612721fdc247c8c083f74736a1b1bcfc962e
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
Not all events require same priority to process. Process
high priority events using a tasklet while processing low
priority events using a kworker. Priority for events can be
configured by device tree.
CRs-Fixed: 2004759
Change-Id: I6bf04624c2fd92afd7c698d6a57f66619ea13b5b
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
PCIe link can go down anytime asynchronously without host
knowing. In event of a link-down, MMIO reads will always
return 0xffffffff. Confirm the read value is valid prior
to executing further.
CRs-Fixed: 1030692
Change-Id: If052a1a31c62a81f380cec3f523b605b38a33847
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
Fix issue of incorrectly truncating 64bit address
as a 32bit address during memory allocation for
MHI.
CRs-Fixed: 1113884
Change-Id: Iba5123b3710c805cabf63bb6a2958d8218d642e8
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
Not all MHI capable devices can access entire host
DDR. If an MHI client provide a transfer packet that’s
outside of supported address range, copy the packet to
a local bounce buffer prior to transfer.
CRs-Fixed 1110280
Change-Id: Ie7292a2c89cc6608d5360f8a330d78635d913c29
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
MHI host is not always the bus master. Add support to
operate on slave mode.
CRs-Fixed: 1095436
Change-Id: I4af92c8171cf9ba38267afa753cec33f291d55eb
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Add support for MHI host to directly upload firmware
to compatible devices using MHI protocol.
CRs-Fixed: 1095436
Change-Id: Iff7043f1f9afc4824edeaeccc46ed427ce7ee291
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In order to support multiple MHI devices connected
to same host we have, re-organize struct mhi_device_ctxt
such that all information related to device is included inside
struct mhi_device_ctxt. Created an abstract power management
layer to operate MHI in bus master, and slave mode. PCIe bus,
device, slot are extracted from DT to identify physical device.
CRs-Fixed: 1086301
Change-Id: I27a12b7412db75e4843794d80146ca7475b02fdc
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
MHI clients permitted to reset channels asynchronous
to pending data. It's possible after channel reset
there are pending events for that particular channel.
Mark all those events as stale, such that MHI event
process thread will ignore them.
CRs-Fixed: 1074226
Change-Id: I86547aa2c5d7ad5095807cfe87378f5540c05a66
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
In order to support subsystem restart, and
link down recovery, redesign mhi power
management state machine.
CRs-Fixed: 1081654
Change-Id: I3005b829bfdea1d3e9f086676c446b62b5d30d0b
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Not all MHI hardware channels support burst mode, add
support to enable burst mode per channel basis.
CRs-Fixed: 1027069
Change-Id: Icd3061f1a1a4b4b3dab8f9fe3b989a8afefd18b2
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Add support for new MHI hardware channel 102 to be
use by MHI clients as ADPL channel.
CRs-Fixed: 1027069
Change-Id: Ib3c2019fc269064d097bb7f40f01d4580e63a603
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
MHI transaction status stores the OVERFLOW status
received from device. MHI clients uses this
status to determine overflow buffers, do
not clear the status.
CRs-Fixed: 1042516
Change-Id: Iaaff06c1c39775d6a33ca17851f1e1579b2a2ecb
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
When checking for available spaces, check available spaces on
both bounce buffer ring and transfer ring and return min.
Change-Id: I9208b46c32821de3f5d9e3d828087d7bc29b9546
CRs-Fixed: 1055681
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Add missing state MHI_STATE_RESERVE to MHI states
look up table.
CRs-Fixed: 1049595
Change-Id: I9a6bd2750f81f6cabc1e7b5aff488b4a01f7897d
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
When exiting low power modes (M3) do not reset
the DB Mode state if DB mode preserve flag is
set for channel.
CRs-Fixed: 1022868
Change-Id: I6557d28afe9d0ac11b76c683ffba76d7d6ffd377
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
In order to avoid being out of sync between MHI client
and MHI host, host shall not reset the doorbell modes for
hardware channels during MHI_M3 state transition abort.
CRs-Fixed: 1023725
Change-Id: I6c742fc968fd57d71a86039bf1f3f65b1362bc90
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
To avoid any race conditions between MHI_M2 state
transition and MHI_M3 state transition lock the
entire MHI_M3 transition using xfer_lock.
CRs-Fixed: 972390
Change-Id: I7c2e1b7b3966dc5fb8bf2f91bce734bbc58c6fd7
Signed-off-by: Tony Truong <truong@codeaurora.org>
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There are instances when MHI channel context read
pointer can be accessed simultaneously by different
CPU cores. To make sure read pointer updates visible
to all cores, add a memory barrier after completion
of MHI ring operation.
CRs-Fixed: 966338
Change-Id: Ifc8c4cd7595fed9049009c42420a665fb170079f
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Validate the channel prior to proceeding further.
Unlock spin lock before jumping to error handler.
CRs-Fixed: 1016969
Change-Id: Ie3328f878b582a333ae15f3b950c258ec42fd768
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
Instead of printing enum index convert MHI_STATE
enum to text representation for easier interpretation
of debug logs.
CRs-Fixed: 1012249
Change-Id: I97a9a7ff293c739531d8197334a0f0a35bf20419
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Possibility exist when handling a DB MODE event another
core to queue a TRE to same channel. During that time
CC ctxt WP may get updated, however DB MODE event thread
still be using a stale WP. Add a lock to synchronize
DB MODE event thread and queue TRE thread.
CRs-Fixed: 1005752
Change-Id: I7f285da8751a867a1c3d651466537368799eb657
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Incorrect checks in MHI drivers may crash the system.
Fix these checks so that MHI drivers will handle the
errors gracefully.
Change-Id: I462263799c2e76573300ed43b51e39ecba42914b
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Enable MHI runtime PM by default to enable additional
power savings.
Change-Id: I115af9e823ed685d7bf6e2ebaf18ad526256dc98
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Fix race condition in mhi_poll_inbound which could leave the
bounce buffer list and TRE list out of sync.
Change-Id: I76c7de75256b59f8a0dff2a85af733c441761385
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Read the EXEC_ENV register from device to determine the MHI
base state.
Change-Id: Id70a360cfa3775a7186e5059306385a37960df2d
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Enable dynamic allocation of event rings from the coherent pool
to ensure appropriate page alignment with device.
Change-Id: Id57ccd889cf96aad73f4ada01405e2d734351c8c
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Set the correct DMA mask on the platform device to
avoid bounce buffering from the default 32 bit mask.
Change-Id: I7e201e83fd21b0f0a6f57754a3b6f3eded9be58f
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
| |
Replace the MHI defined enum for return codes with
kernel standard return codes. This greatly improves readability
and parsing of errors by userspace clients.
Change-Id: Ica47f8c3a149f23243b5fb6a4aabcdc0a36b1535
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Failed M2 wakeups may represent a serious hardware problem.
The device is refusing to wake up from low power states and all
modem functionality is now stalled.
Track these wakeup attempts.
Change-Id: I3115a4416f85290c5faead0e2d9f280d8cc3b662
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Enable runtime PM on PCIe device to ensure sync with
PCIe framework.
Change-Id: Ied432440df0dc788642fe1a1a8d9195b6cc1cf7c
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Remove unused macros for TRE sizes. This information is
now present in device tree.
Change-Id: Id3ca59c62d66ce8913e83fcba60e1a912cf146ea
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|
| |
|
|
|
|
|
|
|
| |
Add mdmcalifornium to the list of supported PCIe devices
by MHI.
Change-Id: I34e846caceb8fd2808594470cccbb7e318011cda
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
|