Skip to content
Permalink
Ansuel-Smith/A…
Switch branches/tags

Commits on Feb 20, 2022

  1. mtd: core: introduce of support for dynamic partitions

    We have many parser that register mtd partitions at runtime. One example
    is the cmdlinepart or the smem-part parser where the compatible is defined
    in the dts and the partitions gets detected and registered by the
    parser. This is problematic for the NVMEM subsystem that requires an OF node
    to detect NVMEM cells.
    
    To fix this problem, introduce an additional logic that will try to
    assign an OF node to the MTD if declared.
    
    On MTD addition, it will be checked if the MTD has an OF node and if
    not declared will check if a partition with the same name / label is
    declared in DTS. If an exact match is found, the partition dynamically
    allocated by the parser will have a connected OF node.
    
    The NVMEM subsystem will detect the OF node and register any NVMEM cells
    declared statically in the DTS.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Feb 20, 2022
  2. dt-bindings: mtd: partitions: Document new partition-dynamic nodes

    Document new partition-dynamic nodes used to provide an OF node for
    partition registred at runtime by parsers. This is required for nvmem
    system to declare and detect nvmem-cells.
    
    With these special partitions, only the label is required as the parser
    will provide reg and offset of the mtd. NVMEM will use the data from the
    parser and provide the NVMEM cells declared in the DTS, "connecting" the
    dynamic partition with a static declaration of cells in them.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Ansuel authored and intel-lab-lkp committed Feb 20, 2022

Commits on Feb 18, 2022

  1. mtd: parsers: trx: allow to use on MediaTek MIPS SoCs

    Buffalo sells some router devices which have trx-formatted firmware,
    based on MediaTek MIPS SoCs. To use parser_trx on those devices, add
    "RALINK" to dependency and allow to compile for MediaTek MIPS SoCs.
    
    examples:
    
    - WCR-1166DS  (MT7628)
    - WSR-1166DHP (MT7621)
    - WSR-2533DHP (MT7621)
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220213064045.1781-1-musashino.open@gmail.com
    musashino205 authored and miquelraynal committed Feb 18, 2022
  2. dt-bindings: mtd: drop mtd/cortina,gemini-flash.txt

    Drop mtd/cortina,gemini-flash.txt since it is nearly already handled by
    Documentation/devicetree/bindings/mtd/mtd-physmap.yaml.
    
    We add jedec-flash to list of compatible because one board (gemini-dlink-dns-313.dts) needs it.
    See commit a10d862 ("ARM: dts: Fix the DNS-313 flash compatible")
    The flash on the DNS-313 needs to be probed as JEDEC, it does not conform to the common CFI standard.
    
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220211120842.3388592-1-clabbe@baylibre.com
    montjoie authored and miquelraynal committed Feb 18, 2022
  3. mtd: spear_smi: use GFP_KERNEL

    Platform_driver probe functions aren't called with locks held
    and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
    
    Problem found with Coccinelle.
    
    Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220210204223.104181-8-Julia.Lawall@inria.fr
    JuliaLawall authored and miquelraynal committed Feb 18, 2022
  4. Merge tag 'mtd/spi-mem-ecc-for-5.18' into mtd/next

    Topic branch bringing-in changes related to the support of ECC engines
    that can be used by SPI controllers to manage SPI NANDs as well as
    possibly by parallel NAND controllers. In particular, it brings support
    for Macronix ECC engine that can be used with Macronix SPI controller.
    
    The changes touch the NAND core, the NAND ECC core, the spi-mem layer, a
    SPI controller driver and add a new NAND ECC driver, as well as a number
    of binding updates.
    
    Binding changes:
    * Vendor prefixes: Clarify Macronix prefix
    * SPI NAND: Convert spi-nand description file to yaml
    * Raw NAND chip: Create a NAND chip description
    * Raw NAND controller:
      - Harmonize the property types
      - Fix a comment in the examples
      - Fix the reg property description
    * Describe Macronix NAND ECC engine
    * Macronix SPI controller:
      - Document the nand-ecc-engine property
      - Convert to yaml
      - The interrupt property is not mandatory
    
    NAND core changes:
    * ECC:
      - Add infrastructure to support hardware engines
      - Add a new helper to retrieve the ECC context
      - Provide a helper to retrieve a pilelined engine device
    
    NAND-ECC changes:
    * Macronix ECC engine:
      - Add Macronix external ECC engine support
      - Support SPI pipelined mode
    
    SPI-NAND core changes:
    * Delay a little bit the dirmap creation
    * Create direct mapping descriptors for ECC operations
    
    SPI-NAND driver changes:
    * macronix: Use random program load
    
    SPI changes:
    * Macronix SPI controller:
      - Fix the transmit path
      - Create a helper to configure the controller before an operation
      - Create a helper to ease the start of an operation
      - Add support for direct mapping
      - Add support for pipelined ECC operations
    * spi-mem:
      - Introduce a capability structure
      - Check the controller extra capabilities
      - cadence-quadspi/mxic: Provide capability structures
      - Kill the spi_mem_dtr_supports_op() helper
      - Add an ecc parameter to the spi_mem_op structure
    miquelraynal committed Feb 18, 2022

