All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fw_env: Make env flash lock optional
@ 2016-06-02  7:09 dirk.eibach at gdsys.cc
  2016-06-02  8:14 ` Anatolij Gustschin
  2016-06-05 13:54 ` Fabio Estevam
  0 siblings, 2 replies; 9+ messages in thread
From: dirk.eibach at gdsys.cc @ 2016-06-02  7:09 UTC (permalink / raw)
  To: u-boot

From: Dirk Eibach <dirk.eibach@gdsys.cc>

Since locking flash is horribly broken on some platforms,
offer an option to build fw_env tools without locking.

Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>

---

 tools/env/fw_env.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 06cf63d..e47232a 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -908,8 +908,10 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
 			return -1;
 		}
 
+#ifndef NO_MEMLOCK
 		if (mtd_type != MTD_ABSENT)
 			ioctl(fd, MEMLOCK, &erase);
+#endif
 
 		processed  += erasesize;
 		block_seek = 0;
@@ -941,7 +943,9 @@ static int flash_flag_obsolete (int dev, int fd, off_t offset)
 	}
 	ioctl (fd, MEMUNLOCK, &erase);
 	rc = write (fd, &obsolete_flag, sizeof (obsolete_flag));
+#ifndef NO_MEMLOCK
 	ioctl (fd, MEMLOCK, &erase);
+#endif
 	if (rc < 0)
 		perror ("Could not set obsolete flag");
 
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-06-05 13:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02  7:09 [U-Boot] [PATCH] fw_env: Make env flash lock optional dirk.eibach at gdsys.cc
2016-06-02  8:14 ` Anatolij Gustschin
2016-06-02  8:27   ` Dirk Eibach
2016-06-02  9:12     ` Andreas Fenkart
2016-06-02 13:36     ` Wolfgang Denk
2016-06-02 18:57       ` Dirk Eibach
2016-06-02 19:26         ` Tom Rini
2016-06-05 11:44         ` Wolfgang Denk
2016-06-05 13:54 ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.