public inbox for linux-remoteproc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jitendra Sharma <shajit@codeaurora.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] remoteproc: Remove null character write of shared mem
Date: Thu, 8 Feb 2018 14:42:37 +0530	[thread overview]
Message-ID: <d097d5db-b68c-6a29-2032-bb62e8d08d09@codeaurora.org> (raw)
In-Reply-To: <20180207152753.GO9465@builder>

Hi Bjorn,


On 2/7/2018 8:57 PM, Bjorn Andersson wrote:
> On Wed 07 Feb 05:22 PST 2018, Jitendra Sharma wrote:
>
>> remoteproc is writing '\0' in the shared mem region. This
>> region is shared among multiple clients that are also trying
>> to read. Hence they miss first character.
>>
>> Remove this null character write, as this mem area is
>> supposed to be Read only.
>>
>> Further during every subsystem reboot, this region is
>> initialized with default, hence no need to write this
>> region.
> Thanks for your patch Jitendra!
>
> The write was removed from the downstream kernel in msm-4.9, late last
> year. Can you please confirm that you describe here is valid for
> platforms supported prior to this change as well?
>
> E.g. is what you're describing true for wcnss on 8064, adsp on 8974 and
> mpss on 8916?
To provide a history.
We got a internal request, where during subsystem crash/restart, in our 
recovery path, we try to get the cause of crash by reading shared memory 
region.
But, because in recovery path we write null to first character of shared 
memory string. So, any other client which in the meantime try to dump 
the crash region will miss first character of crash region.
For example: actual "err_crash_reason " will be read by other interested 
clients as "rr_crash_reason"

Now as this piece of code is present since long 3.10,3.18,4.4 time, so 
we were not sure of this snippet's reason of existence. Here, initially 
we tried to find out reason for this null write, where we guessed this 
snippet is lying there to ensure, that across subsequent crashes, we 
always get a new updated reason/string(as we are writing null to first 
character of shared mem) and not some older stale string.

But this understanding was rejected by subsystem owners saying that 
crash reason, shared memory item is re-initialized at non-HLOS bootup so 
it will get clear automatically.Hence, there is no need to write null 
character.

So, because of above reason, we could say that this snippet is causing a 
bug and should be fixed and this change should be valid for any platform.
>
> Regards,
> Bjorn

  reply	other threads:[~2018-02-08  9:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 13:22 [PATCH] remoteproc: Remove null character write of shared mem Jitendra Sharma
2018-02-07 15:27 ` Bjorn Andersson
2018-02-08  9:12   ` Jitendra Sharma [this message]
2018-02-12 18:39     ` Bjorn Andersson
2018-02-13  7:12       ` Jitendra Sharma
2018-04-05  8:59         ` Jitendra Sharma

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=d097d5db-b68c-6a29-2032-bb62e8d08d09@codeaurora.org \
    --to=shajit@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.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