[Skiboot] [PATCH 00/17] libflash/libffs/pflash improvements

Cyril Bur cyril.bur at au1.ibm.com
Fri Jul 21 16:35:51 AEST 2017


Hello,

For a small amount of backstory, this started with writing tests and
fixing memory leaks for pflash, so, starting at patch 13/17 and then
everything got out of control.

The first few patches are fixes for various things which came up,
pflash tests did reveal some problems.

Starting at patch 8/17 is a rework of pflash to prepare it for
removing the memory leaks, a long overdue restructure which isn't
quite there but well on its way.

There are probably a few arguments to making this several series - I'm
open to such ideas.

I'll also note that there aren't as many pflash tests as would be
ideal but at least this is a start and adding more should be fairly
simple work.

Cyril Bur (17):
  Makefile.check: Fix `make check`
  libflash: Adding debugging output
  libflash/file: Fix bad subtraction in file erase path
  libflash/file: Break up MTD erase ioctl() calls
  external/ffspart: Add .gitignore
  libflash/libffs: Don't require 'part' size to be known by callers
  external/pflash: Check the result of strtoul
  external/pflash: Stop using exit() in the main
  external/pflash: Correct erase alignment checks
  external/pflash: Remove global flash details
  external/pflash: Update the code pathes for "--tune"
  external/pflash: Move write and read size calculation together
  external/pflash: Remove use of exit() and fix memory leaks
  external/pflash: Reinstate the progress bars
  external: Consolidate Makefile.check for external tools
  external/pflash: Add tests
  external/pflash: tests: Move the test-miscprint to pflash tests

 Makefile.main                                      |   7 +-
 external/Makefile.check                            |  31 +
 external/common/arch_flash_powerpc.c               |  11 +-
 external/ffspart/.gitignore                        |   7 +
 external/ffspart/ffspart.c                         |  10 +-
 external/ffspart/test/Makefile.check               |  20 -
 external/ffspart/test/files/03-tiny-pnor.in        |   8 +-
 external/ffspart/test/files/03-tiny-pnor.out       | Bin 2560 -> 2560 bytes
 .../ffspart/test/files/03.1-tiny-pnor-backup.in    |   8 +-
 .../ffspart/test/files/03.1-tiny-pnor-backup.out   | Bin 2864 -> 3840 bytes
 external/ffspart/test/files/04-tiny-pnor2.out      | Bin 2560 -> 2560 bytes
 external/ffspart/test/results/05-hdr-overlap.err   |   4 +-
 external/ffspart/test/results/05-hdr-overlap.out   |   1 -
 .../test/results/05.1-hdr-overlap-backup.err       |   4 +-
 external/ffspart/test/tests/03.1-tiny-pnor-backup  |   2 +-
 external/gard/config.h                             |  19 +-
 external/gard/test/Makefile.check                  |  26 -
 external/pflash/.gitignore                         |   1 +
 external/pflash/Makefile                           |   8 +
 external/pflash/pflash.c                           | 629 ++++++++++++---------
 external/pflash/test/files/01-info.ffs             |   4 +
 external/pflash/test/files/02-erase.ffs            |   4 +
 external/pflash/test/files/03-erase-parts.ffs      |   4 +
 external/pflash/test/files/04-program-rand.ffs     |   4 +
 external/pflash/test/files/05-bad-numbers.ffs      |   4 +
 external/pflash/test/files/06-miscprint.ffs        |   4 +
 external/pflash/test/make-check-test               |   1 +
 external/pflash/test/results/00-usage.err          |   0
 external/pflash/test/results/00-usage.out          | 107 ++++
 external/pflash/test/results/01-info.err           |   0
 external/pflash/test/results/01-info.out           |  13 +
 external/pflash/test/results/02-erase.err          |   0
 external/pflash/test/results/02-erase.out          | 104 ++++
 external/pflash/test/results/03-erase-parts.err    |   0
 external/pflash/test/results/03-erase-parts.out    | 106 ++++
 external/pflash/test/results/04-program-rand.err   |   0
 external/pflash/test/results/04-program-rand.out   | 111 ++++
 external/pflash/test/results/05-bad-numbers.err    |   0
 external/pflash/test/results/05-bad-numbers.out    | 217 +++++++
 external/pflash/test/results/06-miscprint.err      |   0
 external/pflash/test/results/06-miscprint.out      |  36 ++
 external/pflash/test/test-pflash                   |  59 ++
 external/pflash/test/tests/00-usage                |  12 +
 external/pflash/test/tests/01-info                 |  22 +
 external/pflash/test/tests/02-erase                |  26 +
 external/pflash/test/tests/03-erase-parts          |  55 ++
 external/pflash/test/tests/04-program-rand         |  54 ++
 external/pflash/test/tests/05-bad-numbers          |  65 +++
 external/pflash/test/tests/06-miscprint            |  37 ++
 external/test/test.sh                              |  11 +-
 libflash/blocklevel.c                              |  64 ++-
 libflash/errors.h                                  |  14 +
 libflash/ffs.h                                     |   1 +
 libflash/file.c                                    |  62 +-
 libflash/libffs.c                                  |  37 +-
 libflash/libffs.h                                  |   2 +-
 libflash/libflash.h                                |  13 -
 libflash/test/Makefile.check                       |   7 +-
 libflash/test/test-blocklevel.c                    |   2 +
 libflash/test/test-miscprint.pnor                  | Bin 3072 -> 0 bytes
 libflash/test/test-miscprint.sh                    |  27 -
 61 files changed, 1659 insertions(+), 426 deletions(-)
 create mode 100644 external/Makefile.check
 create mode 100644 external/ffspart/.gitignore
 delete mode 100644 external/ffspart/test/Makefile.check
 delete mode 100644 external/gard/test/Makefile.check
 create mode 100644 external/pflash/test/files/01-info.ffs
 create mode 100644 external/pflash/test/files/02-erase.ffs
 create mode 100644 external/pflash/test/files/03-erase-parts.ffs
 create mode 100644 external/pflash/test/files/04-program-rand.ffs
 create mode 100644 external/pflash/test/files/05-bad-numbers.ffs
 create mode 100644 external/pflash/test/files/06-miscprint.ffs
 create mode 100755 external/pflash/test/make-check-test
 create mode 100644 external/pflash/test/results/00-usage.err
 create mode 100644 external/pflash/test/results/00-usage.out
 create mode 100644 external/pflash/test/results/01-info.err
 create mode 100644 external/pflash/test/results/01-info.out
 create mode 100644 external/pflash/test/results/02-erase.err
 create mode 100644 external/pflash/test/results/02-erase.out
 create mode 100644 external/pflash/test/results/03-erase-parts.err
 create mode 100644 external/pflash/test/results/03-erase-parts.out
 create mode 100644 external/pflash/test/results/04-program-rand.err
 create mode 100644 external/pflash/test/results/04-program-rand.out
 create mode 100644 external/pflash/test/results/05-bad-numbers.err
 create mode 100644 external/pflash/test/results/05-bad-numbers.out
 create mode 100644 external/pflash/test/results/06-miscprint.err
 create mode 100644 external/pflash/test/results/06-miscprint.out
 create mode 100755 external/pflash/test/test-pflash
 create mode 100644 external/pflash/test/tests/00-usage
 create mode 100644 external/pflash/test/tests/01-info
 create mode 100644 external/pflash/test/tests/02-erase
 create mode 100644 external/pflash/test/tests/03-erase-parts
 create mode 100644 external/pflash/test/tests/04-program-rand
 create mode 100644 external/pflash/test/tests/05-bad-numbers
 create mode 100644 external/pflash/test/tests/06-miscprint
 delete mode 100644 libflash/test/test-miscprint.pnor
 delete mode 100755 libflash/test/test-miscprint.sh

-- 
2.13.3



More information about the Skiboot mailing list