Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1486775

Re: [PATCH] UBI: add debugfs file for tracking PEB state

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject Re: [PATCH] UBI: add debugfs file for tracking PEB state
Date Mon, 19 Sep 2016 21:10:02 +0200
Message-ID <sjc70-Xi-35@gated-at.bofh.it> (permalink)
References <sjbNE-Bs-11@gated-at.bofh.it>
X-Original-To Zach Brown <zach.brown@ni.com>, dwmw2@infradead.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 21
Organization linux.* mail to news gateway
X-Original-Cc computersforpeace@gmail.com, dedekind1@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 19 Sep 2016 21:03:30 +0200
X-Original-Message-ID <4bf1146a-2c57-5003-6b57-5fc1052cb6ac@nod.at>
X-Original-References <1474310864-1743-1-git-send-email-zach.brown@ni.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1486775

Show key headers only | View raw


Zach,

On 19.09.2016 20:47, Zach Brown wrote:
> +	} else {
> +		struct ubi_ec_hdr erase_count_header;
> +
> +		err = ubi_io_read_ec_hdr(ubi, *block_number,
> +					 &erase_count_header, 0);
> +		if (err && err != UBI_IO_BITFLIPS)
> +			r_sts = READ_STATUS_ERR_READING_ERASE_COUNT;
> +		else {
> +			erase_count = be64_to_cpu(erase_count_header.ec);
> +			if (erase_count > UBI_MAX_ERASECOUNTER)
> +				b_sts = BLOCK_STATUS_ERASE_COUNT_BEYOND_MAX;

Hmm, why don't you use ubi->lookuptbl[] to get a ubi_wl_entry object, it knows
the erase counter. That way you don't have to read from the flash. If you read
you have to deal with all kind of read errors, including bitflips.

Thanks,
//richard

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] UBI: add debugfs file for tracking PEB state Zach Brown <zach.brown@ni.com> - 2016-09-19 20:50 +0200
  Re: [PATCH] UBI: add debugfs file for tracking PEB state Richard Weinberger <richard@nod.at> - 2016-09-19 21:10 +0200
  Re: [PATCH] UBI: add debugfs file for tracking PEB state kbuild test robot <lkp@intel.com> - 2016-09-19 21:50 +0200

csiph-web