mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Çağlar Kilimci" <ckilimci@gmail.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: Reach out "dirty" state value
Date: Tue, 25 Apr 2017 08:42:25 +0200	[thread overview]
Message-ID: <20170425064225.ubl6v2fdorcfbu63@pengutronix.de> (raw)
In-Reply-To: <CAGUZs0=NzW1dFyjRus0b_WzUMkoBwiL9A4f9U5ZWqH6q1r3jxw@mail.gmail.com>

On Tue, Apr 25, 2017 at 09:08:25AM +0300, Çağlar Kilimci wrote:
> Hi Sascha,
> 
> 2017-04-25 8:51 GMT+03:00 Sascha Hauer <s.hauer@pengutronix.de>:
> > Hi Çağlar,
> >
> > On Mon, Apr 24, 2017 at 11:20:47AM +0300, Çağlar Kilimci wrote:
> >> Hi all,
> >>
> >> I would like to use state framework and now I can read variables from
> >> both barebox and regular kernel space. In addition, if I can change
> >> from barebox, I can successfully read the changes from kernel space
> >> but if I change from kernel space, I could not reach out the new value
> >> from barebox. The dirty variable is set and I can see the new value
> >> from eeprom (where I store the values) but I guess there would be
> >> better way to reach out the "dirty" values. So, how can I read last
> >> value for that state variable?
> >
> > If you get outdated variables in barebox that's a bug. You are on latest
> > master, right? Do you have stridesize specified in the devicetree?
> 
> Yes, I am on the latest master. And yes, I have specified stridsize.
> Here is my of_dump of my state device:
> 
> barebox@Phytec phyCORE AM335x:/ of_dump /state
> state {
>         magic = <0x4aaef393>;
>         compatible = "barebox,state";
>         backend-type = "raw";
>         backend = <0x3f>;
>         backend-storage-type = "direct";
>         backend-stridesize = <0x10>;

The stridesize is too small. It must be at least the size of one state
instance storage space which is the size of your data (0x20) and the
size of the header (0xc), so total 0x2c. However, I recommend a bigger
value, maybe 0x40 or 0x80.
There should be an error message when the stridesize is too small.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-04-25  6:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24  8:20 Çağlar Kilimci
2017-04-25  5:51 ` Sascha Hauer
2017-04-25  6:08   ` Çağlar Kilimci
2017-04-25  6:42     ` Sascha Hauer [this message]
2017-04-25  9:17       ` Çağlar Kilimci
2017-04-25 13:08         ` Çağlar Kilimci
2017-04-25 13:24           ` Çağlar Kilimci

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=20170425064225.ubl6v2fdorcfbu63@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ckilimci@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox