mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Teresa Remmet <t.remmet@phytec.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/4] mtd: UBI: Add support for updating static volumes
Date: Thu, 23 Jun 2016 14:11:43 +0200	[thread overview]
Message-ID: <1466683903.4981.9.camel@lws-tremmet.phytec.de> (raw)
In-Reply-To: <20160623063627.GH4750@pengutronix.de>

Hello Sascha,

Am Donnerstag, den 23.06.2016, 08:36 +0200 schrieb Sascha Hauer:
> Hi Teresa,
> 
> On Wed, Jun 22, 2016 at 11:02:39AM +0200, Teresa Remmet wrote:
> > Added support to update UBI static volumes in barebox.
> > This is mainly realized with adding the ioctl UBI_IOCVOLUP.
> > 
> > Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> > ---
> >  drivers/mtd/ubi/barebox.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
> >  drivers/mtd/ubi/upd.c     | 12 ----------
> >  2 files changed, 54 insertions(+), 14 deletions(-)
> > 
> 
> >  
> >  int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> > @@ -179,6 +227,10 @@ int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> >  	cdev->name = basprintf("%s.%s", ubi->cdev.name, vol->name);
> >  	cdev->priv = priv;
> >  	cdev->size = vol->used_bytes;
> > +
> > +	if (vol->vol_type == UBI_STATIC_VOLUME)
> > +		cdev->flags = DEVFS_IS_CHARACTER_DEV;
> > +
> >  	cdev->dev = &vol->dev;
> >  	ubi_msg(ubi, "registering %s as /dev/%s", vol->name, cdev->name);
> >  	ret = devfs_create(cdev);
> > diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
> > index 33d4dbf..e3deb3e 100644
> > --- a/drivers/mtd/ubi/upd.c
> > +++ b/drivers/mtd/ubi/upd.c
> > @@ -368,18 +368,6 @@ int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,
> >  	}
> >  
> >  	ubi_assert(vol->upd_received <= vol->upd_bytes);
> > -	if (vol->upd_received == vol->upd_bytes) {
> > -		err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL);
> > -		if (err)
> > -			return err;
> > -		/* The update is finished, clear the update marker */
> > -		err = clear_update_marker(ubi, vol, vol->upd_bytes);
> > -		if (err)
> > -			return err;
> > -		vol->updating = 0;
> > -		err = to_write;
> > -		vfree(vol->upd_buf);
> > -	}
> 
> Why is this removed? Does it still work to just write to the UBI volume
> without this?

writing directly to a dynamic volume never seem to hits this condition.
So this is not causing any problems. clearing updater marker and so on
is done later in ubi_volume_cdev_close(struct cdev *cdev). 
Keeping this causes a assertion for static volumes as the update marker
is cleared twice.

Teresa


> 
> Sascha
> 



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

  reply	other threads:[~2016-06-23 12:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22  9:02 [PATCH 1/4] commands: ubimkvol: Add option for " Teresa Remmet
2016-06-22  9:02 ` [PATCH 2/4] mtd: UBI: Add support for updating " Teresa Remmet
2016-06-23  6:36   ` Sascha Hauer
2016-06-23 12:11     ` Teresa Remmet [this message]
2016-06-22  9:02 ` [PATCH 3/4] commands: ubi: Add ubiupdatevol command Teresa Remmet
2016-06-23  6:43   ` Sascha Hauer
2016-06-23 14:00     ` Teresa Remmet
2016-06-22  9:02 ` [PATCH 4/4] ARM: am335x_defconfig: Enable ubi fastmap and ubifs Teresa Remmet

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=1466683903.4981.9.camel@lws-tremmet.phytec.de \
    --to=t.remmet@phytec.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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