All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bean Huo <jackyard88@gmail.com>
To: richard@nod.at, dedekind1@gmail.com, adrian.hunter@intel.com,
	computersforpeace@gmail.com, boris.brezillon@free-electrons.com
Cc: beanhuo@micron.com, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org, zszubbocsev@micron.com,
	peterpandong@micron.com
Subject: [PATCH v2 06/17] drivers:mtd:ubi:add bakvol function define in ubi layer
Date: Tue,  2 Feb 2016 02:30:41 +0000	[thread overview]
Message-ID: <1454380252-16170-7-git-send-email-jackyard88@gmail.com> (raw)
In-Reply-To: <1454380252-16170-1-git-send-email-jackyard88@gmail.com>

From: Bean Huo <beanhuo@micron.com>

This file patch is to add bakvol function define in ubi layer and
add bakvol point in ubi_device structure. Add one new parameter for ubi layer write
function, in order to indicate if this time programming data should be protected.

Signed-off-by: BeanHuo <beanhuo@micron.com>
---
 drivers/mtd/ubi/ubi.h | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 2974b67..4a80359 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -438,6 +438,7 @@ struct ubi_debug_info {
  * @vtbl_slots: how many slots are available in the volume table
  * @vtbl_size: size of the volume table in bytes
  * @vtbl: in-RAM volume table copy
+ * @bkblk_tbl: backup block table
  * @device_mutex: protects on-flash volume table and serializes volume
  *                creation, deletion, update, re-size, re-name and set
  *                property
@@ -547,6 +548,7 @@ struct ubi_device {
 	int vtbl_slots;
 	int vtbl_size;
 	struct ubi_vtbl_record *vtbl;
+	struct ubi_bkblk_tbl *bkblk_tbl;
 	struct mutex device_mutex;
 
 	int max_ec;
@@ -797,6 +799,20 @@ int ubi_vtbl_rename_volumes(struct ubi_device *ubi,
 			    struct list_head *rename_list);
 int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai);
 
+/* bakvol.c*/
+int ubi_check_bakvol_module(struct ubi_device *ubi);
+int ubi_duplicate_data_to_bakvol(struct ubi_device *ubi, loff_t addr,
+		size_t len, size_t *retlen, const void *buf);
+int ubi_bakvol_module_init(struct ubi_device *ubi);
+int ubi_bakvol_peb_scan(struct ubi_device *ubi,
+			struct ubi_vid_hdr *vidh, int pnum);
+int ubi_bakvol_module_init_tail(struct ubi_device *ubi,
+				struct ubi_attach_info *si);
+int ubi_corrupted_data_recovery(struct ubi_volume_desc *desc);
+int is_backup_need(struct ubi_device *ubi, loff_t addr);
+void init_bakvol(struct ubi_volume_desc *desc, uint8_t choice);
+void clear_bakvol(struct ubi_device *ubi);
+
 /* vmt.c */
 int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req);
 int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl);
@@ -846,6 +862,7 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap,
 
 /* wl.c */
 int ubi_wl_get_peb(struct ubi_device *ubi);
+int ubi_wl_get_plane_peb(struct ubi_device *ubi, int plane);
 int ubi_wl_put_peb(struct ubi_device *ubi, int vol_id, int lnum,
 		   int pnum, int torture);
 int ubi_wl_flush(struct ubi_device *ubi, int vol_id, int lnum);
@@ -864,7 +881,7 @@ int ubi_ensure_anchor_pebs(struct ubi_device *ubi);
 int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
 		int len);
 int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
-		 int len);
+		 int len, int safeguard);
 int ubi_io_sync_erase(struct ubi_device *ubi, int pnum, int torture);
 int ubi_io_is_bad(const struct ubi_device *ubi, int pnum);
 int ubi_io_mark_bad(const struct ubi_device *ubi, int pnum);
