Skip to content

For linux msm/sahara mode match - #343

Open
quic-bjorande wants to merge 2 commits into
linux-msm:masterfrom
quic-bjorande:for-linux-msm/sahara-mode-match
Open

quic-bjorande wants to merge 2 commits into
linux-msm:masterfrom
quic-bjorande:for-linux-msm/sahara-mode-match

Conversation

@quic-bjorande

Copy link
Copy Markdown
Contributor

No description provided.

@quic-bjorande
quic-bjorande requested a review from a team as a code owner October 19, 2026 02:15
QDL mirrors the mode supplied by Sahara HELLO regardless of the
requested operation. Running flash against a device in memory-debug mode
can therefore enter ramdump processing without an output path, while the
inverse mismatch fails indirectly.

Reject a HELLO mode that does not match the selected flash or ramdump
operation before sending a response or processing mode-specific packets.

Closes: linux-msm#312
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Sahara mode mismatches previously progressed into the handler selected
by the device rather than the requested QDL operation. Exercise both
supported modes and both mismatch directions so validation remains
before any mode-specific packet is consumed or response is written.

Closes: linux-msm#312
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
@quic-bjorande
quic-bjorande force-pushed the for-linux-msm/sahara-mode-match branch from 1c800ce to 44274d6 Compare October 19, 2026 03:12

@igoropaniuk igoropaniuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Could you also rebased onto the latest master? Thanks!

Comment thread src/sahara.c

return sahara_send_hello_resp(qdl, SAHARA_VERSION, pkt->hello_req.mode);
if (pkt->hello_req.mode != expected_mode) {
ux_err("Sahara mode mismatch: device is in %s mode, but %s was requested\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you switch to ux_err_tag() instead :

ux_err_tag(UX_TAG_SAHARA, "mode mismatch: device is in %s mode, but %s was requested\n",
	   sahara_mode_name(pkt->hello_req.mode),
	   sahara_mode_name(expected_mode));

Comment thread src/sahara.c
case SAHARA_MODE_COMMAND:
return "command";
default:
return "unknown";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we elaborate and add print mode raw number as well (e.g. "unknown (0x%x)")

@igoropaniuk

Copy link
Copy Markdown
Contributor

nit: both commits carry Closes: tags;
The test commit doesn't close the issue by itself, so I'd keep the trailer only on the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants