All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	Punit Agrawal <Punit.Agrawal@arm.com>,
	"Jon Medhurst (Tixy)" <tixy@linaro.org>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Kevin Hilman <khilman@kernel.org>
Subject: Re: [PATCH v5 2/8] firmware: add support for ARM System Control and Power Interface(SCPI) protocol
Date: Wed, 29 Jul 2015 09:38:24 +0100	[thread overview]
Message-ID: <55B89100.3020802@arm.com> (raw)
In-Reply-To: <CABb+yY3cXP07+Go=XUPkuLU7fJER99z4Uyt+wdKpgTDrxeLOCA@mail.gmail.com>



On 29/07/15 09:05, Jassi Brar wrote:
> On Thu, Jul 23, 2015 at 4:40 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> ...
>
>> +static int scpi_probe(struct platform_device *pdev)
>> +{
>> +       int count, idx, ret;
>> +       struct resource res;
>> +       struct scpi_chan *scpi_chan;
>> +       struct device *dev = &pdev->dev;
>> +       struct device_node *np = dev->of_node;
>> +
>> +       scpi_info = devm_kzalloc(dev, sizeof(*scpi_info), GFP_KERNEL);
>> +       if (!scpi_info)
>> +               return -ENOMEM;
>> +
>> +       count = of_count_phandle_with_args(np, "mboxes", "#mbox-cells");
>> +       if (count < 0) {
>> +               dev_err(dev, "no mboxes property in '%s'\n", np->full_name);
>> +               return -ENODEV;
>> +       }
>> +
>> +       scpi_chan = devm_kcalloc(dev, count, sizeof(*scpi_chan), GFP_KERNEL);
>> +       if (!scpi_chan)
>> +               return -ENOMEM;
>> +
>> +       for (idx = 0; idx < count; idx++) {
>> +               resource_size_t size;
>> +               struct scpi_chan *pchan = scpi_chan + idx;
>> +               struct mbox_client *cl = &pchan->cl;
>> +               struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
>> +
>> +               if (of_address_to_resource(shmem, 0, &res)) {
>> +                       dev_err(dev, "failed to get SCPI payload mem resource\n");
>> +                       ret = -EINVAL;
>> +                       goto err;
>> +               }
>> +
>> +               size = resource_size(&res);
>> +               pchan->rx_payload = devm_ioremap(dev, res.start, size);
>> +               if (!pchan->rx_payload) {
>> +                       dev_err(dev, "failed to ioremap SCPI payload\n");
>> +                       ret = -EADDRNOTAVAIL;
>> +                       goto err;
>> +               }
>> +               pchan->tx_payload = pchan->rx_payload + (size >> 1);
>> +
>> +               cl->dev = dev;
>> +               cl->rx_callback = scpi_handle_remote_msg;
>> +               cl->tx_prepare = scpi_tx_prepare;
>> +               cl->tx_block = true;
>> +               cl->tx_tout = 50;
>> +               cl->knows_txdone = false; /* controller can ack */
>>
>   This is the cause of your problems that you think should be solved by
> using hrtimer.
>

Ah sorry, it's stupid mistake on my part while writing the comment. It
should have been controller can't ack, fixed locally now thanks for
pointing it out.

>   Controller may or may not (like MHU) set txdone_irq. However every
> scpi command (struct scpi_ops members) is replied to as a response
> packet reporting success or failure.

No that's not true, I have already mentioned that couple of times in the
other thread. It's just wrong comment here which went unnoticed from
day#1, sorry for that.

> So the client should set 'knows_txdone' to be true unless it is told
> the controller on that platform supports txdone_irq (what you call
> 'ack').
>

I got the concept but SCP can't ack via protocol, protocol has no such
provision and it sets flags in MHU status register.

Regards,
Sudeep

  reply	other threads:[~2015-07-29  8:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 11:10 [PATCH v5 0/8] ARM64: juno: add SCPI mailbox protocol, clock and CPUFreq support Sudeep Holla
     [not found] ` <1437649828-14540-1-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2015-07-23 11:10   ` [PATCH v5 1/8] Documentation: add DT binding for ARM System Control and Power Interface(SCPI) protocol Sudeep Holla
2015-07-23 11:10     ` Sudeep Holla
     [not found]     ` <1437649828-14540-2-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2015-07-28 10:22       ` Sudeep Holla
2015-07-28 10:22         ` Sudeep Holla
2015-07-31 16:00     ` Mark Rutland
2015-07-31 16:07       ` Sudeep Holla
2015-07-31 16:07         ` Sudeep Holla
2015-07-23 11:10 ` [PATCH v5 2/8] firmware: add support " Sudeep Holla
2015-07-29  8:05   ` Jassi Brar
2015-07-29  8:38     ` Sudeep Holla [this message]
2015-07-29 11:19       ` Jassi Brar
2015-07-29 12:50         ` Sudeep Holla
2015-07-30 17:56           ` Jassi Brar
2015-07-31  9:21             ` Sudeep Holla
2015-07-31  9:40             ` Sudeep Holla
2015-07-31 10:38               ` Jassi Brar
2015-07-31 10:43                 ` Sudeep Holla
2015-07-31 13:08                   ` Sudeep Holla
2015-07-31 13:45                     ` Jassi Brar
2015-08-05 10:57                       ` Sudeep Holla
2015-07-23 11:10 ` [PATCH v5 3/8] clk: add support for clocks provided by SCP(System Control Processor) Sudeep Holla
2015-07-28 10:21   ` Sudeep Holla
2015-07-29 17:37   ` Stephen Boyd
2015-07-30  9:12     ` Sudeep Holla
2015-07-31  6:26       ` Stephen Boyd
2015-07-23 11:10 ` [PATCH v5 4/8] clk: scpi: add support for cpufreq virtual device Sudeep Holla
2015-07-23 11:10 ` [PATCH v5 5/8] cpufreq: arm_big_little: add SCPI interface driver Sudeep Holla
2015-07-28 10:20   ` Sudeep Holla
2015-07-23 11:10 ` [PATCH v5 6/8] arm64: dts: add SRAM, MHU mailbox and SCPI support on Juno Sudeep Holla
2015-07-23 11:10 ` [PATCH v5 7/8] arm64: dts: add CPU topology " Sudeep Holla
2015-07-23 11:10 ` [PATCH v5 8/8] arm64: dts: add clock support for all the cpus 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=55B89100.3020802@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=Punit.Agrawal@arm.com \
    --cc=arnd@arndb.de \
    --cc=jassisinghbrar@gmail.com \
    --cc=khilman@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=tixy@linaro.org \
    /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.