Commits on Feb 10, 2022

  1. spi: mxic: Add support for pipelined ECC operations

    Some SPI-NAND chips do not have a proper on-die ECC engine providing
    error correction/detection. This is particularly an issue on embedded
    devices with limited resources because all the computations must
    happen in software, unless an external hardware engine is provided.
    
    These external engines are new and can be of two categories: external
    or pipelined. Macronix is providing both, the former being already
    supported. The second, however, is very SoC implementation dependent
    and must be instantiated by the SPI host controller directly.
    
    An entire subsystem has been contributed to support these engines which
    makes the insertion into another subsystem such as SPI quite
    straightforward without the need for a lot of specific functions.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220202144536.393792-1-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  2. spi: mxic: Add support for direct mapping

    Implement the ->dirmap_create() and ->dirmap_read/write() hooks to
    provide a fast path for read and write accesses.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Tested-by: Zhengxun Li <zhengxunli@mxic.com.tw>
    Reviewed-by: Zhengxun Li <zhengxunli@mxic.com.tw>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-13-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  3. spi: mxic: Create a helper to ease the start of an operation

    Create the mxic_spi_mem_prep_op_cfg() helper to provide the content to
    write to the register controlling the next IO command. This helper will
    soon be used by the dirmap implementation and having this code
    factorized out earlier will clarify this addition.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-12-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  4. spi: mxic: Create a helper to configure the controller before an oper…

    …ation
    
    Create the mxic_spi_set_hc_cfg() helper to configure the HC_CFG
    register. This helper will soon be used by the dirmap implementation and
    having this code factorized out earlier will clarify this addition.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-11-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  5. spi: mxic: Fix the transmit path

    By working with external hardware ECC engines, we figured out that
    Under certain circumstances, it is needed for the SPI controller to
    check INT_TX_EMPTY and INT_RX_NOT_EMPTY in both receive and transmit
    path (not only in the receive path). The delay penalty being
    negligible, move this code in the common path.
    
    Fixes: b942d80 ("spi: Add MXIC controller driver")
    Cc: stable@vger.kernel.org
    Suggested-by: Mason Yang <masonccyang@mxic.com.tw>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Zhengxun Li <zhengxunli@mxic.com.tw>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-10-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  6. mtd: spinand: Create direct mapping descriptors for ECC operations

    In order for pipelined ECC engines to be able to enable/disable the ECC
    engine only when needed and avoid races when future parallel-operations
    will be supported, we need to provide the information about the use of
    the ECC engine in the direct mapping hooks. As direct mapping
    configurations are meant to be static, it is best to create two new
    mappings: one for regular 'raw' accesses and one for accesses involving
    correction. It is up to the driver to use or not the new ECC enable
    boolean contained in the spi-mem operation.
    
    As dirmaps are not free (they consume a few pages of MMIO address space)
    and because these extra entries are only meant to be used by pipelined
    engines, let's limit their use to this specific type of engine and save
    a bit of memory with all the other setups.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-9-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  7. mtd: spinand: Delay a little bit the dirmap creation

    As we will soon tweak the dirmap creation to act a little bit
    differently depending on the picked ECC engine, we need to initialize
    dirmaps after ECC engines. This should not have any effect as dirmaps
    are not yet used at this point.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-8-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  8. spi: spi-mem: Add an ecc parameter to the spi_mem_op structure

    Soon the SPI-NAND core will need a way to request a SPI controller to
    enable ECC support for a given operation. This is because of the
    pipelined integration of certain ECC engines, which are directly managed
    by the SPI controller itself.
    
    Introduce a spi_mem_op additional field for this purpose: ecc.
    
    So far this field is left unset and checked to be false by all
    the SPI controller drivers in their ->supports_op() hook, as they all
    call spi_mem_default_supports_op().
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Acked-by: Pratyush Yadav <p.yadav@ti.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-7-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  9. spi: spi-mem: Kill the spi_mem_dtr_supports_op() helper

    Now that spi_mem_default_supports_op() has access to the static
    controller capabilities (relating to memory operations), and now that
    these capabilities have been filled by the relevant controllers, there
    is no need for a specific helper checking only DTR operations, so let's
    just kill spi_mem_dtr_supports_op() and simply use
    spi_mem_default_supports_op() instead.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-6-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  10. spi: mxic: Provide a capability structure

    This controller has DTR support, so advertize it with a capability now
    that the spi-controller structure contains this new field. This will
    later be used by the core to discriminate whether an operation is
    supported or not, in a more generic way than having different helpers.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-5-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  11. spi: cadence-quadspi: Provide a capability structure

    This controller has DTR support, so advertize it with a capability now
    that the spi-controller structure contains this new field. This will
    later be used by the core to discriminate whether an operation is
    supported or not, in a more generic way than having different helpers.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-4-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  12. spi: spi-mem: Check the controller extra capabilities

    Controllers can now provide a spi-mem capabilities structure. Let's make
    use of it in spi_mem_controller_default_supports_op(). As we want to
    check for DTR operations as well as normal operations in a single
    helper, let's pull the necessary checks from spi_mem_dtr_supports_op()
    for now.
    
    However, because no controller provide these extra capabilities, this
    change has no effect so far.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-3-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  13. spi: spi-mem: Introduce a capability structure

    Create a spi_controller_mem_caps structure and put it within the
    spi_controller structure close to the spi_controller_mem_ops
    strucure. So far the only field in this structure is the support for dtr
    operations, but soon we will add another parameter.
    
    Also create a helper to parse the capabilities and check if the
    requested capability has been set or not.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
    Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-2-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022
  14. mtd: nand: mxic-ecc: Support SPI pipelined mode

    Introduce the support for another possible configuration: the ECC
    engine may work as DMA master (pipelined) and move itself the data
    to/from the NAND chip into the buffer, applying the necessary
    corrections/computations on the fly.
    
    This driver offers an ECC engine implementation that must be
    instatiated from a SPI controller driver.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-17-miquel.raynal@bootlin.com
    miquelraynal committed Feb 10, 2022

