From: sudeep.holla@arm.com (Sudeep Holla)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros
Date: Wed, 19 Oct 2016 11:37:23 +0100 [thread overview]
Message-ID: <d243c5f3-91b3-46ee-c456-49d3c9886742@arm.com> (raw)
In-Reply-To: <24e6ef19-b88d-a5b8-f514-d39a7b5725e8@baylibre.com>
On 19/10/16 11:28, Neil Armstrong wrote:
> On 10/17/2016 01:16 PM, Sudeep Holla wrote:
[...]
>>
>> and the above 2 can be moved out of the conditions, no ?
>>
>> if (scpi_info->is_legacy) {
>> struct legacy_scpi_shared_mem *mem = ch->rx_payload;
>> len = match->rx_len;
>> } else {
>> struct scpi_shared_mem *mem = ch->rx_payload;
>> len = min(match->rx_len, CMD_SIZE(cmd));
>> }
>> match->status = le32_to_cpu(mem->status);
>> memcpy_fromio(match->rx_buf, mem->payload, len);
>>
>> should work.
>
> Well, we will have "error: ?mem? undeclared (first use in this
> function)" since mem is not declared outside the if/else.
>
> I don't see good solutions even with an union.
Right, I missed to see that. You can leave it as you had before then.
[...]
>>>>> if (t->rx_buf) {
>>>>> if (!(++ch->token))
>>>>> ++ch->token;
>>>>> ADD_SCPI_TOKEN(t->cmd, ch->token);
>>>>> + if (scpi_info->is_legacy)
>>>>> + t->slot = t->cmd;
>>>>
>>>> I thought passing token was not an issue from your previous response,
>>>> but you are overriding it here, why ?
>>>
>>> Indeed, I can leave it, but it's useless since it won't serve to
>>> distinguish multiple similar commands.
>>>
>>
>> OK, I don't see any point in such micro optimization, so please retain it.
>>
>
> I misread my code, I leaved the token passing, but I copy back the
> cmd to the slot which is used by the MHU.
> If I remove the "t->slot = t->cmd;", the token won't be passed to the
> FW.
>
Right, sorry I think I misled you :)
--
Regards,
Sudeep
next prev parent reply other threads:[~2016-10-19 10:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 7:33 [PATCH v4 0/8] Add support for legacy SCPI protocol Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 1/8] scpi: Add cmd indirection table to prepare for legacy commands Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 2/8] scpi: Add alternative legacy structures, functions and macros Neil Armstrong
2016-10-10 14:36 ` Sudeep Holla
2016-10-17 8:25 ` Neil Armstrong
2016-10-17 11:16 ` Sudeep Holla
2016-10-19 10:28 ` Neil Armstrong
2016-10-19 10:37 ` Sudeep Holla [this message]
2016-10-19 10:42 ` Sudeep Holla
2016-10-05 7:33 ` [PATCH v4 3/8] scpi: Do not fail if get_capabilities is not implemented Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 4/8] scpi: Add support for Legacy match table for Amlogic GXBB SoC Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 5/8] scpi: grow MAX_DVFS_OPPS to 16 entries Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 6/8] dt-bindings: Add support for Amlogic GXBB SCPI Interface Neil Armstrong
2016-10-29 18:39 ` Olof Johansson
2016-11-02 22:20 ` Sudeep Holla
2016-11-03 3:51 ` Rob Herring
2016-11-03 4:37 ` Sudeep Holla
2016-11-03 8:48 ` Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 7/8] ARM64: dts: meson-gxbb: Add SRAM node Neil Armstrong
2016-10-05 7:33 ` [PATCH v4 8/8] ARM64: dts: meson-gxbb: Add SCPI with cpufreq & sensors Nodes Neil Armstrong
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=d243c5f3-91b3-46ee-c456-49d3c9886742@arm.com \
--to=sudeep.holla@arm.com \
--cc=linus-amlogic@lists.infradead.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
all inboxes | Powered by JetHome®