linux-kernel.vger.kernel.org archive mirror
 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: Fri, 31 Jul 2015 10:21:25 +0100	[thread overview]
Message-ID: <55BB3E15.9030405@arm.com> (raw)
In-Reply-To: <CABb+yY18VirP5oaJM9bhDyiY5SgDW-xXXY9xv8pqL2uQpT0WBg@mail.gmail.com>



On 30/07/15 18:56, Jassi Brar wrote:
> On Wed, Jul 29, 2015 at 6:20 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> On 29/07/15 12:19, Jassi Brar wrote:
>>
>>> Assuming the former, let me explain. When a client receives a
>>> response, it can be sure that the request has already been read by the
>>> remote.
>>
>> Waiting for the response would be too late for few expensive commands
>> (e.g setting up external regulators). The remote firmware acknowledges
>> Tx by setting status flags and will be ready to accept new commands.
>>
> No. Polling still happens. If anything, mbox_client_txdone() should
> only speed up things.
>

Yes I understand and that's good.

>>> If the protocol specifies every request has some response, the
>>
>> Not always true there can be few commands without response. The protocol
>> specifies that we need check the status flag before sending the new
>> command as it's bidirectional, hence polling is recommended (Section 2.2
>> Communication flow in the SCPI specification)
>>
> mbox_client_txdone() will only be called for commands that has some
> response. Commands that don't have a response would be completed by
> polling.
>

OK, got it

>>> client should assert 'knows_txdone' and call mbox_client_txdone() upon
>>> receiving a reply packet.
>>
>> Since this is not always true and not recommended in the specification,
>> I am hesitant to use this option as the firmware can always change their
>> internal mechanics without breaking the protocol. We need to ensure we are
>> compliant to the spec.
>>
> I don't see how it could break compliance.
>

While I agree it shouldn't, the firmware guys won't support if we
deviate from the spec. I won't get support for firmware bug fixes in
that case.

Having said that, I don't rule out the usage of TX_BY_ACK, I will need
more time for testing(usually we stress test firmware using Linux for
few of days continuously as we have hit issues after that :)) and
getting things fixed if anything breaks.

>>> So I said,  cl->knows_txdone = false;   is the root of problems you
>>
>> It could be and won't rule that out. I would prefer using knows_txdone
>> and use mbox_client_txdone if feasible, but I can't as the without
>> violating the specification.
>>
>> FYI, I had tried it and ended up with issues in the firmware. The
>> argument from the firmware is that we aren't specification compliant,
>> so I had to use polling.
>>
> I am sure you would have copy of that discarded code. Care to share? I
> can't imagine how we handle completions locally could affect the
> remote. The mbox_client_txdone() is untested so I don't rule out bugs,
> otherwise it should only make things better.
>

I tested it with very old firmware almost 4-5 months back. I don't have
the patch on top of this series handy, but will dig it out and give it a
try with latest firmware. I will let you know the results.

For now, I would keep this just polling and unblock others who are
waiting on this series.

Regards,
Sudeep

  reply	other threads:[~2015-07-31  9:21 UTC|newest]

Thread overview: 29+ 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
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-28 10:22   ` Sudeep Holla
2015-07-31 16:00   ` Mark Rutland
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
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 [this message]
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=55BB3E15.9030405@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 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).