All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Jassi Brar <jassisinghbrar@gmail.com>, linux-kernel@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	robh@kernel.org, alexey.klimov@arm.com, lho@apm.com,
	mark.rutland@arm.com, arnd@arndb.de,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Roy Franz <roy.franz@cavium.com>,
	Harb Abdulhamid <harba@codeaurora.org>,
	Matt Sealey <neko@bakuhatsu.net>,
	ALKML <linux-arm-kernel@lists.infradead.org>,
	DTML <devicetree@vger.kernel.org>, Nishanth Menon <nm@ti.com>
Subject: Re: [PATCH 3/9] firmware: arm_scmi: add basic driver infrastructure for SCMI
Date: Fri, 7 Jul 2017 18:39:24 +0100	[thread overview]
Message-ID: <5f2e4f3c-297b-c5f8-9244-399c1c4e2c21@arm.com> (raw)
In-Reply-To: <1499446341-5956-1-git-send-email-jaswinder.singh@linaro.org>



On 07/07/17 17:52, Jassi Brar wrote:
> Hi Arnd, Hi Rob, Hi Mark,
> 
> [CC'ing only those who I have the email id of]
> 
>> +/**
>> + * scmi_do_xfer() - Do one transfer
>> + *
>> + * @info: Pointer to SCMI entity information
>> + * @xfer: Transfer to initiate and wait for response
>> + *
>> + * Return: -ETIMEDOUT in case of no response, if transmit error,
>> + *   return corresponding error, else if all goes well,
>> + *   return 0.
>> + */
>> +int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>> +{
>> +	int ret;
>> +	int timeout;
>> +	struct scmi_info *info = handle_to_scmi_info(handle);
>> +	struct device *dev = info->dev;
>> +
>> +	ret = mbox_send_message(info->tx_chan, xfer);
>> +
>>
> The api is
> 
>     int mbox_send_message(struct mbox_chan *chan, void *mssg)
> 
> where each controller driver defines its own format in which it accepts
> the 'mssg' to be transmitted.
> 

Yes they can continue that, but SCMI just doesn't depend on that.

> For example :-
> ti_msgmgr_send_data(struct mbox_chan *, struct ti_msgmgr_message *)
> rockchip_mbox_send_data(struct mbox_chan *, struct rockchip_mbox_msg *)
> ....and so on...  you get the idea.
> 

Yes I am aware of that.

> Some controller driver may ignore the 'mssg' because only an interrupt line
> is shared with the remote and not some register/fifo.
> For example,
>   sti_mbox_send_data(struct mbox_chan *, void *ignored)
> 

Exactly, now with SCMI, every controller *can do* that, as we just care
about the signaling which in other terms I have so far referred as
"doorbell". The data passed should not be used for any other purpose
as there's no need to even by the remote firmware implementing SCMI.

If you read the SCMI specification, it's designed to avoid all such
issues with wide variety of mailbox controller we have in the wild.
And hence all the command and other information are passed in the shared
memory.

> Out of 14 controller drivers today, this SCMI implementation will work with
> only 5 (and that too by abusing the api).

What do you mean by abusing the API ?

> The other 9 controllers (and many
> in future) are perfectly able to support SCMI (its just another protocol).

Exactly, if and only if they adhere to the specification.

> All we need is what the SCMI specification calls "Transport Layer".
> Of course that will be a thin platform/controller specific code that will
> encapsulate the 'struct scmi_xfer *xfer' from SCMI, into controller specified
> format and actually call the mbox_send_message().

OK, if platform had to send some platform specific data, I agree. But
can you point me from the SCPI specification the need for the platforms
to do that. That's the whole point. Transport is just a doorbell nothing
more.

You are trying to fit the existing platform implementation into SCMI
which won't work.

E.g. if TI/Rockchip implements SCMI, they can continue using these
drivers as along as it does the job of "ringing the doorbell".

They may be passing some data today because their existing remote
firmware expects it. With SCMI, they don't have to. These existing
drivers are doing additional job in the current form: passing some data
along with triggering the remote doorbell. We just need latter in SCMI
case as we don't need any data in the transport as it's all part of shmem.

Why do you think that won't work ? Remember all the platform specific
stuff(if platform implement own protocols) in SCMI is moved to the
shared memory and transport just needs to do "doorbell". So I disagree
with your concern unless I am missing something.

> 
>  To achieve that, we can either do similar to what platforms with DWC3
> do - generic dwc3 child node of platform specific parent node. Or we can have
> the SCMI protocol implemented as a library that platforms can init and use.
> Or any other better way.
> 
>  I just think it is a bad idea to rule out all but one classes of mailbox controllers.
> 

Definitely neither SCMI specification nor SCMI driver is ruling out any
class of mailbox controllers as long as there are capable of signaling
the other end that "hey look you have something to check in shared
memory" which I think is the case with most of the controllers.

To be honest this whole mailbox framework is somewhat complex for simple
doorbell kind of this, but hey I am not complaining ;).

-- 
Regards,
Sudeep

WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Holla <sudeep.holla-5wv7dgnIgG8@public.gmane.org>
To: Jassi Brar
	<jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Sudeep Holla <sudeep.holla-5wv7dgnIgG8@public.gmane.org>,
	robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	alexey.klimov-5wv7dgnIgG8@public.gmane.org,
	lho-qTEPVZfXA3Y@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	arnd-r2nGTMty4D4@public.gmane.org,
	Jassi Brar
	<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Roy Franz <roy.franz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	Harb Abdulhamid <harba-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Matt Sealey <neko-HhXTZounMxbZATc7fWT8Dg@public.gmane.org>,
	ALKML
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	DTML <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCH 3/9] firmware: arm_scmi: add basic driver infrastructure for SCMI
Date: Fri, 7 Jul 2017 18:39:24 +0100	[thread overview]
Message-ID: <5f2e4f3c-297b-c5f8-9244-399c1c4e2c21@arm.com> (raw)
In-Reply-To: <1499446341-5956-1-git-send-email-jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>



