All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Wang Honghui <honghui.wang@ucas.com.cn>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Cristian Maruss <cristian.marussi@arm.com>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] arm_scpi: modify to support acpi
Date: Thu, 24 Nov 2022 11:03:22 +0000	[thread overview]
Message-ID: <Y39PetDhm9fpycwo@FVFF77S0Q05N> (raw)
In-Reply-To: <F813BC8072CDDB25+Y38Yq2QKFefSupZV@TP-P15V.lan>

On Thu, Nov 24, 2022 at 03:09:31PM +0800, Wang Honghui wrote:
> arm_scpi: modify to support acpi
> 
> Signed-off-by: Wang Honghui <honghui.wang@ucas.com.cn>

> @@ -937,55 +952,116 @@ static int scpi_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	for (; scpi_drvinfo->num_chans < count; scpi_drvinfo->num_chans++) {
> -		resource_size_t size;
> -		int idx = scpi_drvinfo->num_chans;
> -		struct scpi_chan *pchan = scpi_drvinfo->channels + idx;
> -		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;
> +	/* Wang Honghui modified to support acpi */
> +	if (dev->of_node) {

[...]

> +	} else {
> +		for (; scpi_info->num_chans < count; scpi_info->num_chans++) {
> +                        u32 size;
> +                        u32 addr;
> +                        int idx = scpi_info->num_chans;
> +                        struct scpi_chan *pchan = scpi_info->channels + idx;
> +                        struct mbox_client *cl = &pchan->cl;
> +                        struct fwnode_handle *fn;
> +
> +                        fn = dev_fwnode(&(pdev->dev));
> +                        ret = fwnode_property_read_u32(fn, "shmem_start",  &addr);
> +                        if (ret < 0) {
> +                                dev_err(dev, "failed to get SCPI payload mem resource\n");
> +                                return ret;
> +                        }
> +
> +                        ret = fwnode_property_read_u32(fn, "shmem_size",  &size);
> +                        if (ret < 0) {
> +                                dev_err(dev, "failed to ioremap SCPI payload\n");
> +                                return -EADDRNOTAVAIL;
> +                        }

ACPI has native mechanisms to describe IO resources, so this doesn't look right at all.

Does ARM have ACPI bindings for SCPI? I don't think we should be inventing
vendor-specific bindings for this....

> +                        if (!ret) {
> +                                pchan->chan = phytium_mbox_request_channel(cl);

... so this looks very wrong.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Wang Honghui <honghui.wang@ucas.com.cn>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Cristian Maruss <cristian.marussi@arm.com>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] arm_scpi: modify to support acpi
Date: Thu, 24 Nov 2022 11:03:22 +0000	[thread overview]
Message-ID: <Y39PetDhm9fpycwo@FVFF77S0Q05N> (raw)
In-Reply-To: <F813BC8072CDDB25+Y38Yq2QKFefSupZV@TP-P15V.lan>

On Thu, Nov 24, 2022 at 03:09:31PM +0800, Wang Honghui wrote:
> arm_scpi: modify to support acpi
> 
> Signed-off-by: Wang Honghui <honghui.wang@ucas.com.cn>

> @@ -937,55 +952,116 @@ static int scpi_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	for (; scpi_drvinfo->num_chans < count; scpi_drvinfo->num_chans++) {
> -		resource_size_t size;
> -		int idx = scpi_drvinfo->num_chans;
> -		struct scpi_chan *pchan = scpi_drvinfo->channels + idx;
> -		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;
> +	/* Wang Honghui modified to support acpi */
> +	if (dev->of_node) {

[...]

> +	} else {
> +		for (; scpi_info->num_chans < count; scpi_info->num_chans++) {
> +                        u32 size;
> +                        u32 addr;
> +                        int idx = scpi_info->num_chans;
> +                        struct scpi_chan *pchan = scpi_info->channels + idx;
> +                        struct mbox_client *cl = &pchan->cl;
> +                        struct fwnode_handle *fn;
> +
> +                        fn = dev_fwnode(&(pdev->dev));
> +                        ret = fwnode_property_read_u32(fn, "shmem_start",  &addr);
> +                        if (ret < 0) {
> +                                dev_err(dev, "failed to get SCPI payload mem resource\n");
> +                                return ret;
> +                        }
> +
> +                        ret = fwnode_property_read_u32(fn, "shmem_size",  &size);
> +                        if (ret < 0) {
> +                                dev_err(dev, "failed to ioremap SCPI payload\n");
> +                                return -EADDRNOTAVAIL;
> +                        }

ACPI has native mechanisms to describe IO resources, so this doesn't look right at all.

Does ARM have ACPI bindings for SCPI? I don't think we should be inventing
vendor-specific bindings for this....

> +                        if (!ret) {
> +                                pchan->chan = phytium_mbox_request_channel(cl);

... so this looks very wrong.

Thanks,
Mark.

  reply	other threads:[~2022-11-24 11:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24  7:09 [PATCH 3/3] arm_scpi: modify to support acpi Wang Honghui
2022-11-24  7:09 ` Wang Honghui
2022-11-24 11:03 ` Mark Rutland [this message]
2022-11-24 11:03   ` Mark Rutland
2022-11-24 12:23   ` 王洪辉
2022-11-24 12:23     ` 王洪辉
2022-11-24 13:46     ` Sudeep Holla
2022-11-24 13:46       ` Sudeep Holla
2022-11-24 11:10 ` Sudeep Holla
2022-11-24 11:10   ` Sudeep Holla
2022-11-25  1:20   ` Hanjun Guo
2022-11-25  1:20     ` Hanjun Guo

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=Y39PetDhm9fpycwo@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=cristian.marussi@arm.com \
    --cc=honghui.wang@ucas.com.cn \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.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 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.