<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/firmware/qcom_scm.c, branch linux-6.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-06-09T08:48:18Z</updated>
<entry>
<title>firmware: qcom_scm: Use fixed width src vm bitmap</title>
<updated>2023-06-09T08:48:18Z</updated>
<author>
<name>Elliot Berman</name>
</author>
<published>2023-02-13T18:18:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b952a4b2420faa7eccd5c246e767d21349bcd8a'/>
<id>urn:sha1:6b952a4b2420faa7eccd5c246e767d21349bcd8a</id>
<content type='text'>
[ Upstream commit 968a26a07f75377afbd4f7bb18ef587a1443c244 ]

The maximum VMID for assign_mem is 63. Use a u64 to represent this
bitmap instead of architecture-dependent "unsigned int" which varies in
size on 32-bit and 64-bit platforms.

Acked-by: Kalle Valo &lt;kvalo@kernel.org&gt; (ath10k)
Tested-by: Gokul krishna Krishnakumar &lt;quic_gokukris@quicinc.com&gt;
Signed-off-by: Elliot Berman &lt;quic_eberman@quicinc.com&gt;
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/20230213181832.3489174-1-quic_eberman@quicinc.com
Stable-dep-of: a6e766dea0a2 ("misc: fastrpc: Pass proper scm arguments for secure map request")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>firmware: qcom_scm: Clear download bit during reboot</title>
<updated>2023-05-11T14:17:02Z</updated>
<author>
<name>Mukesh Ojha</name>
</author>
<published>2023-03-16T15:14:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c63b5eac9ecfa924ad93acc4d3bf0ae4e8b8de76'/>
<id>urn:sha1:c63b5eac9ecfa924ad93acc4d3bf0ae4e8b8de76</id>
<content type='text'>
[ Upstream commit 781d32d1c9709fd25655c4e3e3e15370ae4ae4db ]

During normal restart of a system download bit should
be cleared irrespective of whether download mode is
set or not.

Fixes: 8c1b7dc9ba22 ("firmware: qcom: scm: Expose download-mode control")
Signed-off-by: Mukesh Ojha &lt;quic_mojha@quicinc.com&gt;
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/1678979666-551-1-git-send-email-quic_mojha@quicinc.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>firmware: qcom: scm: fix bogus irq error at probe</title>
<updated>2023-03-09T21:58:22Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2023-03-09T11:12:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3d0fbad6765da25de7ecf6481af9b6ddb0b3793'/>
<id>urn:sha1:f3d0fbad6765da25de7ecf6481af9b6ddb0b3793</id>
<content type='text'>
A recent commit added support for an optional interrupt which is only
available on some platforms.

Stop spamming the logs with bogus error messages on platforms that do
not use this new optional resource:

	qcom_scm firmware:scm: error -ENXIO: IRQ index 0 not found

Fixes: 6bf325992236 ("firmware: qcom: scm: Add wait-queue handling logic")
Cc: Guru Das Srinagesh &lt;quic_gurus@quicinc.com&gt;
Cc: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Tested-by: Steev Klimaszewski &lt;steev@kali.org&gt; # Thinkpad X13s
Acked-by: Guru Das Srinagesh &lt;quic_gurus@quicinc.com&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/20230309111209.31606-1-johan+linaro@kernel.org
</content>
</entry>
<entry>
<title>firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/</title>
<updated>2023-02-09T03:15:16Z</updated>
<author>
<name>Elliot Berman</name>
</author>
<published>2023-02-03T21:09:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3bf90eca76c98c55c975fa817799789b9176f9f3'/>
<id>urn:sha1:3bf90eca76c98c55c975fa817799789b9176f9f3</id>
<content type='text'>
Move include/linux/qcom_scm.h to include/linux/firmware/qcom/qcom_scm.h.
This removes 1 of a few remaining Qualcomm-specific headers into a more
approciate subdirectory under include/.

