rebuild_sched_domains() is called during walt_init with the assumption
that cpufreq_online has actually completed before the execution of
walt_init. This is only partially true.
cpufreq_online() will notify update_topology_flags_workfn once the
policies have been created. However, the em creation is after this
point in time.
This creates a race condition between cpufreq_online's creation
of the energy model through it's call to register_em(policy), and
walt's execution of rebuild_sched_domains. If walt init completes
quickly, and rebuild_sched_domains() is executed quickly, it is
possible it will complete before the energy model is registered.
Thus, the perf domains will still be unpopulated, and the error
detection for perf domains will cause the system to crash.
Address this by ensuring that the energy model has run for each
cpu in the system by checking the same field that em_create_pd
must populate for build_perf_domains to work properly, the
em_pd field in the cpu device.
Additionally ensure that this is only attempted if the domains are
not yet setup properly and it is known that corrective action
must take place.
Change-Id: I8f5150fe4e2e37b3820e809232f26ff207723601
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
Ensure that all thermal pressure gets accounted in capacity_orig
as soon as it is set, rather than during the window rollover period.
Change-Id: Ia22cb87f0d1fcb23f1a932f9b70637861b56ae33
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
If the energy model is not updated by the time rebalance_domains
is called for the first time, the root domain -> perf_domain
values will get erased completely, and will be invalid. The
responsibility for this race is outside of the walt module.
walt_find_energy_efficient_cpu() relies upon rd->pd being valid
and cannot function properly without it. This is critical to
proper walt functionality and it cannot move forward without it.
Decisvely catch the failure.
Change-Id: Iee8030afd487dcee1d9cc18c2d655ecc26938279
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
There is a race condition in cpufreq.c in which the energy model
is not updated until after rebuild domains has completed. If
this is performed out of order, the rebuild domains will fail and
the perf domains will be freed, causing
walt_find_energy_efficient_cpu to fail to perform active migration.
After topology update is complete and walt initialization moves
forward, rebuild the domains waiting for the completion of the
rebuild before performing the walt update of the toplogy,
guranteeing that the perf domains are populated properly even if
cpufreq builds the domains the first time, out of order.
Change-Id: I28499c4318580da54735347be0ea00867e68d94b
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
skb_put_padto() will free the skb if it fails to add the requested
padding to the skb. Drop the packet if we are unable to allocate a new
skb with the requested padding.
Change-Id: I5503c99679c7e6ecf767d3f632d72da5315988f1
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Print error logs in the callback by using pr_err_ratelimited
so that watchdog bark will not occur due to excessive logging
when the callback is triggered before probe is completed.
Change-Id: I82bb84b7812cef5cb8a37e99c5cf1a54411cbdb8
Signed-off-by: Sarannya S <sarannya@codeaurora.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Allow isr context to get service details.
Change-Id: I782a2c80883252ce614a0a05df6d4fc1a1304b32
Signed-off-by: Arun Prakash <app@codeaurora.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
The qrtr driver can guarantee that the packet gets queued to the socket
but cannot guarantee the client process will get time to run if auto
sleep is enabled. This config will help mitigate missed packets on
systems where auto sleep is too aggressive.
Use the pm_wakeup_ws_event() api so a hard wakeup can be specified.
This will ensure a resume occurs if the data coming in happens while
the device is going into suspend.
Change-Id: Ic596e06e585b3479a6faa1d0210c016fc9138c6e
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
In some cases system enters into suspend state before handling
incoming packets and cause delay in communication.
Add pm_wakup_event() to abort the suspend when a packet is received.
Force a wakeup when queueing packets to a socket. This is needed to
give userspace clients a chance to run if the device is going into
system suspend. The wakeup event should force the device to abort
suspend.
The only node that should not behave this way is the SLPI node because
sensor stream race conditions cause suspend issues and power drain
issues.
There was an update to add a device parameter into
wakeup_source_register().
Change-Id: Ie69be3a46309f6a05cfbff0642b95194c2d6e955
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Add a pool of SKBs that can be used when the system is in low memory
conditions. This pool will be shared between all nodes and replenished
by a worker function.
Change-Id: I639a9ac76db726dc8ad46b12d3b3d560c674939c
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Add support to configure the node id through defconfig. This is useful
for targets that are unable to configure the node id through qrtr-ns
because of security reasons. The local node id can still be overridden
by the ns if it is capable.
Change-Id: Ie9fec2ae276948340f4f5a7e0374d554502a0ee1
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Node ref count decrement and test is performed inside ept
sem lock while node lookup is done inside node spin lock.
This can sometime cause node lookup to succeed while parallely
node can be freed in node release function. This will further
use of node and will result in use after free.
Additionally hold ept smem lock before performing node lookup.
Change-Id: Iaa5781c56ebee51611dfea9fddcde50f1367dfea
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
When enable the duplicate-funnel, it would crash due to missing the
initialization of the struct csdev_access in the funnel probe.
Change-Id: Iaedfdf300f35e0c7f1b2da7f7ede26aa84bae395
Signed-off-by: Hao Zhang <quic_hazha@quicinc.com>
Valid frequencies may result in BCM votes that exceed the max HW value.
Set vote ceiling to BCM_TCS_CMD_VOTE_MASK to ensure the votes aren't
truncated, which can result in lower frequencies than desired.
Change-Id: I6d64815ee93c5c604ec0bea86eca00aca570bb9e
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>