On 07/07/17 17:52, Jassi Brar wrote:
> Hi Arnd, Hi Rob, Hi Mark,
> 
> [CC'ing only those who I have the email id of]
> 
>> +/**
>> + * scmi_do_xfer() - Do one transfer
>> + *
>> + * @info: Pointer to SCMI entity information
>> + * @xfer: Transfer to initiate and wait for response
>> + *
>> + * Return: -ETIMEDOUT in case of no response, if transmit error,
>> + *   return corresponding error, else if all goes well,
>> + *   return 0.
>> + */
>> +int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>> +{
>> +	int ret;
>> +	int timeout;
>> +	struct scmi_info *info = handle_to_scmi_info(handle);
>> +	struct device *dev = info->dev;
>> +
>> +	ret = mbox_send_message(info->tx_chan, xfer);
>> +
>>
> The api is
> 
>     int mbox_send_message(struct mbox_chan *chan, void *mssg)
> 
> where each controller driver defines its own format in which it accepts
> the 'mssg' to be transmitted.
> 

Yes they can continue that, but SCMI just doesn't depend on that.

> For example :-
> ti_msgmgr_send_data(struct mbox_chan *, struct ti_msgmgr_message *)
> rockchip_mbox_send_data(struct mbox_chan *, struct rockchip_mbox_msg *)
> ....and so on...  you get the idea.
> 

Yes I am aware of that.

> Some controller driver may ignore the 'mssg' because only an interrupt line
> is shared with the remote and not some register/fifo.
> For example,
>   sti_mbox_send_data(struct mbox_chan *, void *ignored)
> 

Exactly, now with SCMI, every controller *can do* that, as we just care
about the signaling which in other terms I have so far referred as
"doorbell". The data passed should not be used for any other purpose
as there's no need to even by the remote firmware implementing SCMI.

If you read the SCMI specification, it's designed to avoid all such
issues with wide variety of mailbox controller we have in the wild.
And hence all the command and other information are passed in the shared
memory.

> Out of 14 controller drivers today, this SCMI implementation will work with
> only 5 (and that too by abusing the api).

What do you mean by abusing the API ?

> The other 9 controllers (and many
> in future) are perfectly able to support SCMI (its just another protocol).

Exactly, if and only if they adhere to the specification.

> All we need is what the SCMI specification calls "Transport Layer".
> Of course that will be a thin platform/controller specific code that will
> encapsulate the 'struct scmi_xfer *xfer' from SCMI, into controller specified
> format and actually call the mbox_send_message().

OK, if platform had to send some platform specific data, I agree. But
can you point me from the SCPI specification the need for the platforms
to do that. That's the whole point. Transport is just a doorbell nothing
more.

You are trying to fit the existing platform implementation into SCMI
which won't work.

E.g. if TI/Rockchip implements SCMI, they can continue using these
drivers as along as it does the job of "ringing the doorbell".

They may be passing some data today because their existing remote
firmware expects it. With SCMI, they don't have to. These existing
drivers are doing additional job in the current form: passing some data
along with triggering the remote doorbell. We just need latter in SCMI
case as we don't need any data in the transport as it's all part of shmem.

Why do you think that won't work ? Remember all the platform specific
stuff(if platform implement own protocols) in SCMI is moved to the
shared memory and transport just needs to do "doorbell". So I disagree
with your concern unless I am missing something.

> 
>  To achieve that, we can either do similar to what platforms with DWC3
> do - generic dwc3 child node of platform specific parent node. Or we can have
> the SCMI protocol implemented as a library that platforms can init and use.
> Or any other better way.
> 
>  I just think it is a bad idea to rule out all but one classes of mailbox controllers.
> 

Definitely neither SCMI specification nor SCMI driver is ruling out any
class of mailbox controllers as long as there are capable of signaling
the other end that "hey look you have something to check in shared
memory" which I think is the case with most of the controllers.

To be honest this whole mailbox framework is somewhat complex for simple
doorbell kind of this, but hey I am not complaining ;).

-- 
Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/9] firmware: arm_scmi: add basic driver infrastructure for SCMI
Date: Fri, 7 Jul 2017 18:39:24 +0100	[thread overview]
Message-ID: <5f2e4f3c-297b-c5f8-9244-399c1c4e2c21@arm.com> (raw)
In-Reply-To: <1499446341-5956-1-git-send-email-jaswinder.singh@linaro.org>