Suggested-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Signed-off-by: Elliot Berman &lt;quic_eberman@quicinc.com&gt;
Reviewed-by: Guru Das Srinagesh &lt;quic_gurus@quicinc.com&gt;
Acked-by: Mukesh Ojha &lt;quic_mojha@quicinc.com&gt;
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/20230203210956.3580811-1-quic_eberman@quicinc.com
</content>
</entry>
<entry>
<title>firmware: qcom: scm: Add wait-queue handling logic</title>
<updated>2023-01-19T03:14:40Z</updated>
<author>
<name>Guru Das Srinagesh</name>
</author>
<published>2023-01-13T16:11:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6bf32599223634294cdc6efb359ffaab1d68073c'/>
<id>urn:sha1:6bf32599223634294cdc6efb359ffaab1d68073c</id>
<content type='text'>
When the firmware (FW) supports multiple requests per VM, multiple requests
from the same/different VM can reach the firmware at the same time. Since
the firmware currently being used has limited resources, it guards them
with a resource lock and puts requests on a wait-queue internally and
signals to HLOS that it is doing so. It does this by returning a new return
value in addition to success or error: SCM_WAITQ_SLEEP. A sleeping SCM call
can be woken up by an interrupt that the FW raises.

  1) SCM_WAITQ_SLEEP:

  	When an SCM call receives this return value instead of success
  	or error, FW has placed this call on a wait-queue and has signalled
	HLOS to put it to non-interruptible sleep.

	Along with this return value, FW also passes to HLOS `wq_ctx` -
	a unique number (UID) identifying the wait-queue that it has put
	the call on, internally. This is to help HLOS with its own
	bookkeeping to wake this sleeping call later.

	Additionally, FW also passes to HLOS `smc_call_ctx` - a UID
	identifying the SCM call thus being put to sleep. This is also
	for HLOS' bookkeeping to wake this call up later.

	These two additional values are passed via the a1 and a2
	registers.

	N.B.: The "ctx" in the above UID names = "context".

The handshake mechanism that HLOS uses to talk to FW about wait-queue
operations involves two new SMC calls.

  1) get_wq_ctx():

    	Arguments: 	None
    	Returns:	wq_ctx, flags, more_pending

    	Get the wait-queue context, and wake up either one or all of the
    	sleeping SCM calls associated with that wait-queue.

    	Additionally, repeat this if there are more wait-queues that are
    	ready to have their requests woken up (`more_pending`).

  2) wq_resume(smc_call_ctx):

  	Arguments:	smc_call_ctx

  	HLOS needs to issue this in response to receiving an
  	IRQ, passing to FW the same smc_call_ctx that FW
  	receives from HLOS via the get_wq_ctx() call.

(The mechanism to wake a SMC call back up is described in detail below)

 VM_1                     VM_2                            Firmware
   │                        │                                 │
   │                        │                                 │
   │                        │                                 │
   │                        │                                 │
   │      REQUEST_1         │                                 │
   ├────────────────────────┼─────────────────────────────────┤
   │                        │                                 │
   │                        │                              ┌──┼──┐
   │                        │                              │  │  │
   │                        │     REQUEST_2                │  │  │
   │                        ├──────────────────────────────┼──┤  │
   │                        │                              │  │  │Resource
   │                        │                              │  │  │is busy
   │                        │       {WQ_SLEEP}             │  │  │
   │                        │◄─────────────────────────────┼──┤  │
   │                        │  wq_ctx, smc_call_ctx        │  │  │
   │                        │                              └──┼──┘
   │   REQUEST_1 COMPLETE   │                                 │
   │◄───────────────────────┼─────────────────────────────────┤
   │                        │                                 │
   │                        │         IRQ                     │
   │                        │◄─-------------------------------│
   │                        │                                 │
   │                        │      get_wq_ctx()               │
   │                        ├────────────────────────────────►│
   │                        │                                 │
   │                        │                                 │
   │                        │◄────────────────────────────────┤
   │                        │   wq_ctx, flags, and            │
   │                        │        more_pending             │
   │                        │                                 │
   │                        │                                 │
   │                        │ wq_resume(smc_call_ctx)         │
   │                        ├────────────────────────────────►│
   │                        │                                 │
   │                        │                                 │
   │                        │      REQUEST_2 COMPLETE         │
   │                        │◄────────────────────────────────┤
   │                        │                                 │
   │                        │                                 │

With the exception of get_wq_ctx(), the other SMC call wq_resume() can
return WQ_SLEEP (these nested rounds of WQ_SLEEP are not shown in the
above diagram for the sake of simplicity). Therefore, introduce a new
do-while loop to handle multiple WQ_SLEEP return values for the same
parent SCM call.

Request Completion in the above diagram refers to either a success
return value (zero) or error (and not SMC_WAITQ_SLEEP)

Also add the interrupt handler that wakes up a sleeping SCM call.

