From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Weinberger Date: Tue, 20 Oct 2015 09:16:10 +0200 Subject: [U-Boot] Porting UBI fixes (specially fastmap's) to U-Boot In-Reply-To: <5625BC5D.5090205@denx.de> References: <561666CB.8070908@denx.de> <56166992.2020004@nod.at> <561683A5.6060000@denx.de> <56173C31.6010202@denx.de> <5617B37D.5050403@denx.de> <56247CFA.1010105@denx.de> <562550F9.7020009@nod.at> <56256544.2060306@nod.at> <5625BC5D.5090205@denx.de> Message-ID: <5625EA3A.7050304@nod.at> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 20.10.2015 um 06:00 schrieb Heiko Schocher: > Hello Richard > > Am 19.10.2015 um 23:48 schrieb Richard Weinberger: >> Am 19.10.2015 um 23:40 schrieb Ezequiel Garcia: >>> On 19 October 2015 at 17:22, Richard Weinberger wrote: >>>> Am 19.10.2015 um 15:47 schrieb Ezequiel Garcia: >>>>> After some further investigation, printing the counters as Richard suggested >>>>> I found it was a bug on my side :-( The Linux partition and the U-Boot partition >>>>> had different size (i.e. PEB count) and so Fastmap complained :-( >>>>> >>>>> We trimmed the Linux partition size, and forgot to change U-Boot's >>>>> (or thought it wouldn't matter). >>>>> >>>>> Sorry for the noise guys! >>>> >>>> Good to know. :) >>>> >>>> Let me find a way to detect and report this kind of user error >>>> better. >>>> The WARN_ON() is only meant for bad internal errors. >>>> >>> >>> Sure. In case it's not clear, let me clarify what the issue was: the >>> MTD partition >>> has one size in Linux (4072 EB) and another size in U-Boot (4076 EB). >>> >>> When the map was built by Linux's Fastmap, it contained a number of PEBs that >>> conflicted with the number of PEBs U-Boot's Fastmap code was expecting >>> (becase Linux EB != U-Boot EB). >>> >>> Not sure how you would detect such a mismatch, but it was a very good >>> idea to print a noisy warning :-) >> >> I think it would make sense to drop the WARN_ON() and replace it to a >> warning using ubi_err() which explains what possible went wrong. >> i.e. MTD partition layout mismatch, an internal error, etc... > > Yep. > >>> We were effectively running without fastmap so far, becasue neither U-Boot >>> nor Linux could find a proper fastmap and attach the UBI partition using it. >> >> Yeah, U-Boot's fast decided to fall back to scanning mode and had to drop the >> existing fastmap and therefore Linux also had to do a full scan too. > > Didn;t got this, why is fastmap not working in U-Boot? No, the above explanation is why fastmap was used in Ezequiel's setup. Thanks, //richard