Skip to content
  1. Sep 24, 2021
    • Shakeel Butt's avatar
      memcg: flush lruvec stats in the refault · 1f828223
      Shakeel Butt authored
      Prior to the commit 7e1c0d6f ("memcg: switch lruvec stats to rstat")
      and the commit aa48e47e ("memcg: infrastructure to flush memcg
      stats"), each lruvec memcg stats can be off by (nr_cgroups * nr_cpus *
      32) at worst and for unbounded amount of time.  The commit aa48e47e
      moved the lruvec stats to rstat infrastructure and the commit
      7e1c0d6f bounded the error for all the lruvec stats to (nr_cpus *
      32) at worst for at most 2 seconds.  More specifically it decoupled the
      number of stats and the number of cgroups from the error rate.
      
      However this reduction in error comes with the cost of triggering the
      slowpath of stats update more frequently.  Previously in the slowpath
      the kernel adds the stats up the memcg tree.  After aa48e47e, the
      kernel triggers the asyn lruvec stats flush through queue_work().  This
      causes regression reports from 0day kernel bot [1] as well as from
      phoronix test suite [2].
      
      We tried two options to fix the regression:
      
       1) Increase the threshold to trigger the slowpath in lruvec stats
          update codepath from 32 to 512.
      
       2) Remove the slowpath from lruvec stats update codepath and instead
          flush the stats in the page refault codepath. The assumption is that
          the kernel timely flush the stats, so, the update tree would be
          small in the refault codepath to not cause the preformance impact.
      
      Following are the results of will-it-scale/page_fault[1|2|3] benchmark
      on four settings i.e.  (1) 5.15-rc1 as baseline (2) 5.15-rc1 with
      aa48e47e and 7e1c0d6f reverted (3) 5.15-rc1 with option-1
      (4) 5.15-rc1 with option-2.
      
        test       (1)      (2)               (3)               (4)
        pg_f1   368563   406277 (10.23%)   399693  (8.44%)   416398 (12.97%)
        pg_f2   338399   372133  (9.96%)   369180  (9.09%)   381024 (12.59%)
        pg_f3   500853   575399 (14.88%)   570388 (13.88%)   576083 (15.02%)
      
      From the above result, it seems like the option-2 not only solves the
      regression but also improves the performance for at least these
      benchmarks.
      
      Feng Tang (intel) ran the aim7 benchmark with these two options and
      confirms that option-1 reduces the regression but option-2 removes the
      regression.
      
      Michael Larabel (phoronix) ran multiple benchmarks with these options
      and reported the results at [3] and it shows for most benchmarks
      option-2 removes the regression introduced by the commit aa48e47e
      ("memcg: infrastructure to flush memcg stats").
      
      Based on the experiment results, this patch proposed the option-2 as the
      solution to resolve the regression.
      
      Link: https://lore.kernel.org/all/20210726022421.GB21872@xsang-OptiPlex-9020 [1]
      Link: https://www.phoronix.com/scan.php?page=article&item=linux515-compile-regress [2]
      Link: https://openbenchmarking.org/result/2109226-DEBU-LINUX5104 [3]
      Fixes: aa48e47e
      
       ("memcg: infrastructure to flush memcg stats")
      Signed-off-by: default avatarShakeel Butt <shakeelb@google.com>
      Tested-by: default avatarMichael Larabel <Michael@phoronix.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Hillf Danton <hdanton@sina.com>,
      Cc: Michal Koutný <mkoutny@suse.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>,
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1f828223
  2. Sep 23, 2021
  3. Sep 22, 2021
    • Jiri Slaby's avatar
      MAINTAINERS: ARM/VT8500, remove defunct e-mail · 8f1b7ba5
      Jiri Slaby authored
      
      
      linux@prisktech.co.nz is defunct:
      
        4.1.2 <linux@prisktech.co.nz>: Recipient address rejected: Domain not found
      
      Remove it from MAINTAINERS and mark the ARM/VT8500 entry orphan.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8f1b7ba5
    • Mark Brown's avatar
      spi: Revert modalias changes · 96c8395e
      Mark Brown authored
      During the v5.13 cycle we updated the SPI subsystem to generate OF style
      modaliases for SPI devices, replacing the old Linux style modalises we
      used to generate based on spi_device_id which are the DT style name with
      the vendor removed.  Unfortunately this means that we start only
      reporting OF style modalises and not the old ones and there is nothing
      that ensures that drivers list every possible OF compatible string in
      their OF ID table.  The result is that there are systems which have been
      relying on loading modules based on the old style that are now broken,
      as found by Russell King with spi-nor on Macchiatobin.
      
      spi-nor is a particularly problematic case for this, it only lists a
      single generic DT compatible jedec,spi-nor in the driver but supports a
      huge raft of device specific compatibles, with a large set of part
      numbers many of which are offered by multiple vendors.  Russell's
      searches of upstream device trees has turned up examples with vendor
      names written in non-standard ways too.  To make matters worse up until
      8ff16cf7 ("Documentation: devicetree: m25p80: add "nor-jedec"
      binding") the generic compatible was not part of the binding so there
      are device trees out there written to that binding version which don't
      list it all.  The sheer number of parts supported together with our
      previous approach of ignoring the vendor ID makes robustly fixing this
      by adding compatibles to the spi-nor driver seem problematic, the
      current DT binding document does not list all the parts supported by the
      driver at the minute (further patches will fix this).
      
      I've also investigated supporting both formats of modalias
      simultaneously but that doesn't seem possible, especially without
      breaking our userspace ABI which is obviously not viable.
      
      Instead revert the relevant changes for now:
      
      e09f2ab8 ("spi: update modalias_show after of_device_uevent_modalias support")
      3ce6c9e2 ("spi: add of_device_uevent_modalias support")
      
      This will unfortunately mean that any system which had started having
      modules autoload based on the OF compatibles for drivers that list
      things there but not in the spi_device_ids will now not have those
      modules load which is itself a regression.  Since it affects a narrower
      time window and the particularly problematic spi-nor driver may be
      critical to system boot on smaller systems this seems the best of a
      series of bad options.  I will start an audit of SPI drivers to identify
      and fix cases where things won't autoload using spi_device_id, this is
      not great but seems to be the best way forward that anyone has been able
      to identify.
      
      Thanks to Russell for both his report and the additional diagnostic and
      analysis work he has done here, the detailed research above was his
      work.
      
      Fixes: e09f2ab8 ("spi: update modalias_show after of_device_uevent_modalias support")
      Fixes: 3ce6c9e2
      
       ("spi: add of_device_uevent_modalias support")
      Reported-by: default avatarRussell King (Oracle) <linux@armlinux.org.uk>
      Suggested-by: default avatarRussell King (Oracle) <linux@armlinux.org.uk>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Tested-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Cc: Andreas Schwab <schwab@suse.de>
      Cc: Marco Felsch <m.felsch@pengutronix.de>
      96c8395e
    • Linus Torvalds's avatar
      Merge tag 's390-5.15-ebpf-jit-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 92477dd1
      Linus Torvalds authored
      Pull s390 eBPF fixes from Vasily Gorbik:
       "Johan Almbladh has implemented a number of new testcases for eBPF [1],
        which uncovered three miscompilation issues in the s390 eBPF JIT"
      
      Link: https://lore.kernel.org/bpf/20210902185229.1840281-1-johan.almbladh@anyfinetworks.com/ [1]
      
      * tag 's390-5.15-ebpf-jit-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/bpf: Fix optimizing out zero-extensions
        s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant
        s390/bpf: Fix branch shortening during codegen pass
      92477dd1
  4. Sep 21, 2021
    • Linus Torvalds's avatar
      qnx4: work around gcc false positive warning bug · d5f65459
      Linus Torvalds authored
      In commit b7213ffa ("qnx4: avoid stringop-overread errors") I tried
      to teach gcc about how the directory entry structure can be two
      different things depending on a status flag.  It made the code clearer,
      and it seemed to make gcc happy.
      
      However, Arnd points to a gcc bug, where despite using two different
      members of a union, gcc then gets confused, and uses the size of one of
      the members to decide if a string overrun happens.  And not necessarily
      the rigth one.
      
      End result: with some configurations, gcc-11 will still complain about
      the source buffer size being overread:
      
        fs/qnx4/dir.c: In function 'qnx4_readdir':
        fs/qnx4/dir.c:76:32: error: 'strnlen' specified bound [16, 48] exceeds source size 1 [-Werror=stringop-overread]
           76 |                         size = strnlen(name, size);
              |                                ^~~~~~~~~~~~~~~~~~~
        fs/qnx4/dir.c:26:22: note: source object declared here
           26 |                 char de_name;
              |                      ^~~~~~~
      
      because gcc will get confused about which union member entry is actually
      getting accessed, even when the source code is very clear about it.  Gcc
      internally will have combined two "redundant" pointers (pointing to
      different union elements that are at the same offset), and takes the
      size checking from one or the other - not necessarily the right one.
      
      This is clearly a gcc bug, but we can work around it fairly easily.  The
      biggest thing here is the big honking comment about why we do what we
      do.
      
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c6
      
      
      Reported-and-tested-by: default avatarArnd Bergmann <arnd@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d5f65459
    • Tobias Jakobi's avatar
    • José Expósito's avatar
      platform/x86/intel: hid: Add DMI switches allow list · b201cb0e
      José Expósito authored
      Some devices, even non convertible ones, can send incorrect
      SW_TABLET_MODE reports.
      
      Add an allow list and accept such reports only from devices in it.
      
      Bug reported for Dell XPS 17 9710 on:
      https://gitlab.freedesktop.org/libinput/libinput/-/issues/662
      
      
      
      Reported-by: default avatarTobias Gurtzick <magic@wizardtales.com>
      Suggested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Tested-by: default avatarTobias Gurtzick <magic@wizardtales.com>
      Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
      Link: https://lore.kernel.org/r/20210920160312.9787-1-jose.exposito89@gmail.com
      
      
      [hdegoede@redhat.com: Check dmi_switches_auto_add_allow_list only once]
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      b201cb0e
    • Randy Dunlap's avatar
      platform/x86: dell: fix DELL_WMI_PRIVACY dependencies & build error · 5b72dafa
      Randy Dunlap authored
      When DELL_WMI=y, DELL_WMI_PRIVACY=y, and LEDS_TRIGGER_AUDIO=m, there
      is a linker error since the LEDS trigger code is built as a loadable
      module. This happens because DELL_WMI_PRIVACY is a bool that depends
      on a tristate (LEDS_TRIGGER_AUDIO=m), which can be dangerous.
      
      ld: drivers/platform/x86/dell/dell-wmi-privacy.o: in function `dell_privacy_wmi_probe':
      dell-wmi-privacy.c:(.text+0x3df): undefined reference to `ledtrig_audio_get'
      
      Fixes: 8af9fa37
      
       ("platform/x86: dell-privacy: Add support for Dell hardware privacy")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Perry Yuan <Perry.Yuan@dell.com>
      Cc: Dell.Client.Kernel@dell.com
      Cc: platform-driver-x86@vger.kernel.org
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Mark Gross <mgross@linux.intel.com>
      Link: https://lore.kernel.org/r/20210918044829.19222-1-rdunlap@infradead.org
      
      
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      5b72dafa
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · d9fb6784
      Linus Torvalds authored
      Pull AFS fixes from David Howells:
       "Fixes for AFS problems that can cause data corruption due to
        interaction with another client modifying data cached locally:
      
         - When d_revalidating a dentry, don't look at the inode to which it
           points. Only check the directory to which the dentry belongs. This
           was confusing things and causing the silly-rename cleanup code to
           remove the file now at the dentry of a file that got deleted.
      
         - Fix mmap data coherency. When a callback break is received that
           relates to a file that we have cached, the data content may have
           been changed (there are other reasons, such as the user's rights
           having been changed). However, we're checking it lazily, only on
           entry to the kernel, which doesn't happen if we have a writeable
           shared mapped page on that file.
      
           We make the kernel keep track of mmapped files and clear all PTEs
           mapping to that file as soon as the callback comes in by calling
           unmap_mapping_pages() (we don't necessarily want to zap the
           pagecache). This causes the kernel to be reentered when userspace
           tries to access the mmapped address range again - and at that point
           we can query the server and, if we need to, zap the page cache.
      
           Ideally, I would check each file at the point of notification, but
           that involves poking the server[*] - which is holding an exclusive
           lock on the vnode it is changing, waiting for all the clients it
           notified to reply. This could then deadlock against the server.
           Further, invalidating the pagecache might call ->launder_page(),
           which would try to write to the file, which would definitely
           deadlock. (AFS doesn't lease file access).
      
           [*] Checking to see if the file content has changed is a matter of
               comparing the current data version number, but we have to ask
               the server for that. We also need to get a new callback promise
               and we need to poke the server for that too.
      
         - Add some more points at which the inode is validated, since we're
           doing it lazily, notably in ->read_iter() and ->page_mkwrite(), but
           also when performing some directory operations.
      
           Ideally, checking in ->read_iter() would be done in some derivation
           of filemap_read(). If we're going to call the server to read the
           file, then we get the file status fetch as part of that.
      
         - The above is now causing us to make a lot more calls to
           afs_validate() to check the inode - and afs_validate() takes the
           RCU read lock each time to make a quick check (ie.
           afs_check_validity()). This is entirely for the purpose of checking
           cb_s_break to see if the server we're using reinitialised its list
           of callbacks - however this isn't a very common event, so most of
           the time we're taking this needlessly.
      
           Add a new cell-wide counter to count the number of
           reinitialisations done by any server and check that - and only if
           that changes, take the RCU read lock and check the server list (the
           server list may change, but the cell a file is part of won't).
      
         - Don't update vnode->cb_s_break and ->cb_v_break inside the validity
           checking loop. The cb_lock is done with read_seqretry, so we might
           go round the loop a second time after resetting those values - and
           that could cause someone else checking validity to miss something
           (I think).
      
        Also included are patches for fixes for some bugs encountered whilst
        debugging this:
      
         - Fix a leak of afs_read objects and fix a leak of keys hidden by
           that.
      
         - Fix a leak of pages that couldn't be added to extend a writeback.
      
         - Fix the maintenance of i_blocks when i_size is changed by a local
           write or a local dir edit"
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217 [1]
      Link: https://lore.kernel.org/r/163111665183.283156.17200205573146438918.stgit@warthog.procyon.org.uk/ # v1
      Link: https://lore.kernel.org/r/163113612442.352844.11162345591911691150.stgit@warthog.procyon.org.uk/ # i_blocks patch
      
      * tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Fix updating of i_blocks on file/dir extension
        afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server
        afs: Try to avoid taking RCU read lock when checking vnode validity
        afs: Fix mmap coherency vs 3rd-party changes
        afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation
        afs: Add missing vnode validation checks
        afs: Fix page leak
        afs: Fix missing put on afs_read objects and missing get on the key therein
      d9fb6784
    • Linus Torvalds's avatar
      Merge tag '5.15-rc1-ksmbd' of git://git.samba.org/ksmbd · 707a63e9
      Linus Torvalds authored
      Pull ksmbd server fixes from Steve French:
       "Three ksmbd fixes, including an important security fix for path
        processing, and a buffer overflow check, and a trivial fix for
        incorrect header inclusion"
      
      * tag '5.15-rc1-ksmbd' of git://git.samba.org/ksmbd:
        ksmbd: add validation for FILE_FULL_EA_INFORMATION of smb2_get_info
        ksmbd: prevent out of share access
        ksmbd: transport_rdma: Don't include rwlock.h directly
      707a63e9
    • Linus Torvalds's avatar
      Merge tag '5.15-rc1-smb3' of git://git.samba.org/sfrench/cifs-2.6 · fdf50784
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
      
       - two deferred close fixes (for bugs found with xfstests 478 and 461)
      
       - a deferred close improvement in rename
      
       - two trivial fixes for incorrect Linux comment formatting of multiple
         cifs files (pointed out by automated kernel test robot and
         checkpatch)
      
      * tag '5.15-rc1-smb3' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Not to defer close on file when lock is set
        cifs: Fix soft lockup during fsstress
        cifs: Deferred close performance improvements
        cifs: fix incorrect kernel doc comments
        cifs: remove pathname for file from SPDX header
      fdf50784
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 4c17ca27
      Linus Torvalds authored
      Pull spi fixes from Mark BrownL
       "This contains a couple of fixes, one fix for handling of zero length
        transfers on Rockchip devices and a warning fix which will conflict
        with a version you did but cleans up some extra unneeded forward
        declarations as well which seems a bit neater"
      
      * tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
        spi: rockchip: handle zero length transfers without timing out
      4c17ca27
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v5.15-rc2' of... · 2ff59bad
      Linus Torvalds authored
      Merge tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fixes from Mark Brown:
       "A couple of small device specific fixes that have been sent since the
        merge window, neither of which stands out particularly"
      
      * tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: max14577: Revert "regulator: max14577: Add proper module aliases strings"
        regulator: qcom-rpmh-regulator: fix pm8009-1 ldo7 resource name
      2ff59bad
    • Guenter Roeck's avatar
      drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV · e8f71f89
      Guenter Roeck authored
      nvkm test builds fail with the following error.
      
        drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c: In function 'nvkm_control_mthd_pstate_info':
        drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c:60:35: error: overflow in conversion from 'int' to '__s8' {aka 'signed char'} changes value from '-251' to '5'
      
      The code builds on most architectures, but fails on parisc where ENOSYS
      is defined as 251.
      
      Replace the error code with -ENODEV (-19).  The actual error code does
      not really matter and is not passed to userspace - it just has to be
      negative.
      
      Fixes: 7238eca4
      
       ("drm/nouveau: expose pstate selection per-power source in sysfs")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e8f71f89
    • Linus Torvalds's avatar
      sparc64: fix pci_iounmap() when CONFIG_PCI is not set · d8b1e10a
      Linus Torvalds authored
      Guenter reported [1] that the pci_iounmap() changes remain problematic,
      with sparc64 allnoconfig and tinyconfig still not building due to the
      header file changes and confusion with the arch-specific pci_iounmap()
      implementation.
      
      I'm pretty convinced that sparc should just use GENERIC_IOMAP instead of
      doing its own thing, since it turns out that the sparc64 version of
      pci_iounmap() is somewhat buggy (see [2]).  But in the meantime, this
      just fixes the build by avoiding the trivial re-definition of the empty
      case.
      
      Link: https://lore.kernel.org/lkml/20210920134424.GA346531@roeck-us.net/ [1]
      Link: https://lore.kernel.org/lkml/CAHk-=wgheheFx9myQyy5osh79BAazvmvYURAtub2gQtMvLrhqQ@mail.gmail.com/
      
       [2]
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d8b1e10a
  5. Sep 20, 2021
    • Linus Torvalds's avatar
      Linux 5.15-rc2 · e4e737bb
      Linus Torvalds authored
      v5.15-rc2
      e4e737bb
    • Linus Torvalds's avatar
      pci_iounmap'2: Electric Boogaloo: try to make sense of it all · 316e8d79
      Linus Torvalds authored
      Nathan Chancellor reports that the recent change to pci_iounmap in
      commit 9caea000 ("parisc: Declare pci_iounmap() parisc version only
      when CONFIG_PCI enabled") causes build errors on arm64.
      
      It took me about two hours to convince myself that I think I know what
      the logic of that mess of #ifdef's in the <asm-generic/io.h> header file
      really aim to do, and rewrite it to be easier to follow.
      
      Famous last words.
      
      Anyway, the code has now been lifted from that grotty header file into
      lib/pci_iomap.c, and has fairly extensive comments about what the logic
      is.  It also avoids indirecting through another confusing (and badly
      named) helper function that has other preprocessor config conditionals.
      
      Let's see what odd architecture did something else strange in this area
      to break things.  But my arm64 cross build is clean.
      
      Fixes: 9caea000
      
       ("parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled")
      Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      316e8d79
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.15_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 20621d2f
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Prevent a infinite loop in the MCE recovery on return to user space,
         which was caused by a second MCE queueing work for the same page and
         thereby creating a circular work list.
      
       - Make kern_addr_valid() handle existing PMD entries, which are marked
         not present in the higher level page table, correctly instead of
         blindly dereferencing them.
      
       - Pass a valid address to sanitize_phys(). This was caused by the
         mixture of inclusive and exclusive ranges. memtype_reserve() expect
         'end' being exclusive, but sanitize_phys() wants it inclusive. This
         worked so far, but with end being the end of the physical address
         space the fail is exposed.
      
       - Increase the maximum supported GPIO numbers for 64bit. Newer SoCs
         exceed the previous maximum.
      
      * tag 'x86_urgent_for_v5.15_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce: Avoid infinite loop for copy from user recovery
        x86/mm: Fix kern_addr_valid() to cope with existing but not present entries
        x86/platform: Increase maximum GPIO number for X86_64
        x86/pat: Pass valid address to sanitize_phys()
      20621d2f
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fec30362
      Linus Torvalds authored
      Pull perf event fix from Thomas Gleixner:
       "A single fix for the perf core where a value read with READ_ONCE() was
        checked and then reread which makes all the checks invalid. Reuse the
        already read value instead"
      
      * tag 'perf-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        events: Reuse value read using READ_ONCE instead of re-reading it
      fec30362
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f5e29a26
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "A set of updates for the RT specific reader/writer locking base code:
      
         - Make the fast path reader ordering guarantees correct.
      
         - Code reshuffling to make the fix simpler"
      
      [ This plays ugly games with atomic_add_return_release() because we
        don't have a plain atomic_add_release(), and should really be cleaned
        up, I think    - Linus ]
      
      * tag 'locking-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/rwbase: Take care of ordering guarantee for fastpath reader
        locking/rwbase: Extract __rwbase_write_trylock()
        locking/rwbase: Properly match set_and_save_state() to restore_state()
      f5e29a26
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 62453a46
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix crashes when scv (System Call Vectored) is used to make a syscall
         when a transaction is active, on Power9 or later.
      
       - Fix bad interactions between rfscv (Return-from scv) and Power9
         fake-suspend mode.
      
       - Fix crashes when handling machine checks in LPARs using the Hash MMU.
      
       - Partly revert a recent change to our XICS interrupt controller code,
         which broke the recently added Microwatt support.
      
      Thanks to Cédric Le Goater, Eirik Fuller, Ganesh Goudar, Gustavo Romero,
      Joel Stanley, Nicholas Piggin.
      
      * tag 'powerpc-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/xics: Set the IRQ chip data for the ICS native backend
        powerpc/mce: Fix access error in mce handler
        KVM: PPC: Book3S HV: Tolerate treclaim. in fake-suspend mode changing registers
        powerpc/64s: system call rfscv workaround for TM bugs
        selftests/powerpc: Add scv versions of the basic TM syscall tests
        powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state
      62453a46
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.15' of... · 2f629969
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix bugs in checkkconfigsymbols.py
      
       - Fix missing sys import in gen_compile_commands.py
      
       - Fix missing FORCE warning for ARCH=sh builds
      
       - Fix -Wignored-optimization-argument warnings for Clang builds
      
       - Turn -Wignored-optimization-argument into an error in order to stop
         building instead of sprinkling warnings
      
      * tag 'kbuild-fixes-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS
        x86/build: Do not add -falign flags unconditionally for clang
        kbuild: Fix comment typo in scripts/Makefile.modpost
        sh: Add missing FORCE prerequisites in Makefile
        gen_compile_commands: fix missing 'sys' package
        checkkconfigsymbols.py: Remove skipping of help lines in parse_kconfig_file
        checkkconfigsymbols.py: Forbid passing 'HEAD' to --commit
      2f629969
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.15-2021-09-18' of... · d94f3957
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.15-2021-09-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix ip display in 'perf script' when output type != attr->type.
      
       - Ignore deprecation warning when using libbpf'sg btf__get_from_id(),
         fixing the build with libbpf v0.6+.
      
       - Make use of FD() robust in libperf, fixing a segfault with 'perf stat
         --iostat list'.
      
       - Initialize addr_location:srcline pointer to NULL when resolving
         callchain addresses.
      
       - Fix fused instruction logic for assembly functions in 'perf
         annotate'.
      
      * tag 'perf-tools-fixes-for-v5.15-2021-09-18' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf bpf: Ignore deprecation warning when using libbpf's btf__get_from_id()
        libperf evsel: Make use of FD robust.
        perf machine: Initialize srcline string member in add_location struct
        perf script: Fix ip display when type != attr->type
        perf annotate: Fix fused instr logic for assembly functions
      d94f3957
    • Linus Torvalds's avatar
      dmascc: use proper 'virt_to_bus()' rather than casting to 'int' · bc1abb9e
      Linus Torvalds authored
      
      
      The old dmascc driver depends on the legacy ISA_DMA_API, and blindly
      just casts the kernel virtual address to 'int' for set_dma_addr().
      
      That works only incidentally, and because the high bits of the address
      will be ignored anyway. And on 64-bit architectures it causes warnings.
      
      Admittedly, 64-bit architectures with ISA are basically dead - I think
      the only example of this is alpha, and nobody would ever use the dmascc
      driver there.  But hey, the fix is easy enough, the end result is
      cleaner, and it's yet another configuration that now builds without
      warnings.
      
      If somebody actually uses this driver on an alpha and this fixes it for
      you, please email me.  Because that is just incredibly bizarre.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bc1abb9e
    • Linus Torvalds's avatar
      alpha: enable GENERIC_PCI_IOMAP unconditionally · 4fef6115
      Linus Torvalds authored
      With the previous commit (9caea000
      
      : "parisc: Declare pci_iounmap()
      parisc version only when CONFIG_PCI enabled") we can now enable
      GENERIC_PCI_IOMAP unconditionally on alpha, and if PCI is not enabled we
      will just get the nice empty helper functions that allow mixed-bus
      drivers to build.
      
      Example driver: the old 3com/3c59x.c driver works with either the PCI or
      the EISA version of the 3x59x card, but wouldn't build in an EISA-only
      configuration because of missing pci_iomap() and pci_iounmap() dummy
      wrappers.
      
      Most of the other PCI infrastructure just becomes empty wrappers even
      without GENERIC_PCI_IOMAP, and it's not obvious that the pci_iomap
      functionality shouldn't do the same, but this works.
      
      Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4fef6115
    • Helge Deller's avatar
      parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled · 9caea000
      Helge Deller authored
      Linus noticed odd declaration rules for pci_iounmap() in iomap.h and
      pci_iomap.h, where it dependend on either NO_GENERIC_PCI_IOPORT_MAP or
      GENERIC_IOMAP when CONFIG_PCI was disabled.
      
      Testing on parisc seems to indicate that we need pci_iounmap() only when
      CONFIG_PCI is enabled, so the declaration of pci_iounmap() can be moved
      cleanly into pci_iomap.h in sync with the declarations of pci_iomap().
      
      Link: https://lore.kernel.org/all/CAHk-=wjRrh98pZoQ+AzfWmsTZacWxTJKXZ9eKU2X_0+jM=O8nw@mail.gmail.com/
      
      
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Fixes: 97a29d59
      
       ("[PARISC] fix compile break caused by iomap: make IOPORT/PCI mapping functions conditional")
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9caea000
    • Linus Torvalds's avatar
      Revert "drm/vc4: hdmi: Remove drm_encoder->crtc usage" · 31ad37bd
      Linus Torvalds authored
      This reverts commit 27da370e.
      
      Sudip Mukherjee reports that this broke pulseaudio with a NULL pointer
      dereference in vc4_hdmi_audio_prepare(), bisected it to this commit, and
      confirmed that a revert fixed the problem.
      
      Revert the problematic commit until fixed.
      
      Link: https://lore.kernel.org/all/CADVatmPB9-oKd=ypvj25UYysVo6EZhQ6bCM7EvztQBMyiZfAyw@mail.gmail.com/
      Link: https://lore.kernel.org/all/CADVatmN5EpRshGEPS_JozbFQRXg5w_8LFB3OMP1Ai-ghxd3w4g@mail.gmail.com/
      
      
      Reported-and-tested-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
      Cc: Maxime Ripard <maxime@cerno.tech>
      Cc: Emma Anholt <emma@anholt.net>
      Cc: Dave Airlie <airlied@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      31ad37bd
    • Linus Torvalds's avatar
      Revert drm/vc4 hdmi runtime PM changes · b1044a9b
      Linus Torvalds authored
      This reverts commits
      
        9984d666 ("drm/vc4: hdmi: Make sure the controller is powered in detect")
        411efa18 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm")
      
      as Michael Stapelberg reports that the new runtime PM changes cause his
      Raspberry Pi 3 to hang on boot, probably due to interactions with other
      changes in the DRM tree (because a bisect points to the merge in commit
      e058a84b: "Merge tag 'drm-next-2021-07-01' of git://.../drm").
      
      Revert these two commits until it's been resolved.
      
      Link: https://lore.kernel.org/all/871r5mp7h2.fsf@midna.i-did-not-set--mail-host-address--so-tickle-me/
      
      
      Reported-and-tested-by: default avatarMichael Stapelberg <michael@stapelberg.ch>
      Cc: Maxime Ripard <maxime@cerno.tech>
      Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b1044a9b
  6. Sep 19, 2021