From: Cristian Marussi <cristian.marussi@arm.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
Rob Herring <robh+dt@kernel.org>,
Kevin Hilman <khilman@baylibre.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [RESEND PATCH 1/2] firmware: arm_scpi: Add compatibility checks for shmem node
Date: Thu, 3 Jun 2021 13:52:49 +0100 [thread overview]
Message-ID: <20210603125249.GA28060@e120937-lin> (raw)
In-Reply-To: <20210602073851.1005607-1-sudeep.holla@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Cristian
On Wed, Jun 02, 2021 at 08:38:50AM +0100, Sudeep Holla wrote:
> The shared memory node used for communication between the firmware and
> the OS should be compatible with one of the following:
> - amlogic,meson-gxbb-scp-shmem
> - amlogic,meson-axg-scp-shmem
> - arm,juno-scp-shmem
> - arm,scp-shmem
> Add the check for the same while parsing the node before fetching the memory
> regions.
>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Jerome Brunet <jbrunet@baylibre.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> drivers/firmware/arm_scpi.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
> index d0dee37ad522..7b827258e163 100644
> --- a/drivers/firmware/arm_scpi.c
> +++ b/drivers/firmware/arm_scpi.c
> @@ -897,6 +897,13 @@ static const struct of_device_id legacy_scpi_of_match[] = {
> {},
> };
>
> +static const struct of_device_id shmem_of_match[] = {
> + { .compatible = "amlogic,meson-gxbb-scp-shmem", },
> + { .compatible = "amlogic,meson-axg-scp-shmem", },
> + { .compatible = "arm,juno-scp-shmem", },
> + { .compatible = "arm,scp-shmem", },
> + { }
> +};
> static int scpi_probe(struct platform_device *pdev)
> {
> int count, idx, ret;
> @@ -933,6 +940,9 @@ static int scpi_probe(struct platform_device *pdev)
> struct mbox_client *cl = &pchan->cl;
> struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
>
> + if (!of_match_node(shmem_of_match, shmem))
> + return -ENXIO;
> +
> ret = of_address_to_resource(shmem, 0, &res);
> of_node_put(shmem);
> if (ret) {
> --
> 2.25.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-06-03 12:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 7:38 [RESEND PATCH 1/2] firmware: arm_scpi: Add compatibility checks for shmem node Sudeep Holla
2021-06-02 7:38 ` [RESEND PATCH 2/2] firmware: arm_scmi: " Sudeep Holla
2021-06-03 12:53 ` Cristian Marussi
2021-06-04 17:14 ` Florian Fainelli
2021-06-03 12:52 ` Cristian Marussi [this message]
2021-06-04 8:56 ` [RESEND PATCH 1/2] firmware: arm_scpi: " Sudeep Holla
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=20210603125249.GA28060@e120937-lin \
--to=cristian.marussi@arm.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=narmstrong@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).