On 07/07/17 17:52, Jassi Brar wrote:
> Hi Arnd, Hi Rob, Hi Mark,
> 
> [CC'ing only those who I have the email id of]
> 
>> +/**
>> + * scmi_do_xfer() - Do one transfer
>> + *
>> + * @info: Pointer to SCMI entity information
>> + * @xfer: Transfer to initiate and wait for response
>> + *
>> + * Return: -ETIMEDOUT in case of no response, if transmit error,
>> + *   return corresponding error, else if all goes well,
>> + *   return 0.
>> + */
>> +int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>> +{
>> +	int ret;
>> +	int timeout;
>> +	struct scmi_info *info = handle_to_scmi_info(handle);
>> +	struct device *dev = info->dev;
>> +
>> +	ret = mbox_send_message(info->tx_chan, xfer);
>> +
>>
> The api is
> 
>     int mbox_send_message(struct mbox_chan *chan, void *mssg)
> 
> where each controller driver defines its own format in which it accepts
> the 'mssg' to be transmitted.
> 

Yes they can continue that, but SCMI just doesn't depend on that.

> For example :-
> ti_msgmgr_send_data(struct mbox_chan *, struct ti_msgmgr_message *)
> rockchip_mbox_send_data(struct mbox_chan *, struct rockchip_mbox_msg *)
> ....and so on...  you get the idea.
> 

Yes I am aware of that.

> Some controller driver may ignore the 'mssg' because only an interrupt line
> is shared with the remote and not some register/fifo.
> For example,
>   sti_mbox_send_data(struct mbox_chan *, void *ignored)
> 

Exactly, now with SCMI, every controller *can do* that, as we just care
about the signaling which in other terms I have so far referred as
"doorbell". The data passed should not be used for any other purpose
as there's no need to even by the remote firmware implementing SCMI.

If you read the SCMI specification, it's designed to avoid all such
issues with wide variety of mailbox controller we have in the wild.
And hence all the command and other information are passed in the shared
memory.

> Out of 14 controller drivers today, this SCMI implementation will work with
> only 5 (and that too by abusing the api).

What do you mean by abusing the API ?

> The other 9 controllers (and many
> in future) are perfectly able to support SCMI (its just another protocol).

Exactly, if and only if they adhere to the specification.

> All we need is what the SCMI specification calls "Transport Layer".
> Of course that will be a thin platform/controller specific code that will
> encapsulate the 'struct scmi_xfer *xfer' from SCMI, into controller specified
> format and actually call the mbox_send_message().

OK, if platform had to send some platform specific data, I agree. But
can you point me from the SCPI specification the need for the platforms
to do that. That's the whole point. Transport is just a doorbell nothing
more.

You are trying to fit the existing platform implementation into SCMI
which won't work.

E.g. if TI/Rockchip implements SCMI, they can continue using these
drivers as along as it does the job of "ringing the doorbell".

They may be passing some data today because their existing remote
firmware expects it. With SCMI, they don't have to. These existing
drivers are doing additional job in the current form: passing some data
along with triggering the remote doorbell. We just need latter in SCMI
case as we don't need any data in the transport as it's all part of shmem.

Why do you think that won't work ? Remember all the platform specific
stuff(if platform implement own protocols) in SCMI is moved to the
shared memory and transport just needs to do "doorbell". So I disagree
with your concern unless I am missing something.

> 
>  To achieve that, we can either do similar to what platforms with DWC3
> do - generic dwc3 child node of platform specific parent node. Or we can have
> the SCMI protocol implemented as a library that platforms can init and use.
> Or any other better way.
> 
>  I just think it is a bad idea to rule out all but one classes of mailbox controllers.
> 

Definitely neither SCMI specification nor SCMI driver is ruling out any
class of mailbox controllers as long as there are capable of signaling
the other end that "hey look you have something to check in shared
memory" which I think is the case with most of the controllers.

To be honest this whole mailbox framework is somewhat complex for simple
doorbell kind of this, but hey I am not complaining ;).

-- 
Regards,
Sudeep

  reply	other threads:[~2017-07-07 17:39 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 15:55 [PATCH 0/9] firmware: ARM System Control and Management Interface(SCMI) support Sudeep Holla
2017-06-26 15:55 ` Sudeep Holla
2017-06-26 15:55 ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 1/9] Documentation: dt-bindings: add support for mailbox client shared memory Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-28 22:56   ` Rob Herring
2017-06-28 22:56     ` Rob Herring
2017-06-28 22:56     ` Rob Herring
2017-06-30 10:24     ` Sudeep Holla
2017-06-30 10:24       ` Sudeep Holla
2017-06-30 10:24       ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 2/9] Documentation: add DT binding for ARM System Control and Management Interface(SCMI) protocol Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-28 23:04   ` Rob Herring
2017-06-28 23:04     ` Rob Herring
2017-06-28 23:04     ` Rob Herring
2017-06-30 10:31     ` Sudeep Holla
2017-06-30 10:31       ` Sudeep Holla
2017-06-30 10:31       ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 3/9] firmware: arm_scmi: add basic driver infrastructure for SCMI Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-07-07 16:52   ` Jassi Brar
2017-07-07 17:39     ` Sudeep Holla [this message]
2017-07-07 17:39       ` Sudeep Holla
2017-07-07 17:39       ` Sudeep Holla
2017-07-08  5:32       ` Jassi Brar
2017-07-08  5:32         ` Jassi Brar
2017-07-24  9:50         ` Sudeep Holla
2017-07-24  9:50           ` Sudeep Holla
2017-07-24  9:50           ` Sudeep Holla
2017-07-24 15:41           ` Jassi Brar
2017-07-24 15:41             ` Jassi Brar
2017-07-24 15:41             ` Jassi Brar
2017-07-24 16:21             ` Sudeep Holla
2017-07-24 16:21               ` Sudeep Holla
2017-07-24 16:21               ` Sudeep Holla
2017-07-24 17:21               ` Jassi Brar
2017-07-24 17:21                 ` Jassi Brar
2017-07-24 17:21                 ` Jassi Brar
2017-07-24 17:30                 ` Sudeep Holla
2017-07-24 17:30                   ` Sudeep Holla
2017-07-24 17:30                   ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 4/9] firmware: arm_scmi: add common infrastructure and support for base protocol Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 5/9] firmware: arm_scmi: add initial support for performance protocol Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 6/9] firmware: arm_scmi: add initial support for clock protocol Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 7/9] firmware: arm_scmi: add initial support for power protocol Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 8/9] firmware: arm_scmi: add initial support for sensor protocol Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55   ` Sudeep Holla
2017-06-26 15:55 ` [PATCH 9/9] firmware: arm_scmi: probe and initialise all the supported protocols Sudeep Holla
2017-06-26 15:55   ` 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=5f2e4f3c-297b-c5f8-9244-399c1c4e2c21@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=alexey.klimov@arm.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=harba@codeaurora.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=lho@apm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=neko@bakuhatsu.net \
    --cc=nm@ti.com \
    --cc=robh@kernel.org \
    --cc=roy.franz@cavium.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.