[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4bf1146a-2c57-5003-6b57-5fc1052cb6ac@nod.at>
Date: Mon, 19 Sep 2016 21:03:30 +0200
From: Richard Weinberger <richard@....at>
To: Zach Brown <zach.brown@...com>, dwmw2@...radead.org
Cc: computersforpeace@...il.com, dedekind1@...il.com,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] UBI: add debugfs file for tracking PEB state
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
Powered by blists - more mailing lists