Signed-off-by: Guru Das Srinagesh &lt;quic_gurus@quicinc.com&gt;
Co-developed-by: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Signed-off-by: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Reviewed-by: Guru Das Srinagesh &lt;quic_gurus@quicinc.com&gt;
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/20230113161114.22607-3-quic_sibis@quicinc.com
</content>
</entry>
<entry>
<title>firmware: qcom_scm: Add bw voting support to the SCM interface</title>
<updated>2022-06-30T02:48:32Z</updated>
<author>
<name>Sibi Sankar</name>
</author>
<published>2022-05-23T07:00:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65b7ebda5028615f7ee7628759e05da5db7f0d25'/>
<id>urn:sha1:65b7ebda5028615f7ee7628759e05da5db7f0d25</id>
<content type='text'>
The SMC calls required by remoteproc PAS driver on SM8450 SoCs get a
performance benefit from having a max vote to the crypto-&gt;ddr path.
Add support for bandwidth (bw) voting for those SMC calls when the
interconnects property is specified.

Signed-off-by: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/1653289258-17699-3-git-send-email-quic_sibis@quicinc.com
</content>
</entry>
<entry>
<title>firmware: qcom_scm: drop unexpected word "the"</title>
<updated>2022-06-25T20:15:57Z</updated>
<author>
<name>Jiang Jian</name>
</author>
<published>2022-06-21T09:49:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c19698a9e41bd6cf6dc3be436ed625e5182343ca'/>
<id>urn:sha1:c19698a9e41bd6cf6dc3be436ed625e5182343ca</id>
<content type='text'>
there is an unexpected word "the" in the comments that need to be dropped

&gt; * will cause the the boot stages to enter download mode, unless

Signed-off-by: Jiang Jian &lt;jiangjian@cdjrlc.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/20220621094924.83135-1-jiangjian@cdjrlc.com
</content>
</entry>
<entry>
<title>firmware: qcom_scm: Add compatible for MSM8976 SoC</title>
<updated>2022-04-13T02:36:19Z</updated>
<author>
<name>Adam Skladowski</name>
</author>
<published>2022-03-07T19:17:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34128350b838840b17a1770269158dc0430177d3'/>
<id>urn:sha1:34128350b838840b17a1770269158dc0430177d3</id>
<content type='text'>
Add compatible for SCM on MSM8976.

Signed-off-by: Adam Skladowski &lt;a39.skl@gmail.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/20220307191726.10869-5-a39.skl@gmail.com
</content>
</entry>
<entry>
<title>firmware: qcom: scm: Add support for MC boot address API</title>
<updated>2022-02-04T03:54:48Z</updated>
<author>
<name>Stephan Gerhold</name>
</author>
<published>2021-12-01T13:05:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f60a317bcbea5c5b8923d6de6c7288850fdd83fb'/>
<id>urn:sha1:f60a317bcbea5c5b8923d6de6c7288850fdd83fb</id>
<content type='text'>
It looks like the old QCOM_SCM_BOOT_SET_ADDR API is broken on some
MSM8916 firmware versions that implement the newer SMC32 calling
convention. It just returns -EINVAL no matter which arguments are
being passed.

This does not cause any problems downstream because it first tries
to use the new multi-cluster API replacement which is working fine.

Implement support for the multi-cluster variant of the SCM call
by attempting it first but still fallback to the old call in case
of an error. Also, to be absolutely sure only use the multi-cluster
variant with the SMC calling convention since older platforms should
not need this.

Signed-off-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/20211201130505.257379-5-stephan@gerhold.net
</content>
</entry>
<entry>
<title>firmware: qcom: scm: Drop cpumask parameter from set_boot_addr()</title>
<updated>2022-02-04T03:54:48Z</updated>
<author>
<name>Stephan Gerhold</name>
</author>
<published>2021-12-01T13:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52beb1fc237d67cdc64277dc90047767a6fc52d7'/>
<id>urn:sha1:52beb1fc237d67cdc64277dc90047767a6fc52d7</id>
<content type='text'>
qcom_scm_set_cold/warm_boot_addr() currently take a cpumask parameter,
but it's not very useful because at the end we always set the same entry
address for all CPUs. This also allows speeding up probe of
cpuidle-qcom-spm a bit because only one SCM call needs to be made to
the TrustZone firmware, instead of one per CPU.

The main reason for this change is that it allows implementing the
"multi-cluster" variant of the set_boot_addr() call more easily
without having to rely on functions that break in certain build
configurations or that are not exported to modules.

Signed-off-by: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/20211201130505.257379-4-stephan@gerhold.net
</content>
</entry>
</feed>