Commits on Feb 9, 2022

  1. mtd: nand: ecc: Provide a helper to retrieve a pilelined engine device

    In a pipelined engine situation, we might either have the host which
    internally has support for error correction, or have it using an
    external hardware block for this purpose. In the former case, the host
    is also the ECC engine. In the latter case, it is not. In order to get
    the right pointers on the right devices (for example: in order to devm_*
    allocate variables), let's introduce this helper which can safely be
    called by pipelined ECC engines in order to retrieve the right device
    structure.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-16-miquel.raynal@bootlin.com
    miquelraynal committed Feb 9, 2022
  2. mtd: nand: mxic-ecc: Add Macronix external ECC engine support

    Some SPI-NAND chips do not support on-die ECC. For these chips,
    correction must apply on the SPI controller end. In order to avoid
    doing all the calculations by software, Macronix provides a specific
    engine that can offload the intensive work.
    
    Add Macronix ECC engine support, this engine can work in conjunction
    with a SPI controller and a raw NAND controller, it can be pipelined
    or external and supports linear and syndrome layouts.
    
    Right now the simplest configuration is supported: SPI controller
    external and linear ECC engine.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-15-miquel.raynal@bootlin.com
    miquelraynal committed Feb 9, 2022

Commits on Feb 7, 2022

  1. mtd: Replace the expert mode symbols with a single helper

    Reduce the number of exported symbols by replacing:
    - mtd_expert_analysis_warning (the error string)
    - mtd_expert_analysis_mode (the boolean)
    with a single helper:
    - mtd_check_expert_analysis_mode
    
    Calling this helper will both check/return the content of the internal
    boolean -which is not exported anymore- and as well conditionally
    WARN_ONCE() the user, like it was done before.
    
    While on this function, make the error string local to the helper and
    set it const. Only export this helper when CONFIG_DEBUG_FS is defined to
    limit the growth of the Linux kernel size only for a debug feature on
    production kernels.
    
    Mechanically update all the consumers.
    
    Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220128113414.1121924-1-miquel.raynal@bootlin.com
    miquelraynal committed Feb 7, 2022
  2. mtd: mchp48l640: Add SPI ID table

    Currently autoloading for SPI devices does not use the DT ID table, it uses
    SPI modalises. Supporting OF modalises is going to be difficult if not
    impractical, an attempt was made but has been reverted, so ensure that
    module autoloading works for this driver by adding an id_table listing the
    SPI IDs for everything.
    
    Fixes: 96c8395 ("spi: Revert modalias changes")
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Reviewed-by: Michael Walle <michael@walle.cc>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220202143404.16070-4-broonie@kernel.org
    broonie authored and miquelraynal committed Feb 7, 2022
  3. mtd: mchp23k256: Add SPI ID table

    Currently autoloading for SPI devices does not use the DT ID table, it uses
    SPI modalises. Supporting OF modalises is going to be difficult if not
    impractical, an attempt was made but has been reverted, so ensure that
    module autoloading works for this driver by adding an id_table listing the
    SPI IDs for everything.
    
    Fixes: 96c8395 ("spi: Revert modalias changes")
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Reviewed-by: Michael Walle <michael@walle.cc>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220202143404.16070-3-broonie@kernel.org
    broonie authored and miquelraynal committed Feb 7, 2022

