[U-Boot] [PATCH v4 0/3] mtd, ubi, ubifs: resync with Linux-3.14

Scott Wood scottwood at freescale.com
Tue Jun 17 17:54:41 CEST 2014


On Tue, 2014-06-17 at 09:15 +0200, Heiko Schocher wrote:
> - Following Code in drivers/mtd/nand/nand_base.c nand_do_write_ops()
>   adapted for U-Boot:
> 
>   +#ifndef __UBOOT__
>         /* Reject writes, which are not page aligned */
>         if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
>   +else
>   +     /* Reject writes, which are not page aligned */
>   +     if (NOTALIGNED(to)) {
>   +endif

This sort of ifdeffing is a bad idea -- if a larger number of lines are
ifdeffed, to avoid context conflicts, subsequent merges can silently put
updates into the non-U-Boot section that are needed in the U-Boot
section.

Plus, it impairs readability, and in this case breaks text-editor
brace-matching.

Plus plus, that line has been that way in Linux since 2006 -- why is it
being touched at all?  Did you merge in changes from the previous mtd
sync, or did you just copy the new files over and then try to fix
resulting problems? (answered below)

>   as the original linux code leads in not working use of the env
>   var "filesize". For example a "nand write 80000000 80000 ${filesize}"
>   would not work with it ...
> 
> - add CONFIG_MTD_NAND_VERIFY_WRITE from U-Boot code
>   (only compile tested)
> 
> - Documented the config defines in README
> 
> - kmalloc now uses memalign for allocating memory. This prevented
>   crashes when tested ubi/ubifs on imx6 board.
> 
> - To produce this patch I did three steps:
>   - copied the linux source files to U-Boot tree -> commit this
>   - adapt license text in each file -> commit this
>   - make the code again compile clean and working -> commit this

OK, so you did just copy stuff over.  This method will lead to U-Boot
changes being reverted every time.  You should look in the U-Boot
history to see what Linux version corresponded to the last mtd sync, and
generate a diff relative to that.

-Scott




More information about the U-Boot mailing list