Skip to content
Permalink
Guixin-Liu/uio…
Switch branches/tags

Commits on Feb 8, 2022

  1. uio: Replace mutex info_lock with percpu_ref to improve performance

    This patch includes a modification to repace mutex info_lock with
    percpu_ref, in order to improve uio performance.
    
    Reviewed-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
    Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
    guixinliu1995 authored and intel-lab-lkp committed Feb 8, 2022

Commits on Feb 4, 2022

  1. hpet: remove unused writeq/readq function definitions

    On all arch using hpet, only i386 miss writeq/readq.
    Instead of rewriting them, use linux/io-64-nonatomic-lo-hi.h which
    already have them.
    
    Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
    Link: https://lore.kernel.org/r/20220125140352.4085290-1-clabbe@baylibre.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    montjoie authored and gregkh committed Feb 4, 2022
  2. hpet: fix style issue about braces and alignment

    This patch fix all style issue for braces and alignment
    
    Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
    Link: https://lore.kernel.org/r/20220125140311.4084998-1-clabbe@baylibre.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    montjoie authored and gregkh committed Feb 4, 2022
  3. fsi: Aspeed: Fix a potential double free

    A struct device can never be devm_alloc()'ed.
    Here, it is embedded in "struct fsi_master", and "struct fsi_master" is
    embedded in "struct fsi_master_aspeed".
    
    Since "struct device" is embedded, the data structure embedding it must be
    released with the release function, as is already done here.
    
    So use kzalloc() instead of devm_kzalloc() when allocating "aspeed" and
    update all error handling branches accordingly.
    
    This prevent a potential double free().
    
    This also fix another issue if opb_readl() fails. Instead of a direct
    return, it now jumps in the error handling path.
    
    Fixes: 606397d ("fsi: Add ast2600 master driver")
    Suggested-by: Greg KH <gregkh@linuxfoundation.org>
    Suggested-by: Guenter Roeck <linux@roeck-us.net>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Link: https://lore.kernel.org/r/2c123f8b0a40dc1a061fae982169fe030b4f47e6.1641765339.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tititiou36 authored and gregkh committed Feb 4, 2022
  4. drivers: dio: Missing a blank line after declarations

    This patch fixes the checkpatch.pl error:
    
    < WARNING: Missing a blank line after declarations
    < torvalds#97: FILE: drivers/dio/dio.c:97:
    < +     unsigned int i;
    < +     for (i = 0; i < ARRAY_SIZE(names); i++)
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-7-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  5. drivers: dio: code indent should use tabs

    This patch fixes the checkpatch.pl error:
    
    < ERROR: code indent should use tabs where possible
    < torvalds#61: FILE: drivers/dio/dio.c:61:
    < +        int id;$
    <
    < WARNING: please, no spaces at the start of a line
    < torvalds#61: FILE: drivers/dio/dio.c:61:
    < +        int id;$
    <
    < ERROR: code indent should use tabs where possible
    < torvalds#62: FILE: drivers/dio/dio.c:62:
    < +        const char *name;$
    <
    < WARNING: please, no spaces at the start of a line
    < torvalds#62: FILE: drivers/dio/dio.c:62:
    < +        const char *name;$
    
    + 44 more errors of type "code indent should use tabs where
    possible"
    + 41 more warnings of type "please, no spaces at the start of a
    line"
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-6-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  6. drivers: dio: space required after that ','

    This patch fixes the checkpatch.pl error:
    
    < ERROR: space required after that ',' (ctx:VxV)
    < torvalds#239: FILE: drivers/dio/dio.c:239:
    < +                strcpy(dev->name,dio_getname(dev->id));
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-5-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  7. drivers: dio: space prohibited after parenthesis

    This patch fixes the checkpatch.pl error:
    
    < ERROR: space prohibited after that open parenthesis '('
    < torvalds#67: FILE: drivers/dio/dio.c:67:
    < +#define DIOFBNAME(x) { DIO_ENCODE_ID( DIO_ID_FBUFFER, DIO_ID2_##x),
    DIO_DESC2_##x }
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-4-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  8. drivers: dio: trailing whitespace

    This patch fixes the checkpatch.pl errors and warnings:
    
    < ERROR: trailing whitespace
    < #5: FILE: drivers/dio/dio.c:5:
    < + * $
    <
    < ERROR: trailing whitespace
    < torvalds#11: FILE: drivers/dio/dio.c:11:
    < + *    This means that framebuffers should pass it as $
    <
    < ERROR: trailing whitespace
    < torvalds#17: FILE: drivers/dio/dio.c:17:
    < + *    Every DIO card has a fixed interrupt priority level. This
    function $
    <
    < ERROR: trailing whitespace
    < torvalds#20: FILE: drivers/dio/dio.c:20:
    < + *    Return a character string describing this board [might be "" if
    $
    <
    < ERROR: trailing whitespace
    < torvalds#25: FILE: drivers/dio/dio.c:25:
    < + * This file is based on the way the Amiga port handles Zorro II
    cards, $
    
    + 15 more errors and warnings of type "trailing whitespace"
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-3-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  9. drivers: dio: brace should be on the previous line

    This patch fixes the checkpatch.pl errors and warnings:
    
    < ERROR: open brace '{' following struct go on the same line
    < +struct dioname
    < +{
    <
    < ERROR: that open brace { should be on the previous line
    < +static struct dioname names[] =
    < +{
    <
    < ERROR: that open brace { should be on the previous line
    < +        for (scode = 0; scode < DIO_SCMAX; ++scode)
    < +        {
    <
    < WARNING: braces {} are not necessary for any arm of this statement
    < +        if (scode >= DIOII_SCBASE) {
    < [...]
    < +        } else if (scode > DIO_SCMAX || scode < 0)
    < [...]
    < +        else if (DIO_SCINHOLE(scode))
    < [...]
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-2-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  10. drivers: dio: Use <linux/io.h> instead <asm/io.h>

    This patch fixes the checkpatch.pl warning:
    
    < WARNING: Use #include <linux/io.h> instead of <asm/io.h>
    < torvalds#36: FILE: drivers/dio/dio.c:36:
    < +#include <asm/io.h>                             /* readb() */
    
    Signed-off-by: Aleksa Vučković <aleksav013@gmail.com>
    Link: https://lore.kernel.org/r/20220127135054.27281-1-aleksav013@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksav013 authored and gregkh committed Feb 4, 2022
  11. misc: open-dice: Add driver to expose DICE data to userspace

    Open Profile for DICE is an open protocol for measured boot compatible
    with the Trusted Computing Group's Device Identifier Composition
    Engine (DICE) specification. The generated Compound Device Identifier
    (CDI) certificates represent the hardware/software combination measured
    by DICE, and can be used for remote attestation and sealing.
    
    Add a driver that exposes reserved memory regions populated by firmware
    with DICE CDIs and exposes them to userspace via a character device.
    
    Userspace obtains the memory region's size from read() and calls mmap()
    to create a mapping of the memory region in its address space. The
    mapping is not allowed to be write+shared, giving userspace a guarantee
    that the data were not overwritten by another process.
    
    Userspace can also call write(), which triggers a wipe of the DICE data
    by the driver. Because both the kernel and userspace mappings use
    write-combine semantics, all clients observe the memory as zeroed after
    the syscall has returned.
    
    Cc: Andrew Scull <ascull@google.com>
    Cc: Will Deacon <will@kernel.org>
    Acked-by: Rob Herring <robh@kernel.org>
    Signed-off-by: David Brazdil <dbrazdil@google.com>
    Link: https://lore.kernel.org/r/20220126231237.529308-3-dbrazdil@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    davidbrazdil authored and gregkh committed Feb 4, 2022
  12. dt-bindings: reserved-memory: Open Profile for DICE

    Add DeviceTree bindings for Open Profile for DICE, an open protocol for
    measured boot. Firmware uses DICE to measure the hardware/software
    combination and generates Compound Device Identifier (CDI) certificates.
    These are stored in memory and the buffer is described in the DT as
    a reserved memory region compatible with 'google,open-dice'.
    
    'no-map' is required to ensure the memory region is never treated by
    the kernel as system memory.
    
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: David Brazdil <dbrazdil@google.com>
    Link: https://lore.kernel.org/r/20220126231237.529308-2-dbrazdil@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    davidbrazdil authored and gregkh committed Feb 4, 2022
  13. mux: Fix struct mux_state kernel-doc comment

    A warning is reported because a colon was dropped, it is found by running
    scripts/kernel-doc, which is caused by using 'make W=1'.
    drivers/mux/core.c:44: warning: Function parameter or member 'state' not
    described in 'mux_state'
    
    Reported-by: Abaci Robot <abaci@linux.alibaba.com>
    Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
    Signed-off-by: Peter Rosin <peda@axentia.se>
    Link: https://lore.kernel.org/r/a9a970fc-63f9-5ab9-4983-fba5b01bebe2@axentia.se
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Yang Li authored and gregkh committed Feb 4, 2022
  14. mux: fix grammar, missing "is".

    This makes it easier to parse.
    
    Signed-off-by: Peter Rosin <peda@axentia.se>
    Link: https://lore.kernel.org/r/75067db8-0264-c49c-daa8-d7a877932711@axentia.se
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    peda-r authored and gregkh committed Feb 4, 2022
  15. mux: add missing mux_state_get

    And implement devm_mux_state_get in terms of the new function.
    
    Now we have both mux_state_get and mux_state_put as convenient functions
    ready to be exported should someone ever need unmanaged interfaces.
    
    Tested-by: Aswath Govindraju <a-govindraju@ti.com>
    Signed-off-by: Peter Rosin <peda@axentia.se>
    Link: https://lore.kernel.org/r/6f8cfdfd-9fa6-40d1-09b3-0c9fc50835ac@axentia.se
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    peda-r authored and gregkh committed Feb 4, 2022
  16. mux: Add support for reading mux state from consumer DT node

    In some cases, we might need to provide the state of the mux to be set for
    the operation of a given peripheral. Therefore, pass this information using
    mux-states property.
    
    Link: https://lore.kernel.org/lkml/20211123081222.27979-1-a-govindraju@ti.com
    Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
    Signed-off-by: Peter Rosin <peda@axentia.se> (minor edits)
    Link: https://lore.kernel.org/r/aac25be8-9515-a980-f7cb-709938c84822@axentia.se
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Aswath-Govindraju authored and gregkh committed Feb 4, 2022
  17. drivers/android: remove redundant ret variable

    Return value from list_lru_count() directly instead
    of taking this in another redundant variable.
    
    Reported-by: Zeal Robot <zealci@zte.com.cn>
    Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
    Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
    Link: https://lore.kernel.org/r/20220104113500.602158-1-chi.minghao@zte.com.cn
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Minghao Chi authored and gregkh committed Feb 4, 2022
  18. pps: clients: gpio: Propagate return value from pps_gpio_probe

    If the pps-gpio driver was probed prior to the GPIO device it uses, the
    devm_gpiod_get call returned an -EPROBE_DEFER error, but pps_gpio_probe
    replaced that error code with -EINVAL, causing the pps-gpio probe to
    fail and not be retried later. Propagate the error return value so that
    deferred probe works properly.
    
    Fixes: 1615204 (pps: new client driver using GPIO)
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Acked-by: Rodolfo Giometti <giometti@enneenne.com>
    Signed-off-by: Robert Hancock <robert.hancock@calian.com>
    Signed-off-by: Rodolfo Giometti <giometti@enneenne.com>
    Link: https://lore.kernel.org/r/20220112205214.2060954-1-robert.hancock@calian.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    robhancocksed authored and gregkh committed Feb 4, 2022
  19. greybus: svc: clean up link configuration hack at hello

    Commit ee2f207 ("greybus: svc: reconfig APBridgeA-Switch link to
    handle required load") added a temporary hack which reconfigures the
    link at HELLO by abusing the deferred request processing mechanism.
    
    Restructure the HELLO request processing so that the link-configuration
    work is queued before creating the debugfs files and add a comment
    explaining why it's there.
    
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20220202113347.1288-4-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jhovold authored and gregkh committed Feb 4, 2022
  20. greybus: svc: clean up hello error path

    While currently safe, it is unnecessary (and confusing) to try to
    destroy the watchdog when watchdog creation fails.
    
    Change the corresponding error path to only deregister the svc.
    
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20220202113347.1288-3-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jhovold authored and gregkh committed Feb 4, 2022
  21. greybus: svc: fix an error handling bug in gb_svc_hello()

    Cleanup if gb_svc_queue_deferred_request() fails.
    
    Link: https://lore.kernel.org/r/20220202072016.GA6748@kili
    Fixes: ee2f207 ("greybus: svc: reconfig APBridgeA-Switch link to handle required load")
    Cc: stable@vger.kernel.org      # 4.9
    [johan: fix commit summary prefix and rename label ]
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20220202113347.1288-2-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    error27 authored and gregkh committed Feb 4, 2022

Commits on Jan 30, 2022

  1. Merge tag 'v5.17-rc2' into char-misc-next

    We need the char/misc fixes in here as well.
    
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    gregkh committed Jan 30, 2022
  2. Linux 5.17-rc2

    torvalds committed Jan 30, 2022
  3. Merge tag 'irq_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/s…

    …cm/linux/kernel/git/tip/tip
    
    Pull irq fixes from Borislav Petkov:
    
     - Drop an unused private data field in the AIC driver
    
     - Various fixes to the realtek-rtl driver
    
     - Make the GICv3 ITS driver compile again in !SMP configurations
    
     - Force reset of the GICv3 ITSs at probe time to avoid issues during kexec
    
     - Yet another kfree/bitmap_free conversion
    
     - Various DT updates (Renesas, SiFive)
    
    * tag 'irq_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      dt-bindings: interrupt-controller: sifive,plic: Group interrupt tuples
      dt-bindings: interrupt-controller: sifive,plic: Fix number of interrupts
      dt-bindings: irqchip: renesas-irqc: Add R-Car V3U support
      irqchip/gic-v3-its: Reset each ITS's BASERn register before probe
      irqchip/gic-v3-its: Fix build for !SMP
      irqchip/loongson-pch-ms: Use bitmap_free() to free bitmap
      irqchip/realtek-rtl: Service all pending interrupts
      irqchip/realtek-rtl: Fix off-by-one in routing
      irqchip/realtek-rtl: Map control data to virq
      irqchip/apple-aic: Drop unused ipi_hwirq field
    torvalds committed Jan 30, 2022
  4. Merge tag 'perf_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/…

    …scm/linux/kernel/git/tip/tip
    
    Pull perf fixes from Borislav Petkov:
    
     - Prevent accesses to the per-CPU cgroup context list from another CPU
       except the one it belongs to, to avoid list corruption
    
     - Make sure parent events are always woken up to avoid indefinite hangs
       in the traced workload
    
    * tag 'perf_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      perf/core: Fix cgroup event list management
      perf: Always wake the parent event
    torvalds committed Jan 30, 2022
  5. Merge tag 'sched_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub…

    …/scm/linux/kernel/git/tip/tip
    
    Pull scheduler fix from Borislav Petkov:
     "Make sure the membarrier-rseq fence commands are part of the reported
      set when querying membarrier(2) commands through MEMBARRIER_CMD_QUERY"
    
    * tag 'sched_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      sched/membarrier: Fix membarrier-rseq fence command missing from query bitmask
    torvalds committed Jan 30, 2022
  6. Merge tag 'x86_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/tip/tip
    
    Pull x86 fixes from Borislav Petkov:
    
     - Add another Intel CPU model to the list of CPUs supporting the
       processor inventory unique number
    
     - Allow writing to MCE thresholding sysfs files again - a previous
       change had accidentally disabled it and no one noticed. Goes to show
       how much is this stuff used
    
    * tag 'x86_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      x86/cpu: Add Xeon Icelake-D to list of CPUs that support PPIN
      x86/MCE/AMD: Allow thresholding interface updates after init
    torvalds committed Jan 30, 2022
  7. Merge branch 'akpm' (patches from Andrew)

    Merge misc fixes from Andrew Morton:
     "12 patches.
    
      Subsystems affected by this patch series: sysctl, binfmt, ia64, mm
      (memory-failure, folios, kasan, and psi), selftests, and ocfs2"
    
    * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
      ocfs2: fix a deadlock when commit trans
      jbd2: export jbd2_journal_[grab|put]_journal_head
      psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n
      psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n
      mm, kasan: use compare-exchange operation to set KASAN page tag
      kasan: test: fix compatibility with FORTIFY_SOURCE
      tools/testing/scatterlist: add missing defines
      mm: page->mapping folio->mapping should have the same offset
      memory-failure: fetch compound_head after pgmap_pfn_valid()
      ia64: make IA64_MCA_RECOVERY bool instead of tristate
      binfmt_misc: fix crash when load/unload module
      include/linux/sysctl.h: fix register_sysctl_mount_point() return type
    torvalds committed Jan 30, 2022
  8. ocfs2: fix a deadlock when commit trans

    commit 6f1b228 introduces a regression which can deadlock as
    follows:
    
      Task1:                              Task2:
      jbd2_journal_commit_transaction     ocfs2_test_bg_bit_allocatable
      spin_lock(&jh->b_state_lock)        jbd_lock_bh_journal_head
      __jbd2_journal_remove_checkpoint    spin_lock(&jh->b_state_lock)
      jbd2_journal_put_journal_head
      jbd_lock_bh_journal_head
    
    Task1 and Task2 lock bh->b_state and jh->b_state_lock in different
    order, which finally result in a deadlock.
    
    So use jbd2_journal_[grab|put]_journal_head instead in
    ocfs2_test_bg_bit_allocatable() to fix it.
    
    Link: https://lkml.kernel.org/r/20220121071205.100648-3-joseph.qi@linux.alibaba.com
    Fixes: 6f1b228 ("ocfs2: fix race between searching chunks and release journal_head from buffer_head")
    Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
    Reported-by: Gautham Ananthakrishna <gautham.ananthakrishna@oracle.com>
    Tested-by: Gautham Ananthakrishna <gautham.ananthakrishna@oracle.com>
    Reported-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
    Cc: "Theodore Ts'o" <tytso@mit.edu>
    Cc: Andreas Dilger <adilger.kernel@dilger.ca>
    Cc: Changwei Ge <gechangwei@live.cn>
    Cc: Gang He <ghe@suse.com>
    Cc: Joel Becker <jlbec@evilplan.org>
    Cc: Jun Piao <piaojun@huawei.com>
    Cc: Junxiao Bi <junxiao.bi@oracle.com>
    Cc: Mark Fasheh <mark@fasheh.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    josephhz authored and torvalds committed Jan 30, 2022
  9. jbd2: export jbd2_journal_[grab|put]_journal_head

    Patch series "ocfs2: fix a deadlock case".
    
    This fixes a deadlock case in ocfs2.  We firstly export jbd2 symbols
    jbd2_journal_[grab|put]_journal_head as preparation and later use them
    in ocfs2 insread of jbd_[lock|unlock]_bh_journal_head to fix the
    deadlock.
    
    This patch (of 2):
    
    This exports symbols jbd2_journal_[grab|put]_journal_head, which will be
    used outside modules, e.g.  ocfs2.
    
    Link: https://lkml.kernel.org/r/20220121071205.100648-2-joseph.qi@linux.alibaba.com
    Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
    Cc: Mark Fasheh <mark@fasheh.com>
    Cc: Joel Becker <jlbec@evilplan.org>
    Cc: Junxiao Bi <junxiao.bi@oracle.com>
    Cc: Changwei Ge <gechangwei@live.cn>
    Cc: Gang He <ghe@suse.com>
    Cc: Jun Piao <piaojun@huawei.com>
    Cc: Andreas Dilger <adilger.kernel@dilger.ca>
    Cc: Gautham Ananthakrishna <gautham.ananthakrishna@oracle.com>
    Cc: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
    Cc: "Theodore Ts'o" <tytso@mit.edu>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    josephhz authored and torvalds committed Jan 30, 2022
  10. psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n

    When CONFIG_PROC_FS is disabled psi code generates the following
    warnings:
    
      kernel/sched/psi.c:1364:30: warning: 'psi_cpu_proc_ops' defined but not used [-Wunused-const-variable=]
          1364 | static const struct proc_ops psi_cpu_proc_ops = {
               |                              ^~~~~~~~~~~~~~~~
      kernel/sched/psi.c:1355:30: warning: 'psi_memory_proc_ops' defined but not used [-Wunused-const-variable=]
          1355 | static const struct proc_ops psi_memory_proc_ops = {
               |                              ^~~~~~~~~~~~~~~~~~~
      kernel/sched/psi.c:1346:30: warning: 'psi_io_proc_ops' defined but not used [-Wunused-const-variable=]
          1346 | static const struct proc_ops psi_io_proc_ops = {
               |                              ^~~~~~~~~~~~~~~
    
    Make definitions of these structures and related functions conditional
    on CONFIG_PROC_FS config.
    
    Link: https://lkml.kernel.org/r/20220119223940.787748-3-surenb@google.com
    Fixes: 0e94682 ("psi: introduce psi monitor")
    Signed-off-by: Suren Baghdasaryan <surenb@google.com>
    Reported-by: kernel test robot <lkp@intel.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    surenbaghdasaryan authored and torvalds committed Jan 30, 2022
  11. psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n

    When CONFIG_CGROUPS is disabled psi code generates the following
    warnings:
    
      kernel/sched/psi.c:1112:21: warning: no previous prototype for 'psi_trigger_create' [-Wmissing-prototypes]
          1112 | struct psi_trigger *psi_trigger_create(struct psi_group *group,
               |                     ^~~~~~~~~~~~~~~~~~
      kernel/sched/psi.c:1182:6: warning: no previous prototype for 'psi_trigger_destroy' [-Wmissing-prototypes]
          1182 | void psi_trigger_destroy(struct psi_trigger *t)
               |      ^~~~~~~~~~~~~~~~~~~
      kernel/sched/psi.c:1249:10: warning: no previous prototype for 'psi_trigger_poll' [-Wmissing-prototypes]
          1249 | __poll_t psi_trigger_poll(void **trigger_ptr,
               |          ^~~~~~~~~~~~~~~~
    
    Change the declarations of these functions in the header to provide the
    prototypes even when they are unused.
    
    Link: https://lkml.kernel.org/r/20220119223940.787748-2-surenb@google.com
    Fixes: 0e94682 ("psi: introduce psi monitor")
    Signed-off-by: Suren Baghdasaryan <surenb@google.com>
    Reported-by: kernel test robot <lkp@intel.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    surenbaghdasaryan authored and torvalds committed Jan 30, 2022
  12. mm, kasan: use compare-exchange operation to set KASAN page tag

    It has been reported that the tag setting operation on newly-allocated
    pages can cause the page flags to be corrupted when performed
    concurrently with other flag updates as a result of the use of
    non-atomic operations.
    
    Fix the problem by using a compare-exchange loop to update the tag.
    
    Link: https://lkml.kernel.org/r/20220120020148.1632253-1-pcc@google.com
    Link: https://linux-review.googlesource.com/id/I456b24a2b9067d93968d43b4bb3351c0cec63101
    Fixes: 2813b9c ("kasan, mm, arm64: tag non slab memory allocated via pagealloc")
    Signed-off-by: Peter Collingbourne <pcc@google.com>
    Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    pcc authored and torvalds committed Jan 30, 2022
  13. kasan: test: fix compatibility with FORTIFY_SOURCE

    With CONFIG_FORTIFY_SOURCE enabled, string functions will also perform
    dynamic checks using __builtin_object_size(ptr), which when failed will
    panic the kernel.
    
    Because the KASAN test deliberately performs out-of-bounds operations,
    the kernel panics with FORTIFY_SOURCE, for example:
    
     | kernel BUG at lib/string_helpers.c:910!
     | invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
     | CPU: 1 PID: 137 Comm: kunit_try_catch Tainted: G    B             5.16.0-rc3+ #3
     | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
     | RIP: 0010:fortify_panic+0x19/0x1b
     | ...
     | Call Trace:
     |  kmalloc_oob_in_memset.cold+0x16/0x16
     |  ...
    
    Fix it by also hiding `ptr` from the optimizer, which will ensure that
    __builtin_object_size() does not return a valid size, preventing
    fortified string functions from panicking.
    
    Link: https://lkml.kernel.org/r/20220124160744.1244685-1-elver@google.com
    Signed-off-by: Marco Elver <elver@google.com>
    Reported-by: Nico Pache <npache@redhat.com>
    Reviewed-by: Nico Pache <npache@redhat.com>
    Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    melver authored and torvalds committed Jan 30, 2022
Older