Commits on Jan 31, 2022

  1. mtd: rawnand: Fix misuses of of_match_node()

    On non-OF enabled platforms (CONFIG_OF is not set), of_match_node() will
    expand to NULL. The of_device_id array pointed by the macro will then be
    left unused. Let's mark the array __maybe_unused in this case to prevent
    compiler warnings.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Acked-by: Florian Fainelli <f.fainelli@gmail.com>
    Link: https://lore.kernel.org/linux-mtd/20220127110802.1064963-1-miquel.raynal@bootlin.com
    miquelraynal committed Jan 31, 2022
  2. mtd: Fix misuses of of_match_ptr()

    of_match_ptr() either expands to NULL if !CONFIG_OF, or is transparent
    otherwise. There are several drivers using this macro which keep their
    of_device_id array enclosed within an #ifdef CONFIG_OF check, these are
    considered fine. However, When misused, the of_device_id array pointed
    by this macro will produce a warning because it is finally unused when
    compiled without OF support.
    
    A number of fixes are possible:
    - Always depend on CONFIG_OF, but this will not always work and may
      break boards.
    - Enclose the compatible array by #ifdef's, this may save a bit of
      memory but will reduce build coverage.
    - Tell the compiler the array may be unused, if this can be avoided,
      let's not do this.
    - Just drop the macro, setting the of_device_id array for a non OF
      enabled platform is not an issue, it will just be unused.
    
    The latter solution seems the more appropriate, so let's use it.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Acked-by: Paul Cercueil <paul@crapouillou.net>
    Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    Acked-by: Pratyush Yadav <p.yadav@ti.com>
    Link: https://lore.kernel.org/linux-mtd/20220127110631.1064705-1-miquel.raynal@bootlin.com
    miquelraynal committed Jan 31, 2022