@@ -1054,10 +1071,10 @@ static inline int ubi_io_read_data(const struct ubi_device *ubi, void *buf,
  * physical eraseblock.
  */
 static inline int ubi_io_write_data(struct ubi_device *ubi, const void *buf,
-				    int pnum, int offset, int len)
+				    int pnum, int offset, int len, int safeguard)
 {
 	ubi_assert(offset >= 0);
-	return ubi_io_write(ubi, buf, pnum, offset + ubi->leb_start, len);
+	return ubi_io_write(ubi, buf, pnum, offset + ubi->leb_start, len, safeguard);
 }
 
 /**
-- 
1.9.1

  parent reply	other threads:[~2016-02-02  2:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02  2:30 [PATCH v2 00/17] Add a bakvol module in UBI layer for MLC paired page power loss issue Bean Huo
2016-02-02  2:30 ` [PATCH v2 01/17] include:mtd:add multi-plane page program command Bean Huo
2016-02-02  2:30 ` [PATCH v2 02/17] include:mtd:add multi-plane program in mtd_info Bean Huo
2016-02-02  2:30 ` [PATCH v2 03/17] drivers:mtd:add dual plane page program support in partition layer Bean Huo
2016-02-02  3:00   ` kbuild test robot
2016-02-02  2:30 ` [PATCH v2 04/17] drivers:mtd:nand:enable dual plane page program function Bean Huo
2016-02-02  3:04   ` kbuild test robot
2016-02-02  2:30 ` [PATCH v2 05/17] drivers:mtd:ubi:add bakvol on-flash and RAM data structures Bean Huo
2016-02-02  2:30 ` Bean Huo [this message]
2016-02-02  3:05   ` [PATCH v2 06/17] drivers:mtd:ubi:add bakvol function define in ubi layer kbuild test robot
2016-02-02  3:08   ` kbuild test robot
2016-02-02  2:30 ` [PATCH v2 07/17] fs:ubifs:add bakvol function define in ubifs layer Bean Huo
2016-02-02  2:30 ` [PATCH v2 08/17] drivers:mtd:ubi:disable bakvol function while writing volume table Bean Huo
2016-02-02  2:30 ` [PATCH v2 09/17] drivers:mtd:ubi:get PEB according to specfied plane number Bean Huo
2016-02-02  2:30 ` [PATCH v2 10/17] drivers:mtd:ubi:enable bakvol function for fastmap operation Bean Huo
2016-02-02  2:30 ` [PATCH v2 11/17] drivers:mtd:ubi:add disable/enable bakvol while ubi write Bean Huo
2016-02-02  2:30 ` [PATCH v2 12/17] drivers:mtd:ubi:add disable bakvol while ubi detach Bean Huo
2016-02-02  2:30 ` [PATCH v2 13/17] drivers:mtd:ubi:add bakvol init while attach ubi Bean Huo
2016-02-02  2:30 ` [PATCH v2 14/17] drivers:mtd:ubi:add backup operation in ubi_io_write Bean Huo
2016-02-02  3:22   ` kbuild test robot
2016-02-02  2:30 ` [PATCH v2 15/17] fs:ubifs:enable bakvol module and recover operation Bean Huo
2016-02-02  2:30   ` Bean Huo
2016-02-02  2:30 ` [PATCH v2 16/17] driver:mtd:ubi:add new bakvol module in ubi layer Bean Huo
2016-02-02  2:30 ` [PATCH v2 17/17] drivers:mtd:ubi: Kconfig Makefile Bean Huo
2016-02-02  3:22   ` kbuild test robot
2016-02-02  3:56   ` kbuild test robot
2016-02-02  3:58   ` kbuild test robot
2016-02-02  4:15     ` Bean Huo 霍斌斌 (beanhuo)
2016-02-03  0:46       ` Brian Norris
2016-02-03  6:14         ` Bean Huo 霍斌斌 (beanhuo)
2016-02-02 23:06 ` [PATCH v2 00/17] Add a bakvol module in UBI layer for MLC paired page power loss issue Richard Weinberger
2016-02-03  6:11   ` Bean Huo 霍斌斌 (beanhuo)

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=1454380252-16170-7-git-send-email-jackyard88@gmail.com \
    --to=jackyard88@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=beanhuo@micron.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=peterpandong@micron.com \
    --cc=richard@nod.at \
    --cc=zszubbocsev@micron.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 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.