<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/soc/qcom/mdt_loader.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-06-13T17:13:01Z</updated>
<entry>
<title>soc: qcom: mdt_loader: Fix split image detection</title>
<updated>2023-06-13T17:13:01Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>quic_bjorande@quicinc.com</email>
</author>
<published>2023-06-12T21:58:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0d25da8e7e1e35bdbb521d586be1954bdedd1cca'/>
<id>urn:sha1:0d25da8e7e1e35bdbb521d586be1954bdedd1cca</id>
<content type='text'>
The enhanced detection introduced in commit '210d12c8197a ("soc: qcom:
mdt_loader: Enhance split binary detection")' requires that all segments
lies within the file on disk.

But the Qualcomm firmware files consistently has a BSS-like segment at
the end, with a p_offset aligned to the next 4k boundary. As the p_size
is 0 and there's nothing to load, the image is not padded to cover this
(empty) segment.

Ignore zero-sized segments when determining if the image is split, to
avoid this problem.

Fixes: 210d12c8197a ("soc: qcom: mdt_loader: Enhance split binary detection")
Signed-off-by: Bjorn Andersson &lt;quic_bjorande@quicinc.com&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Tested-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt; # qrb5165-rb5
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/20230612215804.1883458-1-quic_bjorande@quicinc.com
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Fix unconditional call to scm_pas_mem_setup</title>
<updated>2023-05-27T01:14:56Z</updated>
<author>
<name>Christian Marangi</name>
<email>ansuelsmth@gmail.com</email>
</author>
<published>2023-05-26T11:55:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bcb889891371c3cf767f2b9e8768cfe2fdd3810f'/>
<id>urn:sha1:bcb889891371c3cf767f2b9e8768cfe2fdd3810f</id>
<content type='text'>
Commit ebeb20a9cd3f ("soc: qcom: mdt_loader: Always invoke PAS
mem_setup") dropped the relocate check and made pas_mem_setup run
unconditionally. The code was later moved with commit f4e526ff7e38
("soc: qcom: mdt_loader: Extract PAS operations") to
qcom_mdt_pas_init() effectively losing track of what was actually
done.

The assumption that PAS mem_setup can be done anytime was effectively
wrong, with no good reason and this caused regression on some SoC
that use remoteproc to bringup ath11k. One example is IPQ8074 SoC that
effectively broke resulting in remoteproc silently die and ath11k not
working.

On this SoC FW relocate is not enabled and PAS mem_setup was correctly
skipped in previous kernel version resulting in correct bringup and
function of remoteproc and ath11k.

To fix the regression, reintroduce the relocate check in
qcom_mdt_pas_init() and correctly skip PAS mem_setup where relocate is
not enabled.

Fixes: ebeb20a9cd3f ("soc: qcom: mdt_loader: Always invoke PAS mem_setup")
Tested-by: Robert Marko &lt;robimarko@gmail.com&gt;
Co-developed-by: Robert Marko &lt;robimarko@gmail.com&gt;
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
Cc: stable@vger.kernel.org
Reviewed-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/20230526115511.3328-1-ansuelsmth@gmail.com
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Enhance split binary detection</title>
<updated>2023-05-25T02:28:57Z</updated>
<author>
<name>Gokul krishna Krishnakumar</name>
<email>quic_gokukris@quicinc.com</email>
</author>
<published>2023-05-09T00:18:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=210d12c8197a551caa2979be421aa42381156aec'/>
<id>urn:sha1:210d12c8197a551caa2979be421aa42381156aec</id>
<content type='text'>
It may be that the offset of the first program header lies inside the mdt's
filesize, in this case the loader would incorrectly assume that the bins
were not split and in this scenario the firmware authentication fails.
This change updates the logic used by the mdt loader to understand whether
the firmware images are split or not. It figures this out by checking if
each programs header's segment lies within the file or not.

Co-developed-by: Melody Olvera &lt;quic_molvera@quicinc.com&gt;
Signed-off-by: Melody Olvera &lt;quic_molvera@quicinc.com&gt;
Signed-off-by: Gokul krishna Krishnakumar &lt;quic_gokukris@quicinc.com&gt;
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Link: https://lore.kernel.org/r/20230509001821.24010-1-quic_gokukris@quicinc.com
</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>
<email>quic_eberman@quicinc.com</email>
</author>
<published>2023-02-03T21:09:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>soc: qcom: correct kerneldoc</title>
<updated>2022-06-26T03:05:31Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2022-05-19T07:33:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d11a34a404ee5565ce8e0abe3e2b9ce6f5cc0a4b'/>
<id>urn:sha1:d11a34a404ee5565ce8e0abe3e2b9ce6f5cc0a4b</id>
<content type='text'>
Correct kerneldoc warnings like:

  drivers/soc/qcom/mdt_loader.c:126:
    warning: Function parameter or member 'fw_name' not described in 'qcom_mdt_read_metadata'

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/20220519073301.7072-2-krzysztof.kozlowski@linaro.org
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Fix split-firmware condition</title>
<updated>2022-02-23T19:13:12Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2022-02-15T03:48:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a1b019872693c74d919db4e267f451fc7af9a21c'/>
<id>urn:sha1:a1b019872693c74d919db4e267f451fc7af9a21c</id>
<content type='text'>
The updated condition checking if a segment can be found in the loaded
firmware blob, or need to be loaded from a separate file, incorrectly
classifies segments that ends at the end of the loaded blob. The result
is that the mdt loader attempts to load the segment from a separate
file.

Correct the conditional to use the loaded segment instead.

Fixes: ea90330fa329 ("soc: qcom: mdt_loader: Extend check for split firmware")
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Link: https://lore.kernel.org/r/20220215034819.1209367-1-bjorn.andersson@linaro.org
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Extract PAS operations</title>
<updated>2022-02-04T03:54:48Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2022-01-28T02:55:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f4e526ff7e38e27bb87d53131d227a6fd6f73ab5'/>
<id>urn:sha1:f4e526ff7e38e27bb87d53131d227a6fd6f73ab5</id>
<content type='text'>
Rather than passing a boolean to indicate if the PAS operations should
be performed from within __mdt_load(), extract them to their own helper
function.

This will allow clients to invoke this directly, with some
qcom_scm_pas_metadata context that they later needs to release, without
further having to complicate the prototype of qcom_mdt_load().

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20220128025513.97188-9-bjorn.andersson@linaro.org
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Always invoke PAS mem_setup</title>
<updated>2022-02-03T21:32:30Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2022-01-28T02:55:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ebeb20a9cd3f045a3371ccf3782b6cbcce62a7c9'/>
<id>urn:sha1:ebeb20a9cd3f045a3371ccf3782b6cbcce62a7c9</id>
<content type='text'>
After spelunking various old kernel trees no finds has been found
indicating that the PAS mem_setup call should actually be made
conditional on the image being relocatable.

Group the two PAS operations together, to facilitate splitting them out
in a following patch.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20220128025513.97188-8-bjorn.andersson@linaro.org
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Reorder parts of __qcom_mdt_load()</title>
<updated>2022-02-03T21:32:30Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2022-01-28T02:55:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=75d7213ce19135b8f309099f6618a03e9b397271'/>
<id>urn:sha1:75d7213ce19135b8f309099f6618a03e9b397271</id>
<content type='text'>
Move the traversal of the program headers to the start of the function,
to make sure that min_ and max_addr are in scope as the call to
qcom_scm_pas_mem_setup() is moved in the next commit.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20220128025513.97188-7-bjorn.andersson@linaro.org
</content>
</entry>
<entry>
<title>soc: qcom: mdt_loader: Extend check for split firmware</title>
<updated>2022-02-03T21:32:30Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2022-01-28T02:55:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ea90330fa329e4bee009223a1d5a7d9bcc364df2'/>
<id>urn:sha1:ea90330fa329e4bee009223a1d5a7d9bcc364df2</id>
<content type='text'>
Some of the Qualcomm SM8450 firmware files are padded such that the
start of the first segment falls within the .mdt file but the segment to
be loaded is stored as a separate .bNN file.

Extend the condition to only attempt to read a segment inline if the
entire segment would be available.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20220128025513.97188-6-bjorn.andersson@linaro.org
</content>
</entry>
</feed>