Commits on Jan 26, 2022

  1. mtd_blkdevs: avoid soft lockups with some mtd/spi devices

    With some spi devices, the heavy cpu usage due to polling the spi
    registers may lead to netdev timeouts, RCU complaints, etc. This can
    be acute in the absence of CONFIG_PREEMPT. This patch allows to give
    enough breathing room to avoid those incorrectly detected netdev
    timeouts for example.
    
    Example splat on 5.10.92:
    [  828.399306] rcu: INFO: rcu_sched self-detected stall on CPU
    ...
    [  828.419245] Task dump for CPU 1:
    [  828.422465] task:kworker/1:1H    state:R  running task on cpu   1   stack:    0 pid:   76 ppid:     2 flags:0x0000002a
    [  828.433132] Workqueue: kblockd blk_mq_run_work_fn
    [  828.437820] Call trace:
    ...
    [  828.512267]  spi_mem_exec_op+0x4d0/0xde0
    [  828.516184]  spi_mem_dirmap_read+0x180/0x39c
    [  828.520443]  spi_nor_read_data+0x428/0x7e8
    [  828.524523]  spi_nor_read+0x154/0x214
    [  828.528172]  mtd_read_oob+0x440/0x714
    [  828.531815]  mtd_read+0xac/0x120
    [  828.535030]  mtdblock_readsect+0x178/0x230
    [  828.539102]  mtd_blktrans_work+0x9fc/0xf28
    [  828.543177]  mtd_queue_rq+0x1ac/0x2e4
    [  828.546827]  blk_mq_dispatch_rq_list+0x2cc/0xa44
    [  828.551419]  blk_mq_do_dispatch_sched+0xb0/0x7cc
    [  828.556010]  __blk_mq_sched_dispatch_requests+0x350/0x494
    [  828.561372]  blk_mq_sched_dispatch_requests+0xac/0xe4
    [  828.566387]  __blk_mq_run_hw_queue+0x130/0x254
    [  828.570806]  blk_mq_run_work_fn+0x50/0x60
    [  828.574814]  process_one_work+0x578/0xf1c
    [  828.578814]  worker_thread+0x5dc/0xea0
    [  828.582547]  kthread+0x270/0x2d4
    [  828.585765]  ret_from_fork+0x10/0x30
    
    Signed-off-by: David Decotigny <ddecotig@google.com>
    Reviewed-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20220126101120.676021-1-decot+git@google.com
    DavidDecotigny authored and miquelraynal committed Jan 26, 2022

