1. 28 Jun, 2021 3 commits
    • Linus Torvalds's avatar
      Merge tag 'mmc-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · ef60eb0e
      Linus Torvalds authored
      Pull MMC and MEMSTICK updates from Ulf Hansson:
       "MMC core:
         - Add support for Cache Ctrl for SD cards
         - Add support for Power Off Notification for SD cards
         - Add support for read/write of the SD function extension registers
         - Allow broken eMMC HS400 mode to be disabled via DT
         - Allow UHS-I voltage switch for SDSC cards if supported
         - Disable command queueing in the ioctl path
         - Enable eMMC sleep commands to use HW busy polling to minimize delay
         - Extend re-use of the common polling loop to standardize behaviour
         - Take into account MMC_CAP_NEED_RSP_BUSY for eMMC HPI commands
      
        MMC host:
         - jz4740: Add support for the JZ4775 variant
         - sdhci-acpi: Disable write protect detection on Toshiba Encore 2 WT8-B
         - sdhci-esdhc-imx: Advertise HS400 support through MMC caps
         - sdhci-esdhc-imx: Enable support for system wakeup for SDIO
         - sdhci-iproc: Add support for the legacy sdhci controller on the BCM7211
         - vub3000: Fix control-request direction
      
        MEMSTICK:
         - A couple of fixes/cleanups"
      
      * tag 'mmc-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (54 commits)
        mmc: sdhci-iproc: Add support for the legacy sdhci controller on the BCM7211
        dt-bindings: mmc: sdhci-iproc: Add brcm,bcm7211a0-sdhci
        mmc: JZ4740: Add support for JZ4775
        dt-bindings: mmc: JZ4740: Add bindings for JZ4775
        mmc: sdhci-esdhc-imx: Enable support for system wakeup for SDIO
        mmc: Improve function name when aborting a tuning cmd
        mmc: sdhci-of-aspeed: Turn down a phase correction warning
        mmc: debugfs: add description for module parameter
        mmc: via-sdmmc: add a check against NULL pointer dereference
        mmc: sdhci-sprd: use sdhci_sprd_writew
        mmc: sdhci-esdhc-imx: remove unused is_imx6q_usdhc
        mmc: core: Allow UHS-I voltage switch for SDSC cards if supported
        mmc: mmc_spi: Imply container_of() to be no-op
        mmc: mmc_spi: Drop duplicate 'mmc_spi' in the debug messages
        mmc: dw_mmc-pltfm: Remove unused <linux/clk.h>
        mmc: sdhci-of-aspeed: Configure the SDHCIs as specified by the devicetree.
        mmc: core: Add a missing SPDX license header
        mmc: vub3000: fix control-request direction
        mmc: sdhci-omap: Use pm_runtime_resume_and_get() to replace open coding
        mmc: sdhci_am654: Use pm_runtime_resume_and_get() to replace open coding
        ...
      ef60eb0e
    • Linus Torvalds's avatar
      Merge tag 'for-5.14/libata-2021-06-27' of git://git.kernel.dk/linux-block · 43bd8a67
      Linus Torvalds authored
      Pull libata updates from Jens Axboe:
       "The big change in this round is that we're finally in a position where
        we can sanely remove the old drivers/ide/ code, as libata covers
        everything we need by now.
      
        This is exciting for two reasons:
      
         1) we delete a lot of legacy code that doesn't really meet the
            standards we have today, and
      
         2) it enables us to clean up various bits in the block layer that
            exist only because of the old IDE code.
      
        Outside of that, just a few minor fixes here, fixups for warnings,
        etc"
      
      * tag 'for-5.14/libata-2021-06-27' of git://git.kernel.dk/linux-block: (29 commits)
        ata: rb532_cf: remove redundant codes
        ide: remove the legacy ide driver
        m68k: use libata instead of the legacy ide driver
        ARM: disable CONFIG_IDE in pxa_defconfig
        ARM: disable CONFIG_IDE in footbridge_defconfig
        alpha: use libata instead of the legacy ide driver
        pata_cypress: add a module option to disable BM-DMA
        ata: pata_macio: Avoid overwriting initialised field in 'pata_macio_sht'
        ata: pata_serverworks: Avoid overwriting initialised field in 'serverworks_osb4_sht
        ata: pata_sc1200: sc1200_sht'Avoid overwriting initialised field in '
        ata: pata_cs5530: Avoid overwriting initialised field in 'cs5530_sht'
        ata: pata_cs5520: Avoid overwriting initialised field in 'cs5520_sht'
        ata: pata_atiixp: Avoid overwriting initialised field in 'atiixp_sht'
        ata: sata_nv: Do not over-write initialise fields in 'nv_adma_sht' and 'nv_swncq_sht'
        ata: sata_mv: Do not over-write initialise fields in 'mv6_sht'
        ata: sata_sil24: Do not over-write initialise fields in 'sil24_sht'
        ata: ahci: Ensure initialised fields are not overwritten in AHCI_SHT()
        ata: include: libata: Move fields commonly over-written to separate MACRO
        ahci: Add support for Dell S140 and later controllers
        ata: ahci_sunxi: Disable DIPM
        ...
      43bd8a67
    • Mel Gorman's avatar
      mm/page_alloc: Correct return value of populated elements if bulk array is populated · 66d92825
      Mel Gorman authored
      Dave Jones reported the following
      
      	This made it into 5.13 final, and completely breaks NFSD for me
      	(Serving tcp v3 mounts).  Existing mounts on clients hang, as do
      	new mounts from new clients.  Rebooting the server back to rc7
      	everything recovers.
      
      The commit b3b64ebd ("mm/page_alloc: do bulk array bounds check after
      checking populated elements") returns the wrong value if the array is
      already populated which is interpreted as an allocation failure. Dave
      reported this fixes his problem and it also passed a test running dbench
      over NFS.
      
      Fixes: b3b64ebd ("mm/page_alloc: do bulk array bounds check after checking populated elements")
      Reported-and-tested-by: default avatarDave Jones <davej@codemonkey.org.uk>
      Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: <stable@vger.kernel.org> [5.13+]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      66d92825
  2. 27 Jun, 2021 2 commits
    • Linus Torvalds's avatar
      Linux 5.13 · 62fb9874
      Linus Torvalds authored
      62fb9874
    • Linus Torvalds's avatar
      Revert "signal: Allow tasks to cache one sigqueue struct" · b4b27b9e
      Linus Torvalds authored
      This reverts commits 4bad58eb (and
      399f8dd9, which tried to fix it).
      
      I do not believe these are correct, and I'm about to release 5.13, so am
      reverting them out of an abundance of caution.
      
      The locking is odd, and appears broken.
      
      On the allocation side (in __sigqueue_alloc()), the locking is somewhat
      straightforward: it depends on sighand->siglock.  Since one caller
      doesn't hold that lock, it further then tests 'sigqueue_flags' to avoid
      the case with no locks held.
      
      On the freeing side (in sigqueue_cache_or_free()), there is no locking
      at all, and the logic instead depends on 'current' being a single
      thread, and not able to race with itself.
      
      To make things more exciting, there's also the data race between freeing
      a signal and allocating one, which is handled by using WRITE_ONCE() and
      READ_ONCE(), and being mutually exclusive wrt the initial state (ie
      freeing will only free if the old state was NULL, while allocating will
      obviously only use the value if it was non-NULL, so only one or the
      other will actually act on the value).
      
      However, while the free->alloc paths do seem mutually exclusive thanks
      to just the data value dependency, it's not clear what the memory
      ordering constraints are on it.  Could writes from the previous
      allocation possibly be delayed and seen by the new allocation later,
      causing logical inconsistencies?
      
      So it's all very exciting and unusual.
      
      And in particular, it seems that the freeing side is incorrect in
      depending on "current" being single-threaded.  Yes, 'current' is a
      single thread, but in the presense of asynchronous events even a single
      thread can have data races.
      
      And such asynchronous events can and do happen, with interrupts causing
      signals to be flushed and thus free'd (for example - sending a
      SIGCONT/SIGSTOP can happen from interrupt context, and can flush
      previously queued process control signals).
      
      So regardless of all the other questions about the memory ordering and
      locking for this new cached allocation, the sigqueue_cache_or_free()
      assumptions seem to be fundamentally incorrect.
      
      It may be that people will show me the errors of my ways, and tell me
      why this is all safe after all.  We can reinstate it if so.  But my
      current belief is that the WRITE_ONCE() that sets the cached entry needs
      to be a smp_store_release(), and the READ_ONCE() that finds a cached
      entry needs to be a smp_load_acquire() to handle memory ordering
      correctly.
      
      And the sequence in sigqueue_cache_or_free() would need to either use a
      lock or at least be interrupt-safe some way (perhaps by using something
      like the percpu 'cmpxchg': it doesn't need to be SMP-safe, but like the
      percpu operations it needs to be interrupt-safe).
      
      Fixes: 399f8dd9 ("signal: Prevent sigqueue caching after task got released")
      Fixes: 4bad58eb ("signal: Allow tasks to cache one sigqueue struct")
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b4b27b9e
  3. 26 Jun, 2021 2 commits
  4. 25 Jun, 2021 33 commits