All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: boris.brezillon@free-electrons.com, dedekind1@gmail.com,
	goliath@sigma-star.at, alex@nextthing.co, beanhuo@micron.com,
	Richard Weinberger <richard@nod.at>
Subject: [PATCH 04/13] ubi: Kill ubi->alc_mutex
Date: Mon, 30 May 2016 14:04:25 +0200	[thread overview]
Message-ID: <1464609874-15488-5-git-send-email-richard@nod.at> (raw)
In-Reply-To: <1464609874-15488-1-git-send-email-richard@nod.at>

With our new work model work can never run in parallel.
So, the serialization mutex is in vain

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/eba.c | 6 ------
 drivers/mtd/ubi/ubi.h | 2 --
 2 files changed, 8 deletions(-)

diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index 5780dd1..32938aa 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -920,9 +920,6 @@ write_error:
  * data, which has to be aligned. This function guarantees that in case of an
  * unclean reboot the old contents is preserved. Returns zero in case of
  * success and a negative error code in case of failure.
- *
- * UBI reserves one LEB for the "atomic LEB change" operation, so only one
- * LEB change may be done at a time. This is ensured by @ubi->alc_mutex.
  */
 int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
 			      int lnum, const void *buf, int len)
@@ -949,7 +946,6 @@ int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
 	if (!vid_hdr)
 		return -ENOMEM;
 
-	mutex_lock(&ubi->alc_mutex);
 	err = leb_write_lock(ubi, vol_id, lnum);
 	if (err)
 		goto out_mutex;
@@ -1006,7 +1002,6 @@ retry:
 out_leb_unlock:
 	leb_write_unlock(ubi, vol_id, lnum);
 out_mutex:
-	mutex_unlock(&ubi->alc_mutex);
 	ubi_free_vid_hdr(ubi, vid_hdr);
 	return err;
 
@@ -1389,7 +1384,6 @@ int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
 	dbg_eba("initialize EBA sub-system");
 
 	spin_lock_init(&ubi->ltree_lock);
-	mutex_init(&ubi->alc_mutex);
 	ubi->ltree = RB_ROOT;
 
 	ubi->global_sqnum = ai->max_sqnum + 1;
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 4486869..efdff07 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -454,7 +454,6 @@ struct ubi_debug_info {
  * @global_sqnum: global sequence number
  * @ltree_lock: protects the lock tree and @global_sqnum
  * @ltree: the lock tree
- * @alc_mutex: serializes "atomic LEB change" operations
  *
  * @fm_disabled: non-zero if fastmap is disabled (default)
  * @fm: in-memory data structure of the currently used fastmap
@@ -565,7 +564,6 @@ struct ubi_device {
 	unsigned long long global_sqnum;
 	spinlock_t ltree_lock;
 	struct rb_root ltree;
-	struct mutex alc_mutex;
 
 	/* Fastmap stuff */
 	int fm_disabled;
-- 
2.7.3

  parent reply	other threads:[~2016-05-30 12:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 12:04 [RFC] UBI: MLC Support v0 Richard Weinberger
2016-05-30 12:04 ` [PATCH 01/13] ubi: Undo "UBI: modify ubi_wl_flush function to clear work queue for a lnum" Richard Weinberger
2016-05-30 12:04 ` [PATCH 02/13] ubi: Rework UBI worker Richard Weinberger
2016-05-30 12:04 ` [PATCH 03/13] ubi: auto re-size after UBI thread is ready Richard Weinberger
2016-05-30 12:04 ` Richard Weinberger [this message]
2016-05-30 14:05   ` [PATCH 04/13] ubi: Kill ubi->alc_mutex Richard Weinberger
2016-05-30 12:04 ` [PATCH 05/13] ubi: Get rid of __schedule_ubi_work() Richard Weinberger
2016-05-30 12:04 ` [PATCH 06/13] ubi: Remove tst_disable_bgt debugfs knob Richard Weinberger
2016-05-30 12:04 ` [PATCH 07/13] ubi: Move work related functions to work.c Richard Weinberger
2016-05-30 12:04 ` [PATCH 08/13] ubi: Remove lnum and vol_id from erase work Richard Weinberger
2016-05-30 12:04 ` [PATCH 09/13] ubi: Remove usless debug info from wear_leveling_worker() Richard Weinberger
2016-05-30 12:04 ` [PATCH 10/13] ubi: SLC mode Richard Weinberger
2016-05-30 12:04 ` [PATCH 11/13] ubi: LEB consolidation Richard Weinberger
2016-06-07 12:20   ` Boris Brezillon
2016-05-30 12:04 ` [PATCH 12/13] ubi: Add debugfs knob to force " Richard Weinberger
2016-05-30 12:04 ` [PATCH 13/13] ubi: Add debugfs knob to trigger " Richard Weinberger
2016-06-03 12:40 ` [RFC] UBI: MLC Support v0 Boris Brezillon
2016-06-24 14:48   ` 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=1464609874-15488-5-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --cc=alex@nextthing.co \
    --cc=beanhuo@micron.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=dedekind1@gmail.com \
    --cc=goliath@sigma-star.at \
    --cc=linux-mtd@lists.infradead.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 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.