Skip to content
Snippets Groups Projects
  1. Jan 03, 2023
  2. Dec 20, 2022
  3. Dec 07, 2022
  4. Nov 28, 2022
  5. Nov 21, 2022
  6. Nov 10, 2022
  7. Nov 09, 2022
  8. Oct 18, 2022
    • GitBot's avatar
      Integrate gitlab-ci/add-hide-ftp-upload-flag · 950d673c
      GitBot authored
      --
      
      Commit: seco-ne/yocto/infrastructure/gitlab-ci@a5e27f6e
      
      FTP upload: Add flag to hide FTP upload stage
      
      This is a workaround to prevent customer releases being uploaded to our
      public FTP area. It should be removed as soon as we support uploading to
      different FTP target folders.
      950d673c
    • GitBot's avatar
      Integrate gitlab-ci/add-release-suffix and 3 more · 5bff5478
      GitBot authored
      --
      
      Commit: seco-ne/yocto/infrastructure/gitlab-ci@543a2170
      
      manifest_package: add release suffix
      
      Customer specific manifest projects can now set the RELEASE_SUFFIX
      variable, which then gets appended to the deployment folder names.
      
      --
      
      Commit: seco-ne/yocto/infrastructure/gitlab-ci@c763c43f
      
      alphaplan_fwr: change variable "release_name_local" to "release_name"
      
      Otherwise it can be assumed that it might be correlated with
      outputdir_local, which is not the case.
      
      --
      
      Commit: seco-ne/yocto/infrastructure/gitlab-ci@2d8d26a5
      
      package_release: more refactoring
      
      - Make output-dir an argument that can be passed multiple times instead
        of hard-coding two dirs with certain meanings.
      - Remove LOCALDIR variable from package.env, because it is not used
        anywhere (only occurence was job class ".uploadsdkftp" which wasn't
        used anywhere either).
      
      --
      
      Commit: seco-ne/yocto/infrastructure/gitlab-ci@dc3698c8
      
      package_release: refactoring
      
      Improve readability of package_release.py and its submodule
      generate_release_metadata.py.
      
      - Add describing comments throughout the file.
      - Remove duplicate code from functions. Simplify them, so that they do
        what their names say (and nothing more).
      - Rename variables and function arguments to make their purpose clearer.
      - Harmonize variable names with their corresponding command line arguments.
      - Add pydoc for functions.
      - Add type declarations to function arguments.
      - Generate MD5 and metadata files in the source directories so that they
        can be copied along with the rest of the files.
      5bff5478
  9. Sep 27, 2022
  10. Sep 22, 2022
    • Tobias Kahlki's avatar
      CI: Updated gitlab-ci and switched to new recipe name · 74f2ce9e
      Tobias Kahlki authored
      The workflow for the integration of the gitlab-ci submodule has changed.
      Updated the gitlab-ci yaml file to use the new workflow and also updated
      the CI to the current revision.
      
      Note: The name of linux-guf was changed to linux-seconorth for the 5.15
      kernel.
      74f2ce9e
  11. Aug 29, 2022
  12. Mar 17, 2022
    • Clemens Terasa's avatar
      arm:dts: Add support for NALLINO · a92ffefa
      Clemens Terasa authored
      Add support for the Garz& Fricke NALLINO platform. The NALLINO platform
      is based on an NXP i.MX6 ULL. It includes support for a parallel RBG
      Display, I2C Touch, RS232, RS485, microSD-Card.
      a92ffefa
    • Clemens Terasa's avatar
      arm:dts: Add support for SANTINO-LT · f613d469
      Clemens Terasa authored
      Add support for the Garz & Fricke SANTINO-LT platform. The SANTINO-LT
      platform is based on an NXP i.MX6 Solo or DualLite. It includes support
      for a parallel RBG Display, CAN, Audio, I2C Touch, RS232, RS485,
      microSD-Card.
      f613d469
    • Clemens Terasa's avatar
      arm:dts: Add support for SANTARO · b920451e
      Clemens Terasa authored
      Add support for the Garz& Fricke SANTARO platform. The SANTARO platform
      is based on an NXP i.MX6 Solo, DualLite, Dual or Quad. It includes
      support for an LVDS Display, Audio, RTC, Temperature Sensor, I2C Touch,
      RS232, RS485, SD-Card.
      b920451e
    • Clemens Terasa's avatar
      arm:dts: Add support for SANTOKA · 85419241
      Clemens Terasa authored
      Add support for the Garz& Fricke SANTOKA platform. The SANTOKA platform
      is based on an NXP i.MX6 Solo, DualLite, Dual, Quad or QuadPlus. It
      includes support for an LVDS Display, CAN, Audio, Temperature Sensor,
      PCIe, RTC, I2C Touch, RS232, RS485, SD-Card and USB.
      85419241
    • Clemens Terasa's avatar
      arm:dts: Add support for SANTINO · 08663c02
      Clemens Terasa authored
       Add support for the Garz& Fricke SANTINO platform. The SANTINO platform
       is based on an NXP i.MX6 Solo or DuaslLite. It includes support for an
       RGB Display, I2C Touch, RS232, RS485, SD-Cards and USB.
      08663c02
    • Clemens Terasa's avatar
      arm:dts: Groundwork for Garz & Fricke i.MX6 systems · d171bc3f
      Clemens Terasa authored
      Add create Garz & Fricke directory below arch/arm/boot/dts to keep the
      Garz & Fricke specific files separated. This is not the "common"
      mainline approach for ARM dts definitions, however it is the practice
      for ARM64 platform.
      
      Add the common imx6qdl-san.dtsi include file that is common for all garz
      & Fricke SAN* platforms. Later commits will add those separately.
      
      * Add aliases for all platforms
      * Add default std-out
      * Add common audio parts like audio amplifier, audio-codec-clock,
        sgtl5000, ssi
      * Add backlight
      * Add gfplatdetect
      * Add common regulators
      * Configure AUDMUX for different platforms. The actual routing is done
        in the platform definition
      * Add CAN
      * Add common clock definition for the IPU
      * Add Fast Ethernet Controller (FEC)
      * Add I2C1, I2C2 and I2C3
      * Add all pinctrl entries.
      * Add UARTs
      * Add USB ports
      * Add USDHC
      * Add watchdog reset pin
      d171bc3f
    • Felix Gerking's avatar
      CI: Add gitlab-ci for reproducible builds · e04dc453
      Felix Gerking authored and Clemens Terasa's avatar Clemens Terasa committed
      BCS 746-000016
      e04dc453
    • Jonas Höppner's avatar
      logo: Add Garz & Fricke logos · dd23afe7
      Jonas Höppner authored and Clemens Terasa's avatar Clemens Terasa committed
      As per request form the marketing department, add a neutral Garz &
      Fricke boot splash. This also fits into the Garz & Fricke group.
      
      Also add a Flash-N-Go System logo.
      
      BCS 746-000275
      BCS 746-000468
      dd23afe7
    • Clemens Terasa's avatar
      arm:setup: Add Garz & Fricke version detection · 88ec678e
      Clemens Terasa authored
      This patchset adds Garz & Fricke specific version info to the mainline
      kernel. It adds information to /proc/cpuinfo, exports symbols to be used
      by a separate Garz & Fricke versioning module and exports the
      ATAG_Version (used for the Flash-N-Go Boot bootloader version) to the
      device tree.
      
      On previous implementations we introduced the board revision and the
      bootloader revision in the /proc/cpuinfo. Because of legacy consumers
      namely the install script, the demos and maybe more tools, we decided to
      add those also to this more mainline kernel.
      
      The detection itself should come from a platform-detection module and
      may be built out of kernel.
      
      Add the variables for the board revision and the Flash-N-Go Boot
      bootloader version, export them and show the contents in the
      /proc/cpuinfo entry.
      
      For a platform detection module more information of the actual hardware
      is needed. Specifically the mxc_cpu_type and the iMX SoC revision
      information is needed.
      
      Avoid exporting the __mxc_cpu_type though, as it should not be
      overwritten by an external module.
      
      Thus add a new function mxc_get_cpu_type and export both, the newly
      added function and the imx_get_soc_revision.
      
      The modification of the machine name is not possible if the machine
      name is not exported.  Thus export the machine_name variable.
      
      By default the machine name comes from ATAGS or the machines_desc
      structure that most often is created by the {DT_}MACHINE_START macros.
      
      For our custom boards, however, we want to set the machine name
      externally from a module. The alternative would be to creta a custom
      board-* oder mach-* .c file in arch/arm/mach-imx/. This, however, would copy
      most of the sensible platform code, which I regard as disencouraged.
      
      A "platform-detection" module would be a clean and nicely separated
      solution.
      
      The ATAGS have various tags useful to determine platform specific data
      already acquired from or generated by the bootloader.
      In this case it is the revision tag that the bootloader might fill in
      the ATAGS structure.
      
      In the G&F case and using the Flash-N-Go Boot bootloader the bootloader
      version is propagated in the ATAGS_REVISION tag.
      
      To be able to handle this later after the ATAGS are destroyed parse
      the ATAG_REVISION and add it to a atag-revision entry in the device
      tree.
      88ec678e
    • Carsten Behling's avatar
      arm: Set Garz & Fricke specific kernel virtual address · 79a37874
      Carsten Behling authored and Clemens Terasa's avatar Clemens Terasa committed
      On Garz & Fricke linux ports for historic and legacy reasons a
      different virtual kernel address offset is being used.
      
      Set the textofs from 0x00008000 to 0x00010000 and do so as well for the
      KERNEL_RAM_VADDR.
      
      TODO: Perhaps add a Garz & Fricke specific config or preprocessor
      variable.
      79a37874
    • Jonas Höppner's avatar
      drm/fbdev: set default colordepth for emulated fbdev to 32bit · 2edc6611
      Jonas Höppner authored and Clemens Terasa's avatar Clemens Terasa committed
      The lagacyfb_depth was set to 16 by default, but we want 32 to have all
      colors of a 24bit display also during framebuffer access.
      
      BCS 746-000038
      2edc6611
    • Clemens Terasa's avatar
      panel-dt: Add panel-dt · bc113aef
      Clemens Terasa authored
      This introduces a new panel driver called panel-dt for panels defined in
      the device tree.
      The goal is to create a panel driver similar to the panel-simple but
      introducing more device tree features, and make the definition via
      device tree definition mandatory, instead of overriding an exiting
      pre-defined panel.
      This would enable us to define most of the functionalities in the device
      tree.
      
      This approach has already been discussed in
      https://patchwork.kernel.org/patch/10842593/
      
       but was not considered to
      be valuable for the mainline linux kernel.
      
      For some users and for us, however, this might be very helpful.
      
      The question is still open, if the changes are better suited in the
      panel-simple and perhaps introducing another variation, similar to the
      panel-simple-dsi variant or in a separate file but this uses the latter
      approach.
      
      Steps taken:
      * Introduce the new panel-dt file, copied from panel-simple.c.
        Set the license to GPLv2.
      * Add the panel-dt driver to the Kconfig and conditionally build.
      * Remove the panel descriptions as well as the DSI interface.
        With the removal of the  DSI interace the module can be initialized by
        a simple module_platform_driver() call.
      * Remove all timings and modes.
      * Also rewrite the probe routine to require the panel-timings entry
        similar to the panel-lvds case.
      * Get the panel properties form the device tree instead of the
        simple-panel hard-coded way. Import the delays, dimensions (in mm),
        the bus-format and -flags and bits-per-color.
      * Add the device tree bindings documentation for the panel-dt driver.
        Regression: I was not able to test it with `make dt_binding_check` or
        `make dtbs_check` as per Documentation/devicetree/writing-schema.md.
      * Add the support for the special LVDS SEL6_8 GPIO that on some displays
        enables switches between 18 and 24 bit modes.
        This is somewhat Garz & Fricke specific.
      * Regression: The "guf," compatible prefix is not yet defined in
        Documentation/devicetree/bindings/vendor-prefixes.yaml
      * In recent kernel the rotation property was introduced in the panel
        device tree definitions and the panel-simple driver.
        Do the same for panel-dt and add the rotation information.
        However, I currently see no effect, but Weston should use this property
        since version 9.0.0
      * Preliminary uncomment the drm_connector_set_panel_orientation call
        in the get_modes implementation.
      * The bus flags can be supplied by the similar enum display_flags. the
        display_flags are part of the videomode and can be converted to
        bus_flags by using the drm_bus_flags_from_videomode() function.  By
        using this in the panel-dt driver we get the possibility to use the
        polarity settings like hsync-active, vsync-active, de-active,
        pixelclk-active and syncclk-active.
      
        BCS 746-000430
        BCS 746-000415
        BCS 746-000415
      
      Signed-off-by: default avatarClemens Terasa <clemens.terasa@garz-fricke.com>
      bc113aef
    • Norman Stetter's avatar
      Add PF1550 PMIC driver · ee12fb40
      Norman Stetter authored and Clemens Terasa's avatar Clemens Terasa committed
      * pull in the PF1550 PMIC driver from linux-fscl at commit
      f2c1392ff3473a396e4d177ff5ad368b9d6cd211
      ee12fb40
    • Clemens Terasa's avatar
      drm/imx: parallel-display: Fix bus_flags check · cc0e8334
      Clemens Terasa authored
      Add the DRM_BUS_FLAG_SYNC_DRIVE_{POS,NEG}EDGE as valid bus flag setting.
      
      Let's assume following function call order form a panel driver:
      of_parse_display_timing() -> videomode_from_timing() ->
      drm_bus_flags_from_videomode() and let's assume the result will end up
      as bus_flags in the parallel-display driver.
      
      The of_parse_display_timing() will set the DISPLAY_FLAGS_SYNC_*
      flags either when given explicitly using the "syncclk-active" device
      tree property or implicitly when the "pixelclk-active" property is being
      used.
      
      This results in the DRM_BUS_FLAG_SYNC_DRIVE_{POS,NEG}EDGE being set. So
      it is necessary to include the DRM_BUS_FLAG_SYNC_DRIVE_{POS,NEG}EDGE in
      the validity check as well.
      
      BCS 746-000430
      cc0e8334
    • Jonas Höppner's avatar
      tty: serial: imx: Add SW emulation for mark and space parity · 3255bc70
      Jonas Höppner authored and Clemens Terasa's avatar Clemens Terasa committed
      Integrate software implementation for mark and space from guf mdb driver.
      Rewrite most of the code:
       Use controller_parity from the uart register
       Use available flags instead of new enum.
       Resort some code to remove dupplicated code snippets.
       Rewrite logic, more readable.
       Move mark and space parity to inline functions
       Disable DMA when CMSPAR is set, still port DMA needs to be disable to
       always work, as disable DMA after open (when setting CMSPAR via ioctl)
       is not implemented. Close and reopen after setting the bit does work.
      
       Also cleanup the reconfiguration of ODD/EVEN during TX, as RX lost
       bytes in the mdb driver variant. Now the rx_interrupt routine is called
       until all buffers are empty before disalbe RX and change ODD/EVEN parity.
       This way the received bytes could be mapped to the parity config used
       during rx. Still a short moment RX is disabled which could lead to
       missed bits.
      
       Theres also a busy wait until TX queues are empty, which could probably
       lead to high system load on slow datarates, as this might wait one byte
       long.
      
      BCS 746-000322
      3255bc70
    • Clemens Terasa's avatar
      net: rfkill: gpio: add device tree support · 7430b85b
      Clemens Terasa authored
      Stolen from by https://lore.kernel.org/linux-arm-kernel/1397544101-18135-6-git-send-email-wens@csie.org/
      
      Add device tree support for the rfkil-gpio driver.
      Do not use the "new" gpio lookup from the same patchset.
      7430b85b
    • Carsten Behling's avatar
      kbuild: EXTRAVERSION to '-guf' · 9d06af4d
      Carsten Behling authored and Clemens Terasa's avatar Clemens Terasa committed
      It is good practice to show the world the provider of a kernel build.
      For Garz & Fricke build we always used "-guf" do to here as well.
      9d06af4d
  13. Mar 16, 2022
    • Greg Kroah-Hartman's avatar
    • Jason Wang's avatar
      vhost: allow batching hint without size · f83c85ee
      Jason Wang authored
      
      commit 95932ab2ea07b79cdb33121e2f40ccda9e6a73b5 upstream.
      
      Commit e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb
      entries") tries to reject the IOTLB message whose size is zero. But
      the size is not necessarily meaningful, one example is the batching
      hint, so the commit breaks that.
      
      Fixing this be reject zero size message only if the message is used to
      update/invalidate the IOTLB.
      
      Fixes: e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb entries")
      Reported-by: default avatarEli Cohen <elic@nvidia.com>
      Cc: Anirudh Rayabharam <mail@anirudhrb.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Link: https://lore.kernel.org/r/20220310075211.4801-1-jasowang@redhat.com
      
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Tested-by: default avatarEli Cohen <elic@nvidia.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f83c85ee
    • Vladimir Oltean's avatar
      Revert "net: dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN" · caf18e4d
      Vladimir Oltean authored
      
      This reverts commit 2566a89b which is
      commit a2614140dc0f467a83aa3bb4b6ee2d6480a76202 upstream.
      
      The above change depends on upstream commit 0faf890f ("net: dsa:
      drop rtnl_lock from dsa_slave_switchdev_event_work"), which is not
      present in linux-5.15.y. Without that change, waiting for the switchdev
      workqueue causes deadlocks on the rtnl_mutex.
      
      Backporting the dependency commit isn't trivial/desirable, since it
      requires that the following dependencies of the dependency are also
      backported:
      
      df405910 net: dsa: sja1105: wait for dynamic config command completion on writes too
      eb016afd net: dsa: sja1105: serialize access to the dynamic config interface
      2468346c net: mscc: ocelot: serialize access to the MAC table
      f7eb4a1c net: dsa: b53: serialize access to the ARL table
      cf231b43 net: dsa: lantiq_gswip: serialize access to the PCE registers
      338a3a47 net: dsa: introduce locking for the address lists on CPU and DSA ports
      
      and then this bugfix on top:
      
      8940e6b669ca ("net: dsa: avoid call to __dev_set_promiscuity() while rtnl_mutex isn't held")
      
      Reported-by: default avatarDaniel Suchy <danny@danysek.cz>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      caf18e4d
    • Christoph Hellwig's avatar
      block: drop unused includes in <linux/genhd.h> · 69b80587
      Christoph Hellwig authored
      
      commit b81e0c23 upstream.
      
      Drop various include not actually used in genhd.h itself, and
      move the remaning includes closer together.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Link: https://lore.kernel.org/r/20210920123328.1399408-15-hch@lst.de
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Reported-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com&gt;a>
      Reported-by: default avatar"H. Nikolaus Schaller" <hns@goldelico.com>
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>
      [ resolves MIPS build failure by luck, root cause needs to be fixed in
        Linus's tree properly, but this is needed for now to fix the build - gregkh ]
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      69b80587
    • Niklas Cassel's avatar
      riscv: dts: k210: fix broken IRQs on hart1 · cd072bf2
      Niklas Cassel authored
      
      commit 74583f1b upstream.
      
      Commit 67d96729 ("riscv: Update Canaan Kendryte K210 device tree")
      incorrectly removed two entries from the PLIC interrupt-controller node's
      interrupts-extended property.
      
      The PLIC driver cannot know the mapping between hart contexts and hart ids,
      so this information has to be provided by device tree, as specified by the
      PLIC device tree binding.
      
      The PLIC driver uses the interrupts-extended property, and initializes the
      hart context registers in the exact same order as provided by the
      interrupts-extended property.
      
      In other words, if we don't specify the S-mode interrupts, the PLIC driver
      will simply initialize the hart0 S-mode hart context with the hart1 M-mode
      configuration. It is therefore essential to specify the S-mode IRQs even
      though the system itself will only ever be running in M-mode.
      
      Re-add the S-mode interrupts, so that we get working IRQs on hart1 again.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 67d96729 ("riscv: Update Canaan Kendryte K210 device tree")
      Signed-off-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd072bf2
    • Ville Syrjälä's avatar
      drm/i915: Workaround broken BIOS DBUF configuration on TGL/RKL · 074c8875
      Ville Syrjälä authored
      commit 4e6f55120c7eccf6f9323bb681632e23cbcb3f3c upstream.
      
      On TGL/RKL the BIOS likes to use some kind of bogus DBUF layout
      that doesn't match what the spec recommends. With a single active
      pipe that is not going to be a problem, but with multiple pipes
      active skl_commit_modeset_enables() goes into an infinite loop
      since it can't figure out any order in which it can commit the
      pipes without causing DBUF overlaps between the planes.
      
      We'd need some kind of extra DBUF defrag stage in between to
      make the transition possible. But that is clearly way too complex
      a solution, so in the name of simplicity let's just sanitize the
      DBUF state by simply turning off all planes when we detect a
      pipe encroaching on its neighbours' DBUF slices. We only have
      to disable the primary planes as all other planes should have
      already been disabled (if they somehow were enabled) by
      earlier sanitization steps.
      
      And for good measure let's also sanitize in case the DBUF
      allocations of the pipes already seem to overlap each other.
      
      Cc: <stable@vger.kernel.org> # v5.14+
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4762
      
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220204141818.1900-3-ville.syrjala@linux.intel.com
      
      
      Reviewed-by: default avatarStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      (cherry picked from commit 15512021eb3975a8c2366e3883337e252bb0eee5)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      074c8875
    • Filipe Manana's avatar
      btrfs: make send work with concurrent block group relocation · a1ce40f8
      Filipe Manana authored
      
      commit d96b34248c2f4ea8cd09286090f2f6f77102eaab upstream.
      
      We don't allow send and balance/relocation to run in parallel in order
      to prevent send failing or silently producing some bad stream. This is
      because while send is using an extent (specially metadata) or about to
      read a metadata extent and expecting it belongs to a specific parent
      node, relocation can run, the transaction used for the relocation is
      committed and the extent gets reallocated while send is still using the
      extent, so it ends up with a different content than expected. This can
      result in just failing to read a metadata extent due to failure of the
      validation checks (parent transid, level, etc), failure to find a
      backreference for a data extent, and other unexpected failures. Besides
      reallocation, there's also a similar problem of an extent getting
      discarded when it's unpinned after the transaction used for block group
      relocation is committed.
      
      The restriction between balance and send was added in commit 9e967495
      ("Btrfs: prevent send failures and crashes due to concurrent relocation"),
      kernel 5.3, while the more general restriction between send and relocation
      was added in commit 1cea5cf0 ("btrfs: ensure relocation never runs
      while we have send operations running"), kernel 5.14.
      
      Both send and relocation can be very long running operations. Relocation
      because it has to do a lot of IO and expensive backreference lookups in
      case there are many snapshots, and send due to read IO when operating on
      very large trees. This makes it inconvenient for users and tools to deal
      with scheduling both operations.
      
      For zoned filesystem we also have automatic block group relocation, so
      send can fail with -EAGAIN when users least expect it or send can end up
      delaying the block group relocation for too long. In the future we might
      also get the automatic block group relocation for non zoned filesystems.
      
      This change makes it possible for send and relocation to run in parallel.
      This is achieved the following way:
      
      1) For all tree searches, send acquires a read lock on the commit root
         semaphore;
      
      2) After each tree search, and before releasing the commit root semaphore,
         the leaf is cloned and placed in the search path (struct btrfs_path);
      
      3) After releasing the commit root semaphore, the changed_cb() callback
         is invoked, which operates on the leaf and writes commands to the pipe
         (or file in case send/receive is not used with a pipe). It's important
         here to not hold a lock on the commit root semaphore, because if we did
         we could deadlock when sending and receiving to the same filesystem
         using a pipe - the send task blocks on the pipe because it's full, the
         receive task, which is the only consumer of the pipe, triggers a
         transaction commit when attempting to create a subvolume or reserve
         space for a write operation for example, but the transaction commit
         blocks trying to write lock the commit root semaphore, resulting in a
         deadlock;
      
      4) Before moving to the next key, or advancing to the next change in case
         of an incremental send, check if a transaction used for relocation was
         committed (or is about to finish its commit). If so, release the search
         path(s) and restart the search, to where we were before, so that we
         don't operate on stale extent buffers. The search restarts are always
         possible because both the send and parent roots are RO, and no one can
         add, remove of update keys (change their offset) in RO trees - the
         only exception is deduplication, but that is still not allowed to run
         in parallel with send;
      
      5) Periodically check if there is contention on the commit root semaphore,
         which means there is a transaction commit trying to write lock it, and
         release the semaphore and reschedule if there is contention, so as to
         avoid causing any significant delays to transaction commits.
      
      This leaves some room for optimizations for send to have less path
      releases and re searching the trees when there's relocation running, but
      for now it's kept simple as it performs quite well (on very large trees
      with resulting send streams in the order of a few hundred gigabytes).
      
      Test case btrfs/187, from fstests, stresses relocation, send and
      deduplication attempting to run in parallel, but without verifying if send
      succeeds and if it produces correct streams. A new test case will be added
      that exercises relocation happening in parallel with send and then checks
      that send succeeds and the resulting streams are correct.
      
      A final note is that for now this still leaves the mutual exclusion
      between send operations and deduplication on files belonging to a root
      used by send operations. A solution for that will be slightly more complex
      but it will eventually be built on top of this change.
      
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1ce40f8
Loading