1. 14 12月, 2017 6 次提交
  2. 01 12月, 2017 6 次提交
  3. 30 11月, 2017 4 次提交
  4. 14 11月, 2017 1 次提交
    • B
      mtd: Avoid probe failures when mtd->dbg.dfs_dir is invalid · 1530578a
      Boris Brezillon 提交于
      Commit e8e3edb9 ("mtd: create per-device and module-scope debugfs
      entries") tried to make MTD related debugfs stuff consistent across the
      MTD framework by creating a root <debugfs>/mtd/ directory containing
      one directory per MTD device.
      
      The problem is that, by default, the MTD layer only registers the
      master device if no partitions are defined for this master. This
      behavior breaks all drivers that expect mtd->dbg.dfs_dir to be filled
      correctly after calling mtd_device_register() in order to add their own
      debugfs entries.
      
      The only way we can force all MTD masters to be registered no matter if
      they expose partitions or not is by enabling the
      CONFIG_MTD_PARTITIONED_MASTER option.
      
      In such situations, there's no other solution but to accept skipping
      debugfs initialization when dbg.dfs_dir is invalid, and when this
      happens, inform the user that he should consider enabling
      CONFIG_MTD_PARTITIONED_MASTER.
      
      Fixes: e8e3edb9 ("mtd: create per-device and module-scope debugfs entries")
      Cc: <stable@vger.kernel.org>
      Cc: Mario J. Rugiero <mrugiero@gmail.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Reported-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      1530578a
  5. 07 11月, 2017 1 次提交
  6. 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
  7. 31 10月, 2017 1 次提交
  8. 30 10月, 2017 2 次提交
    • X
      mtd: nand: mtk: fix infinite ECC decode IRQ issue · 1d2fcdcf
      Xiaolei Li 提交于
      For MT2701 NAND Controller, there may generate infinite ECC decode IRQ
      during long time burn test on some platforms. Once this issue occurred,
      the ECC decode IRQ status cannot be cleared in the IRQ handler function,
      and threads cannot be scheduled.
      
      ECC HW generates decode IRQ each sector, so there will have more than one
      decode IRQ if read one page of large page NAND.
      
      Currently, ECC IRQ handle flow is that we will check whether it is decode
      IRQ at first by reading the register ECC_DECIRQ_STA. This is a read-clear
      type register. If this IRQ is decode IRQ, then the ECC IRQ signal will be
      cleared at the same time.
      Secondly, we will check whether all sectors are decoded by reading the
      register ECC_DECDONE. This is because the current IRQ may be not dealed
      in time, and the next sectors have been decoded before reading the
      register ECC_DECIRQ_STA. Then, the next sectors's decode IRQs will not
      be generated.
      Thirdly, if all sectors are decoded by comparing with ecc->sectors, then we
      will complete ecc->done, set ecc->sectors as 0, and disable ECC IRQ by
      programming the register ECC_IRQ_REG(op) as 0. Otherwise, wait for the
      next ECC IRQ.
      
      But, there is a timing issue between step one and two. When we read the
      reigster ECC_DECIRQ_STA, all sectors are decoded except the last sector,
      and the ECC IRQ signal is cleared. But the last sector is decoded before
      reading ECC_DECDONE, so the ECC IRQ signal is enabled again by ECC HW, and
      it means we will receive one extra ECC IRQ later. In step three, we will
      find that all sectors were decoded, then disable ECC IRQ and return.
      When deal with the extra ECC IRQ, the ECC IRQ status cannot be cleared
      anymore. That is because the register ECC_DECIRQ_STA can only be cleared
      when the register ECC_IRQ_REG(op) is enabled. But actually we have
      disabled ECC IRQ in the previous ECC IRQ handle. So, there will
      keep receiving ECC decode IRQ.
      
      Now, we read the register ECC_DECIRQ_STA once again before completing the
      ecc done event. This ensures that there will be no extra ECC decode IRQ.
      
      Also, remove writel(0, ecc->regs + ECC_IRQ_REG(op)) from irq handler,
      because ECC IRQ is disabled in mtk_ecc_disable(). And clear ECC_DECIRQ_STA
      in mtk_ecc_disable() in case there is a timeout to wait decode IRQ.
      
      Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NXiaolei Li <xiaolei.li@mediatek.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      1d2fcdcf
    • X
      mtd: nand: mtk: change the compile sequence of mtk_nand.o and mtk_ecc.o · 1c782b9a
      Xiaolei Li 提交于
      There will get mtk ecc handler during mtk nand probe now.
      If mtk ecc module is not initialized, then mtk nand probe will return
      -EPROBE_DEFER, and retry later.
      
      Change the compile sequence of mtk_nand.o and mtk_ecc.o, initialize mtk
      ecc module before mtk nand module. This makes mtk nand module initialized
      as soon as possible.
      Signed-off-by: NXiaolei Li <xiaolei.li@mediatek.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      1c782b9a
  9. 27 10月, 2017 1 次提交
    • R
      mtd: nand: omap2: Fix subpage write · 739c6441
      Roger Quadros 提交于
      Since v4.12, NAND subpage writes were causing a NULL pointer
      dereference on OMAP platforms (omap2-nand) using OMAP_ECC_BCH4_CODE_HW,
      OMAP_ECC_BCH8_CODE_HW and OMAP_ECC_BCH16_CODE_HW.
      
      This is because for those ECC modes, omap_calculate_ecc_bch()
      generates ECC bytes for the entire (multi-sector) page and this can
      overflow the ECC buffer provided by nand_write_subpage_hwecc()
      as it expects ecc.calculate() to return ECC bytes for just one sector.
      
      However, the root cause of the problem is present since v3.9
      but was not seen then as NAND buffers were being allocated
      as one big chunk prior to commit 3deb9979 ("mtd: nand: allocate
      aligned buffers if NAND_OWN_BUFFERS is unset").
      
      Fix the issue by providing a OMAP optimized write_subpage()
      implementation.
      
      Fixes: 62116e51 ("mtd: nand: omap2: Support for hardware BCH error correction.")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      739c6441
  10. 16 10月, 2017 2 次提交
  11. 14 10月, 2017 4 次提交
  12. 07 10月, 2017 8 次提交
  13. 27 9月, 2017 1 次提交
  14. 22 9月, 2017 2 次提交