1. 15 5月, 2018 1 次提交
  2. 14 5月, 2018 1 次提交
  3. 24 4月, 2018 1 次提交
  4. 27 3月, 2018 1 次提交
    • R
      mtd: partitions: add of_match_table parser matching for the "ofpart" type · 5b644aa0
      Rafał Miłecki 提交于
      In order to properly support compatibility strings as described in the
      bindings/mtd/partition.txt "ofpart" type should be treated as an
      indication for looking into OF. MTD should check "compatible" property
      and search for a matching parser rather than blindly trying the one
      supporting "fixed-partitions".
      
      It also means that existing "fixed-partitions" parser should get renamed
      to use a more meaningful name.
      
      This commit achievies that aim by introducing a new mtd_part_of_parse().
      It works by looking for a matching parser for every string in the
      "compatibility" property (starting with the most specific one).
      
      Please note that driver-specified parsers still take a precedence. It's
      assumed that driver providing a parser type has a good reason for that
      (e.g. having platform data with device-specific info). Also doing
      otherwise could break existing setups. The same applies to using default
      parsers (including "cmdlinepart") as some overwrite DT data with cmdline
      argument.
      
      Partition parsers can now provide an of_match_table to enable
      flash<-->parser matching via device tree as documented in the
      mtd/partition.txt.
      
      This support is currently limited to built-in parsers as it uses
      request_module() and friends. This should be sufficient for most cases
      though as compiling parsers as modules isn't a common choice.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
      Tested-by: NPeter Rosin <peda@axentia.se>
      Reviewed-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      5b644aa0
  5. 21 3月, 2018 1 次提交
  6. 20 3月, 2018 7 次提交
  7. 16 3月, 2018 3 次提交
  8. 16 2月, 2018 2 次提交
  9. 20 1月, 2018 1 次提交
  10. 06 1月, 2018 1 次提交
  11. 18 12月, 2017 1 次提交
    • A
      mtd: cfi: convert inline functions to macros · 9e343e87
      Arnd Bergmann 提交于
      The map_word_() functions, dating back to linux-2.6.8, try to perform
      bitwise operations on a 'map_word' structure. This may have worked
      with compilers that were current then (gcc-3.4 or earlier), but end
      up being rather inefficient on any version I could try now (gcc-4.4 or
      higher). Specifically we hit a problem analyzed in gcc PR81715 where we
      fail to reuse the stack space for local variables.
      
      This can be seen immediately in the stack consumption for
      cfi_staa_erase_varsize() and other functions that (with CONFIG_KASAN)
      can be up to 2200 bytes. Changing the inline functions into macros brings
      this down to 1280 bytes.  Without KASAN, the same problem exists, but
      the stack consumption is lower to start with, my patch shrinks it from
      920 to 496 bytes on with arm-linux-gnueabi-gcc-5.4, and saves around
      1KB in .text size for cfi_cmdset_0020.c, as it avoids copying map_word
      structures for each call to one of these helpers.
      
      With the latest gcc-8 snapshot, the problem is fixed in upstream gcc,
      but nobody uses that yet, so we should still work around it in mainline
      kernels and probably backport the workaround to stable kernels as well.
      We had a couple of other functions that suffered from the same gcc bug,
      and all of those had a simpler workaround involving dummy variables
      in the inline function. Unfortunately that did not work here, the
      macro hack was the best I could come up with.
      
      It would also be helpful to have someone to a little performance testing
      on the patch, to see how much it helps in terms of CPU utilitzation.
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
      Cc: stable@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      9e343e87
  12. 16 12月, 2017 1 次提交
    • M
      mtd: nand: add ->exec_op() implementation · 8878b126
      Miquel Raynal 提交于
      Introduce a new interface to instruct NAND controllers to send specific
      NAND operations. The new interface takes the form of a single method
      called ->exec_op(). This method is designed to replace ->cmd_ctrl(),
      ->cmdfunc() and ->read/write_byte/word/buf() hooks.
      
      ->exec_op() is passed a set of instructions describing the operation
      to execute. Each instruction has a type (ADDR, CMD, DATA, WAITRDY)
      and delay. The delay is here to help simple controllers wait enough
      time between each instruction, advanced controllers with integrated
      timings control can ignore these delays.
      
      Controllers that natively support complex operations (operations
      formed of several instructions) can use the NAND op parser
      infrastructure. This infrastructure allows controller drivers to
      describe the sequence of instructions they support (called
      nand_op_pattern) and a hook for each of these supported sequences. The
      core then tries to find the best match for a given NAND operation, and
      calls the associated hook.
      
      Various other helpers are also added to ease NAND controller drivers
      writing.
      
      This new interface should ease support of vendor specific operations
      in that NAND manufacturer drivers now have a way to check if the
      controller they are connected to supports a specific operation, and
      complain or refuse to probe the NAND chip when that's not the case.
      Suggested-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      8878b126
  13. 14 12月, 2017 5 次提交
  14. 13 12月, 2017 2 次提交
  15. 14 11月, 2017 1 次提交
  16. 07 11月, 2017 1 次提交
  17. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  18. 11 10月, 2017 1 次提交
    • K
      mtd: spi-nor: add spi_nor_init() function · 46dde01f
      Kamal Dasu 提交于
      This patch extracts some chunks from spi_nor_init_params and spi_nor_scan()
       and moves them into a new spi_nor_init() function.
      
      Indeed, spi_nor_init() regroups all the required SPI flash commands to be
      sent to the SPI flash memory before performing any runtime operations
      (Fast Read, Page Program, Sector Erase, ...). Hence spi_nor_init():
      1) removes the flash protection if applicable for certain vendors.
      2) sets the Quad Enable bit, if needed, before using Quad SPI protocols.
      3) makes the memory enter its (stateful) 4-byte address mode, if needed,
         for SPI flash memory > 128Mbits not supporting the 4-byte address
         instruction set.
      
      spi_nor_scan() now ends by calling spi_nor_init() once the probe phase has
      completed. Further patches could also use spi_nor_init() to implement the
      mtd->_resume() handler for the spi-nor framework.
      Signed-off-by: NKamal Dasu <kdasu.kdev@gmail.com>
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
      46dde01f
  19. 07 10月, 2017 1 次提交
  20. 18 9月, 2017 1 次提交
  21. 30 8月, 2017 1 次提交
  22. 23 8月, 2017 2 次提交
  23. 15 8月, 2017 1 次提交
    • A
      mtd: only use __xipram annotation when XIP_KERNEL is set · 129f6c48
      Arnd Bergmann 提交于
      When XIP_KERNEL is enabled, some functions are defined in the .data
      ELF section because we require them to be in RAM whenever we communicate
      with the flash chip. However this causes problems when FTRACE is
      enabled and gcc emits calls to __gnu_mcount_nc in the function
      prolog:
      
      drivers/built-in.o: In function `cfi_chip_setup':
      :(.data+0x272fc): relocation truncated to fit: R_ARM_CALL against symbol `__gnu_mcount_nc' defined in .text section in arch/arm/kernel/built-in.o
      drivers/built-in.o: In function `cfi_probe_chip':
      :(.data+0x27de8): relocation truncated to fit: R_ARM_CALL against symbol `__gnu_mcount_nc' defined in .text section in arch/arm/kernel/built-in.o
      /tmp/ccY172rP.s: Assembler messages:
      /tmp/ccY172rP.s:70: Warning: ignoring changed section attributes for .data
      /tmp/ccY172rP.s: Error: 1 warning, treating warnings as errors
      make[5]: *** [drivers/mtd/chips/cfi_probe.o] Error 1
      /tmp/ccK4rjeO.s: Assembler messages:
      /tmp/ccK4rjeO.s:421: Warning: ignoring changed section attributes for .data
      /tmp/ccK4rjeO.s: Error: 1 warning, treating warnings as errors
      make[5]: *** [drivers/mtd/chips/cfi_util.o] Error 1
      /tmp/ccUvhCYR.s: Assembler messages:
      /tmp/ccUvhCYR.s:1895: Warning: ignoring changed section attributes for .data
      /tmp/ccUvhCYR.s: Error: 1 warning, treating warnings as errors
      
      Specifically, this does not work because the .data section is not
      marked executable, which leads LD to not generate trampolines for
      long calls.
      
      This moves the __xipram functions into their own .xiptext section instead.
      The section is still placed next to .data and located in RAM but is marked
      executable, which avoids the build errors.
      
      Also, we only need to place the XIP functions into a separate section
      if both CONFIG_XIP_KERNEL and CONFIG_MTD_XIP are set: When only MTD_XIP
      is used, the whole kernel is still in RAM and we do not need to worry
      about pulling out the rug under it. When only XIP_KERNEL but not MTD_XIP
      is set, the kernel is in some form of ROM, but we never write to it.
      
      Note that MTD_XIP has been broken on ARM since around 2011 or 2012. I
      have sent another patch[2] to fix compilation, which I plan to merge
      through arm-soc unless there are objections. The obvious alternative
      to that would be to completely rip out the MTD_XIP support from the
      kernel, since obviously nobody has been using it in a long while.
      
      Link: [1] https://patchwork.kernel.org/patch/8109771/
      Link: [2] https://patchwork.kernel.org/patch/9855225/Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      129f6c48
  24. 13 8月, 2017 1 次提交
  25. 03 8月, 2017 1 次提交