Commits on Jan 23, 2022

  1. mtd: aspeed-smc: improve probe resilience

    The aspeed-smc can have multiple SPI devices attached to it in the
    device tree.  If one of the devices is missing or failing the entire
    probe will fail and all MTD devices under the controller will be
    removed.  On OpenBMC this results in a kernel panic due to missing
    rootfs:
    
    [    0.538774] aspeed-smc 1e62000.spi: Using 50 MHz SPI frequency
    [    0.540471] aspeed-smc 1e62000.spi: w25q01jv-iq (131072 Kbytes)
    [    0.540750] aspeed-smc 1e62000.spi: CE0 window [ 0x20000000 - 0x28000000 ] 128MB
    [    0.540943] aspeed-smc 1e62000.spi: CE1 window [ 0x28000000 - 0x2c000000 ] 64MB
    [    0.541143] aspeed-smc 1e62000.spi: read control register: 203b0041
    [    0.581442] 5 fixed-partitions partitions found on MTD device bmc
    [    0.581625] Creating 5 MTD partitions on "bmc":
    [    0.581854] 0x000000000000-0x0000000e0000 : "u-boot"
    [    0.584472] 0x0000000e0000-0x000000100000 : "u-boot-env"
    [    0.586468] 0x000000100000-0x000000a00000 : "kernel"
    [    0.588465] 0x000000a00000-0x000006000000 : "rofs"
    [    0.590552] 0x000006000000-0x000008000000 : "rwfs"
    [    0.592605] aspeed-smc 1e62000.spi: Using 50 MHz SPI frequency
    [    0.592801] aspeed-smc 1e62000.spi: unrecognized JEDEC id bytes: 00 00 00 00 00 00
    [    0.593039] Deleting MTD partitions on "bmc":
    [    0.593175] Deleting u-boot MTD partition
    [    0.637929] Deleting u-boot-env MTD partition
    [    0.829527] Deleting kernel MTD partition
    [    0.856902] Freeing initrd memory: 1032K
    [    0.866428] Deleting rofs MTD partition
    [    0.906264] Deleting rwfs MTD partition
    [    0.986628] aspeed-smc 1e62000.spi: Aspeed SMC probe failed -2
    [    0.986929] aspeed-smc: probe of 1e62000.spi failed with error -2
    ...
    [    2.936719] /dev/mtdblock: Can't open blockdev
    mount: mounting /dev/mtdblock on run/initramfs/ro failed: No such file or directory
    [    2.963030] MTD: Couldn't look up '/dev/mtdblock': -2
    mount: mounting /dev/mtdblock on run/initramfs/rw failed: No such file or directory
    
    Mounting read-write /dev/mtdblock filesystem failed.  Please fix and run
    	mount /dev/mtdblock run/initramfs/rw -t jffs2 -o rw
    or perform a factory reset with the clean-rwfs-filesystem option.
    Fatal error, triggering kernel panic!
    [    3.013047] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
    
    Many BMC designs have two flash chips so that they can handle a hardware
    failure of one of them.  If one chip failed, it doesn't do any good to
    have redundancy if they all get removed anyhow.
    
    Improve the resilience of the probe function to handle one of the
    children being missing or failed.  Only in the case where all children
    fail to probe should the controller be failed out.
    
    Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211229143334.297305-1-patrick@stwcx.xyz
    williamspatrick authored and miquelraynal committed Jan 23, 2022
  2. mtd: nand: Add a new helper to retrieve the ECC context

    Introduce nand_to_ecc_ctx() which will allow to easily jump to the
    private pointer of an ECC context given a NAND device. This is very
    handy, from the prepare or finish ECC hook, to get the internal context
    out of the NAND device object.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-14-miquel.raynal@bootlin.com
    miquelraynal committed Jan 23, 2022
  3. mtd: nand: ecc: Add infrastructure to support hardware engines

    Add the necessary helpers to register/unregister hardware ECC engines
    that will be called from ECC engine drivers.
    
    Also add helpers to get the right engine from the user
    perspective. Keep a reference of the in use ECC engine in order to
    prevent modules to be unloaded. Put the reference when the engine gets
    retired.
    
    A static list of hardware (only) ECC engines is setup to keep track of
    the registered engines.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-13-miquel.raynal@bootlin.com
    miquelraynal committed Jan 23, 2022
  4. mtd: spinand: macronix: Use random program load

    Macronix SPI-NAND chips might benefit from an external ECC
    engine. Such an engine might need to access random columns, thus needing
    to use random commands (0x84 instead of 0x02).
    
    Signed-off-by: Mason Yang <masonccyang@mxic.com.tw>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-12-miquel.raynal@bootlin.com
    Mason Yang authored and miquelraynal committed Jan 23, 2022
  5. dt-bindings: mtd: Describe Macronix NAND ECC engine

    Describe Macronix NAND ECC engine. This engine may be used as an
    external engine or can be pipelined with either a raw NAND controller or
    a SPI controller. Both hardware designs with a SPI controller are shown
    in the examples.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-11-miquel.raynal@bootlin.com
    miquelraynal committed Jan 23, 2022
  6. dt-bindings: spi: mxic: Document the nand-ecc-engine property

    This SPI controller supports interacting with an external ECC
    engine. The nand-ecc-engine property already exist in the NAND world but
    also applies to SPI controller nodes which have external correction
    capabilities like Macronix's.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-10-miquel.raynal@bootlin.com
    miquelraynal committed Jan 23, 2022
  7. dt-bindings: spi: mxic: Convert to yaml

    Straightforward conversion from regular text to yaml schema of the
    Macronix SPI controller DT bindings.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Reviewed-by: Mark Brown <broonie@kernel.org>
    Link: https://lore.kernel.org/linux-mtd/20211216111654.238086-9-miquel.raynal@bootlin.com
    miquelraynal committed Jan 23, 2022
Older