All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
To: <linux-remoteproc@vger.kernel.org>, <agross@kernel.org>,
	<andersson@kernel.org>, <lgirdwood@gmail.com>,
	<broonie@kernel.org>, <robh+dt@kernel.org>,
	<quic_plai@quicinc.com>, <bgoswami@quicinc.com>, <perex@perex.cz>,
	<tiwai@suse.com>, <srinivas.kandagatla@linaro.org>,
	<quic_rohkumar@quicinc.com>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <swboyd@chromium.org>,
	<judyhsiao@chromium.org>, <devicetree@vger.kernel.org>,
	<krzysztof.kozlowski@linaro.org>, <mathieu.poirier@linaro.org>,
	<corbet@lwn.net>
Cc: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Subject: [PATCH v4 1/2] remoteproc: elf_loader: Update resource table name check
Date: Wed, 21 Dec 2022 11:40:32 +0530	[thread overview]
Message-ID: <1671603033-4359-2-git-send-email-quic_srivasam@quicinc.com> (raw)
In-Reply-To: <1671603033-4359-1-git-send-email-quic_srivasam@quicinc.com>

Update the way of checking resource table name with prefix substring search
instead of complete string search.

In general, Qualcomm DSP binary is prepared by combining different ELFs'.
Hence, section header name (e.g. .resource_table), appended with ELF name
to differentiate with same section(e.g. resource_table.ac_bin_process) of
different ELFs'.

Example readelf output of DSP binary:
    [60] .start.ac_bin_process PROGBITS
    [61] .resource_table.ac_bin_process PROGBITS
    [62] .comment.ac_bin_process PROGBITS

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 drivers/remoteproc/remoteproc_elf_loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c
index 5a412d7..77330d6 100644
--- a/drivers/remoteproc/remoteproc_elf_loader.c
+++ b/drivers/remoteproc/remoteproc_elf_loader.c
@@ -272,7 +272,7 @@ find_table(struct device *dev, const struct firmware *fw)
 		u64 offset = elf_shdr_get_sh_offset(class, shdr);
 		u32 name = elf_shdr_get_sh_name(class, shdr);
 
-		if (strcmp(name_table + name, ".resource_table"))
+		if (!strstarts(name_table + name, ".resource_table"))
 			continue;
 
 		table = (struct resource_table *)(elf_data + offset);
-- 
2.7.4


  reply	other threads:[~2022-12-21  6:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  6:10 [PATCH v4 0/2] Update section header name check Srinivasa Rao Mandadapu
2022-12-21  6:10 ` Srinivasa Rao Mandadapu [this message]
2023-01-04 23:15   ` [PATCH v4 1/2] remoteproc: elf_loader: Update resource table " Mathieu Poirier
2022-12-21  6:10 ` [PATCH v4 2/2] docs: remoteproc: Update section header name requirement Srinivasa Rao Mandadapu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1671603033-4359-2-git-send-email-quic_srivasam@quicinc.com \
    --to=quic_srivasam@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=judyhsiao@chromium.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=perex@perex.cz \
    --cc=quic_plai@quicinc.com \
    --cc=quic_rohkumar@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=swboyd@chromium.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.