26 Jan, 2017

17 commits

  • commit 2bd42f3aaa53ebe78b9be6f898b7945dd61f9773 upstream.

    There might be systems where MAP_32BIT is not defined, like some some
    RHEL7 powerpc versions.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Kyle McMartin
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Fixes: 256763b01741 ("perf trace beauty mmap: Add more conditional defines")
    Link: http://lkml.kernel.org/r/1481831814-23683-1-git-send-email-jolsa@kernel.org
    [ Changed the Fixme cset to the one removing the conditional switch case for MAP_32BIT ]
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Greg Kroah-Hartman

    Jiri Olsa
     
  • commit 631ac41b46d293fb3ee43a809776c1663de8d9c6 upstream.

    Removing extra '--' prefix.

    Signed-off-by: Jiri Olsa
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Fixes: ad16511b0e40 ("perf mem: Add -U/-K (--all-user/--all-kernel) options")
    Link: http://lkml.kernel.org/r/1481538943-21874-2-git-send-email-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Greg Kroah-Hartman

    Jiri Olsa
     
  • commit ecf1e2253ea79c6204f4d6a5e756e8fb4aed5a7e upstream.

    Instead of the one when another syscall takes place while another is being
    processed (in another CPU, but we show it serialized, so need to "interrupt"
    the other), and also when finally showing the sys_enter + sys_exit + duration,
    where we were showing the sample->time for the sys_exit, duh.

    Before:

    # perf trace sleep 1

    0.373 ( 0.001 ms): close(fd: 3 ) = 0
    1000.626 (1000.211 ms): nanosleep(rqtp: 0x7ffd6ddddfb0) = 0
    1000.653 ( 0.003 ms): close(fd: 1 ) = 0
    1000.657 ( 0.002 ms): close(fd: 2 ) = 0
    1000.667 ( 0.000 ms): exit_group( )
    #

    After:

    # perf trace sleep 1

    0.336 ( 0.001 ms): close(fd: 3 ) = 0
    0.373 (1000.086 ms): nanosleep(rqtp: 0x7ffe303e9550) = 0
    1000.481 ( 0.002 ms): close(fd: 1 ) = 0
    1000.485 ( 0.001 ms): close(fd: 2 ) = 0
    1000.494 ( 0.000 ms): exit_group( )
    [root@jouet linux]#

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-ecbzgmu2ni6glc6zkw8p1zmx@git.kernel.org
    Fixes: 752fde44fd1c ("perf trace: Support interrupted syscalls")
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Greg Kroah-Hartman

    Arnaldo Carvalho de Melo
     
  • commit 0b59970e7d96edcb3c7f651d9d48e1a59af3c3b0 upstream.

    Remove the warning print of "can't use of GFP_NOIO" to avoid prints in
    each QP creation when devices aren't supporting IB_QP_CREATE_USE_GFP_NOIO.

    This print become more annoying when the IPoIB interface is configured
    to work in connected mode.

    Fixes: 09b93088d750 ('IB: Add a QP creation flag to use GFP_NOIO allocations')
    Signed-off-by: Kamal Heib
    Signed-off-by: Leon Romanovsky
    Reviewed-by: Yuval Shaia
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Kamal Heib
     
  • commit bf08e884bfd5be068fd2ccf2bc450f085d8dd853 upstream.

    Before reading GRH attributes, need to make sure AH contains GRH,
    and in addition, initialize GID type.

    Fixes: dbf727de7440 ('IB/core: Use GID table in AH creation and dmac resolution')
    Signed-off-by: Eran Ben Elisha
    Signed-off-by: Daniel Jurgens
    Reviewed-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eran Ben Elisha
     
  • commit 1f22e454df2eb99ba6b7ace3f594f6805cdf5cbc upstream.

    According to the firmware spec, FLOW_STEERING_IB_UC_QP_RANGE command is
    supported only if dmfs_ipoib bit is set.

    If it isn't set we want to ensure allocating NET_IF QPs fail. We do so
    by filling out the allocation bitmap. By thus, the NET_IF QPs allocating
    function won't find any free QP and will fail.

    Fixes: c1c98501121e ('IB/mlx4: Add support for steerable IB UD QPs')
    Signed-off-by: Eran Ben Elisha
    Signed-off-by: Daniel Jurgens
    Reviewed-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eran Ben Elisha
     
  • commit 6fa26208206c406fa529cd73f7ae6bf4181e270b upstream.

    Report the correct speed in the port attributes when using a 56Gbps
    ethernet link. Without this change the field is incorrectly set to 10.

    Fixes: a9c766bb75ee ('IB/mlx4: Fix info returned when querying IBoE ports')
    Fixes: 2e96691c31ec ('IB: Use central enum for speed instead of hard-coded values')
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Yishai Hadas
    Signed-off-by: Daniel Jurgens
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Saeed Mahameed
     
  • commit befcabcd530e4ffb6f016638f693b7d94986d2ba upstream.

    If OpenSM runs over a ConnectX-3, and there are ConnectX-4 or Connect-IB
    VFs active on the network, the OpenSM will receive QP1 packets containing
    a GRH where the destination GID is the "Well-Known GID" -- which is not a
    GID in the HCA Port's GID Table.

    This GID must be tested-for separately -- and packets which contain
    this destination GID should be routed to slave 0 (the PF).

    Fixes: 37bfc7c1e83f ('IB/mlx4: SR-IOV multiplex and demultiplex MADs')
    Signed-off-by: Jack Morgenstein
    Signed-off-by: Daniel Jurgens
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Jack Morgenstein
     
  • commit c482af646d0809a8d5e1b7f4398cce3592589b98 upstream.

    For non-special QPs, the port value becomes non-zero only at the
    RESET-to-INIT transition. If the QP has not undergone that transition,
    its port number value is still zero.

    If such a QP is destroyed before being moved out of the RESET state,
    subtracting one from the qp port number results in a negative value.
    Using that negative value as an index into the qp1_proxy array
    results in an out-of-bounds array reference.

    Fix this by testing that the QP type is one that uses qp1_proxy before
    using the port number. For special QPs of all types, the port number is
    specified at QP creation time.

    Fixes: 9433c188915c ("IB/mlx4: Invoke UPDATE_QP for proxy QP1 on MAC changes")
    Signed-off-by: Jack Morgenstein
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Jack Morgenstein
     
  • commit af4295c117b82a521b05d0daf39ce879d26e6cb1 upstream.

    Set traffic class within sl_tclass_flowlabel when create iboe AH.
    Without this the TOS value will be empty when running VLAN tagged
    traffic, because the TOS value is taken from the traffic class in the
    address handle attributes.

    Fixes: 9106c4106974 ('IB/mlx4: Fix SL to 802.1Q priority-bits mapping for IBoE')
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Daniel Jurgens
    Reviewed-by: Mark Bloch
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Maor Gottlieb
     
  • commit acbda523884dcf45613bf6818d8ead5180df35c2 upstream.

    Wait before continuing unload till all pending mkey async creation requests
    are done.

    Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
    Signed-off-by: Eli Cohen
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eli Cohen
     
  • commit c73b7911de97fad3ab9032a110af48d6ab2da48f upstream.

    Move the SRQ type assignment to be before actually using it
    in create_srq_user() and in create_srq_kernel() functions.

    Fixes: af1ba291c5e4 ('{net, IB}/mlx5: Refactor internal SRQ API')
    Signed-off-by: Maor Gottlieb
    Reviewed-by: Majd Dibbiny
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Maor Gottlieb
     
  • commit 288c01b746aab484651391ca6d64b585d3eb5ec6 upstream.

    Add the 512 bytes limit of RDMA READ and the size of remote
    address to the max SGE calculation.

    Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
    Signed-off-by: Eli Cohen
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eli Cohen
     
  • commit afd02cd3a9b6c04b41d946b5d7f6e17b3fc30c6b upstream.

    When enabling many VFs, the total amount of DMA mappings increase
    significantly. This causes DMA allocations to take a lot of time
    since they are serialized in the kernel.

    As a result the driver enters into fatal condition due to
    timeout and the system hangs. To recover from this we disable
    MR cache for VFs.

    PFs will still have a full cache and VFs cache can be manipulated
    as usual after driver load.

    Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
    Signed-off-by: Eli Cohen
    Signed-off-by: Maor Gottlieb
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eli Cohen
     
  • commit a0fa72683e78979ef1123d679b1c40ae28bd9096 upstream.

    A race condition fix added an rxe_qp structure to the stack in order
    to be able to perform rollback in rxe_requester(), but the structure
    is large enough to trigger the warning for possible stack overflow:

    drivers/infiniband/sw/rxe/rxe_req.c: In function 'rxe_requester':
    drivers/infiniband/sw/rxe/rxe_req.c:757:1: error: the frame size of 2064 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

    This changes the rollback function to only save the psn inside
    the qp, which is the only field we access in the rollback_qp
    anyway.

    Fixes: 3050b9985024 ("IB/rxe: Fix race condition between requester and completer")
    Signed-off-by: Arnd Bergmann
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit d680ebed91e0b45c43ae03a880a0b43211096161 upstream.

    Increase limit of max CQE from 8K to 32K to allow demanding
    applications to work over SoftRoCE with same configuration
    as most RoCEv2 HW vendors have.

    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Signed-off-by: Yonatan Cohen
    Reviewed-by: Moni Shoua
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Yonatan Cohen
     
  • commit aa6aae38f7fb2c030f326a6dd10b58fff1851dfa upstream.

    The failure in ib_cache_setup_one function during
    ib_register_device will leave leaked allocated memory.

    Fixes: 03db3a2d81e6 ("IB/core: Add RoCE GID table management")
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Leon Romanovsky
     

20 Jan, 2017

23 commits

  • Greg Kroah-Hartman
     
  • commit 5d7400c4acbf7fe633a976a89ee845f7333de3e4 upstream.

    Always stating PIN_CONFIG_BIAS_DISABLE is supported gives untrue output
    when examining /sys/kernel/debug/pinctrl/e6060000.pfc/pinconf-pins if
    the operation get_bias() is implemented but the pin is not handled by
    the get_bias() implementation. In that case the output will state that
    "input bias disabled" indicating that this pin has bias control
    support.

    Make support for PIN_CONFIG_BIAS_DISABLE depend on that the pin either
    supports SH_PFC_PIN_CFG_PULL_UP or SH_PFC_PIN_CFG_PULL_DOWN. This also
    solves the issue where SoC specific implementations print error messages
    if their particular implementation of {set,get}_bias() is called with a
    pin it does not know about.

    Signed-off-by: Niklas Söderlund
    Acked-by: Laurent Pinchart
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Greg Kroah-Hartman

    Niklas Söderlund
     
  • commit 69d012345a1a32d3f03957f14d972efccc106a98 upstream.

    In current code, the @changed always returns the last one's status for
    the huge page with the contiguous bit set. This is really not what we
    want. Even one of the PTEs is changed, we should tell it to the caller.

    This patch fixes this issue.

    Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
    Signed-off-by: Huang Shijie
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Huang Shijie
     
  • commit 20156ce2365d61beaa6f5a78a7a789044e0e7acc upstream.

    The find_num_contig() will return 1 when the pmd is not present.
    It will cause a kernel dead loop in the following scenaro:

    1.) pmd entry is not present.

    2.) the page fault occurs:
    ... hugetlb_fault() --> hugetlb_no_page() --> set_huge_pte_at()

    3.) set_huge_pte_at() will only set the first PMD entry, since the
    find_num_contig just return 1 in this case. So the PMD entries
    are all empty except the first one.

    4.) when kernel accesses the address mapped by the second PMD entry,
    a new page fault occurs:
    ... hugetlb_fault() --> huge_ptep_set_access_flags()

    The second PMD entry is still empty now.

    5.) When the kernel returns, the access will cause a page fault again.
    The kernel will run like the "4)" above.
    We will see a dead loop since here.

    The dead loop is caught in the 32M hugetlb page (2M PMD + Contiguous bit).

    This patch removes wrong pmd check, and fixes this dead loop.

    This patch also removes the redundant checks for PGD/PUD in
    the find_num_contig().

    Acked-by: Steve Capper
    Signed-off-by: Huang Shijie
    Reviewed-by: Catalin Marinas
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Huang Shijie
     
  • commit 0c2f0afe3582c58efeef93bc57bc07d502132618 upstream.

    The libhugetlbfs meets several failures since the following functions
    do not use the correct address:
    huge_ptep_get_and_clear()
    huge_ptep_set_access_flags()
    huge_ptep_set_wrprotect()
    huge_ptep_clear_flush()

    This patch fixes the wrong address for them.

    Signed-off-by: Huang Shijie
    Reviewed-by: Catalin Marinas
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Huang Shijie
     
  • commit d4791db527bf397c84c9956c3ece9692ed5322ac upstream.

    Whenever a PE is initialised in powernv, opal_pci_eeh_freeze_clear() is
    called. This is to remove any existing freeze, and has no negative side
    effects if the PE is already in an unfrozen state. On PHB backends that
    don't support this operation and return OPAL_UNSUPPORTED, this creates a
    scary and misleading warning message.

    Skip the warning message on init if OPAL_UNSUPPORTED is returned.

    As far as I'm aware, this currently only affects NPUs.

    Fixes: 313483d ("powerpc/powernv: Unfreeze PE on allocation")
    Signed-off-by: Russell Currey
    Acked-by: Gavin Shan
    Reviewed-by: Andrew Donnellan
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Russell Currey
     
  • commit fe0f3168169f7c34c29b0cf0c489f126a7f29643 upstream.

    Make sure to drop any reference taken by bus_find_device() in the sysfs
    callbacks that are used to create and destroy devices based on
    device-tree entries.

    Fixes: 6bccf755ff53 ("[POWERPC] ibmebus: dynamic addition/removal of adapters, some code cleanup")
    Signed-off-by: Johan Hovold
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 815a7141c4d1b11610dccb7fcbb38633759824f2 upstream.

    Make sure to drop any reference taken by bus_find_device() when creating
    devices during init and driver registration.

    Fixes: 55347cc9962f ("[POWERPC] ibmebus: Add device creation and bus probing based on of_device")
    Signed-off-by: Johan Hovold
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 555c16328ae6d75a90e234eac9b51998d68f185b upstream.

    Version 3.00 of the ISA states that the PATS (partition table size) field
    of the PTCR (partition table control register) and the PRTS (process table
    size) field of the partition table entry must both be less than or equal
    to 24. However the actual size of the partition and process tables is equal
    to 2 to the power of 12 plus the PATS and PRTS fields, respectively. This
    means that the max allowable size of each of these tables is 2^36 or 64GB
    for both.

    Thus when checking the size shift for each we should be checking for values
    of greater than 36 instead of the current check for shifts larger than 24
    and 23.

    Fixes: 2bfd65e45e877fb5704730244da67c748d28a1b8
    Signed-off-by: Suraj Jitindar Singh
    Reviewed-by: Balbir Singh
    Reviewed-by: Aneesh Kumar K.V
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Suraj Jitindar Singh
     
  • commit c090959b9dd8c87703e275079aa4b4a824ba3f8e upstream.

    Make sure to drop the reference to the parent device taken by
    class_find_device() after populating the bus.

    Fixes: 3b9334ac835b ("mfd: vexpress: Convert custom func API to regmap")
    Acked-by: Sudeep Holla
    Signed-off-by: Johan Hovold
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit c02ebfdddbafa9a6a0f52fbd715e6bfa229af9d3 upstream.

    Commit 0e87e58bf60e ("blk-mq: improve warning for running a queue on the
    wrong CPU") attempts to avoid triggering the WARN_ON in
    __blk_mq_run_hw_queue when the expected CPU is dead. Problem is, in the
    last batch execution before round robin, blk_mq_hctx_next_cpu can
    schedule a dead CPU and also update next_cpu to the next alive CPU in
    the mask, which will trigger the WARN_ON despite the previous
    workaround.

    The following patch fixes this scenario by always scheduling the value
    in hctx->next_cpu. This changes the moment when we round-robin the CPU
    running the hctx, but it really doesn't matter, since it still executes
    BLK_MQ_CPU_WORK_BATCH times in a row before switching to another CPU.

    Fixes: 0e87e58bf60e ("blk-mq: improve warning for running a queue on the wrong CPU")
    Signed-off-by: Gabriel Krisman Bertazi
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Gabriel Krisman Bertazi
     
  • commit 3bee9ea1de687925d116670f036599cbed8b66b0 upstream.

    The BQ27510 and BQ27520 use a slightly different register map than the
    BQ27500, add a new type enum and add these gauges to it.

    Fixes: d74534c27775 ("power: bq27xxx_battery: Add support for additional bq27xxx family devices")
    Based-on-patch-by: Kenneth R. Crudup
    Signed-off-by: Andrew F. Davis
    Signed-off-by: Sebastian Reichel
    Signed-off-by: Greg Kroah-Hartman

    Andrew F. Davis
     
  • commit 075eb5719d53e8bb4a406ad87e1de99319aa50f0 upstream.

    There's a typo, it should do pm_runtime_get_sync, not put.

    Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
    Cc: Mark A. Greer
    Signed-off-by: Tony Lindgren
    Reviewed-by: Mark Greer
    Signed-off-by: Sebastian Reichel
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     
  • commit 15f7e3c21b76598bc6e5816d2577ce843b2b963f upstream.

    Fix to return error code -ENOMEM from the __get_free_page() error
    handling case instead of 0, as done elsewhere in this function.

    Fixes: 05eb23893c2c ("cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes")
    Signed-off-by: Wei Yongjun
    Acked-by: Steve Wise
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • commit cb43f81b8489dcb87555e16c17453f0a9fa690f2 upstream.

    Commit e1399ba20eee ("powercap / RAPL: handle missing MSRs") added
    contraint_to_pl() function to return index into an array. But it
    can potentially return -EINVAL if powercap layer sends an out of
    range constraint ID. This patch adds sanity check.

    Unnecessary RAPL domain pointer check is removed since it must be
    initialized before calling rapl_unit_xlate().

    Fixes: e1399ba20eee ("powercap / RAPL: handle missing MSRs")
    Reported-by: Odzioba, Lukasz
    Reported-by: Koss, Marcin
    Signed-off-by: Jacob Pan
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Jacob Pan
     
  • commit a545715d2dae8d071c5b06af947b07ffa846b288 upstream.

    When removing and adding cpu 0 on a system with GHES NMI the following stack
    trace is seen when re-adding the cpu:

    WARNING: CPU: 0 PID: 0 at arch/x86/kernel/apic/apic.c:1349 setup_local_APIC+
    Modules linked in: nfsv3 rpcsec_gss_krb5 nfsv4 nfs fscache coretemp intel_ra
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc6+ #2
    Call Trace:
    dump_stack+0x63/0x8e
    __warn+0xd1/0xf0
    warn_slowpath_null+0x1d/0x20
    setup_local_APIC+0x275/0x370
    apic_ap_setup+0xe/0x20
    start_secondary+0x48/0x180
    set_init_arg+0x55/0x55
    early_idt_handler_array+0x120/0x120
    x86_64_start_reservations+0x2a/0x2c
    x86_64_start_kernel+0x13d/0x14c

    During the cpu bringup, wakeup_cpu_via_init_nmi() is called and issues an
    NMI on CPU 0. The GHES NMI handler, ghes_notify_nmi() runs the
    ghes_proc_irq_work work queue which ends up setting IRQ_WORK_VECTOR
    (0xf6). The "faulty" IR line set at arch/x86/kernel/apic/apic.c:1349 is also
    0xf6 (specifically APIC IRR for irqs 255 to 224 is 0x400000) which confirms
    that something has set the IRQ_WORK_VECTOR line prior to the APIC being
    initialized.

    Commit 2383844d4850 ("GHES: Elliminate double-loop in the NMI handler")
    incorrectly modified the behavior such that the handler returns
    NMI_HANDLED only if an error was processed, and incorrectly runs the ghes
    work queue for every NMI.

    This patch modifies the ghes_proc_irq_work() to run as it did prior to
    2383844d4850 ("GHES: Elliminate double-loop in the NMI handler") by
    properly returning NMI_HANDLED and only calling the work queue if
    NMI_HANDLED has been set.

    Fixes: 2383844d4850 (GHES: Elliminate double-loop in the NMI handler)
    Signed-off-by: Prarit Bhargava
    Reviewed-by: Borislav Petkov
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Prarit Bhargava
     
  • commit ebc4ff661fbe76781c6b16dfb7b754a5d5073f8e upstream.

    cfq_cpd_alloc() which is the cpd_alloc_fn implementation for cfq was
    incorrectly hard coding GFP_KERNEL instead of using the mask specified
    through the @gfp parameter. This currently doesn't cause any actual
    issues because all current callers specify GFP_KERNEL. Fix it.

    Signed-off-by: Tejun Heo
    Reported-by: Dan Carpenter
    Fixes: e4a9bde9589f ("blkcg: replace blkcg_policy->cpd_size with ->cpd_alloc/free_fn() methods")
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • commit 9a05e7541c39680d28ecf91892338e074738d5fd upstream.

    With compilers which follow the C99 standard (like modern versions of
    gcc and clang), "extern inline" does the opposite thing from older
    versions of gcc (emits code for an externally linkable version of the
    inline function).

    "static inline" does the intended behavior in all cases instead.

    Description taken from commit 6d91857d4826 ("staging, rtl8192e,
    LLVMLinux: Change extern inline to static inline").

    This also fixes the following GCC warning when building with CONFIG_PM
    disabled:

    ./include/linux/blkdev.h:1143:20: warning: no previous prototype for 'blk_set_runtime_active' [-Wmissing-prototypes]

    Fixes: d07ab6d11477 ("block: Add blk_set_runtime_active()")
    Reviewed-by: Mika Westerberg
    Signed-off-by: Tobias Klauser
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Tobias Klauser
     
  • commit 501634759d55a5b56967de6d9465acf02bbc3565 upstream.

    We should return -EINVAL (instead of 0) if get_cpu_device() fails.

    Fixes: 158c998ea44b (ACPI / CPPC: add sysfs support to compute delivered performance)
    Signed-off-by: Dan Carpenter
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 85b037442e3f0e84296ab1010fd6b057eee18496 upstream.

    The handling of bypass_val_on that was added in
    regulator_get_bypass_regmap is done unconditionally however
    several drivers don't define a value for bypass_val_on. This
    results in those drivers reporting bypass being enabled when
    it is not. In regulator_set_bypass_regmap we use bypass_mask
    if bypass_val_on is zero. This patch adds similar handling in
    regulator_get_bypass_regmap.

    Fixes: commit dd1a571daee7 ("regulator: helpers: Ensure bypass register field matches ON value")
    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Charles Keepax
     
  • commit 8a10c06a20ec8097a68fd7a4a1c0e285095b4d2f upstream.

    With preemption turned on we can read incorrect throttling state
    while being switched to CPU on a different chip.

    BUG: using smp_processor_id() in preemptible [00000000] code: cat/7343
    caller is .powernv_cpufreq_throttle_check+0x2c/0x710
    CPU: 13 PID: 7343 Comm: cat Not tainted 4.8.0-rc5-dirty #1
    Call Trace:
    [c0000007d25b75b0] [c000000000971378] .dump_stack+0xe4/0x150 (unreliable)
    [c0000007d25b7640] [c0000000005162e4] .check_preemption_disabled+0x134/0x150
    [c0000007d25b76e0] [c0000000007b63ac] .powernv_cpufreq_throttle_check+0x2c/0x710
    [c0000007d25b7790] [c0000000007b6d18] .powernv_cpufreq_target_index+0x288/0x360
    [c0000007d25b7870] [c0000000007acee4] .__cpufreq_driver_target+0x394/0x8c0
    [c0000007d25b7920] [c0000000007b22ac] .cpufreq_set+0x7c/0xd0
    [c0000007d25b79b0] [c0000000007adf50] .store_scaling_setspeed+0x80/0xc0
    [c0000007d25b7a40] [c0000000007ae270] .store+0xa0/0x100
    [c0000007d25b7ae0] [c0000000003566e8] .sysfs_kf_write+0x88/0xb0
    [c0000007d25b7b70] [c0000000003553b8] .kernfs_fop_write+0x178/0x260
    [c0000007d25b7c10] [c0000000002ac3cc] .__vfs_write+0x3c/0x1c0
    [c0000007d25b7cf0] [c0000000002ad584] .vfs_write+0xc4/0x230
    [c0000007d25b7d90] [c0000000002aeef8] .SyS_write+0x58/0x100
    [c0000007d25b7e30] [c00000000000bfec] system_call+0x38/0xfc

    Fixes: 09a972d16209 (cpufreq: powernv: Report cpu frequency throttling)
    Reviewed-by: Gautham R. Shenoy
    Signed-off-by: Denis Kirjanov
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Denis Kirjanov
     
  • commit 6b243fcfb5f1e16bcf732e6f86a63f8af5b59a9f upstream.

    This changes the way that we support the new ISA v3.00 HPTE format.
    Instead of adapting everything that uses HPTE values to handle either
    the old format or the new format, depending on which CPU we are on,
    we now convert explicitly between old and new formats if necessary
    in the low-level routines that actually access HPTEs in memory.
    This limits the amount of code that needs to know about the new
    format and makes the conversions explicit. This is OK because the
    old format contains all the information that is in the new format.

    This also fixes operation under a hypervisor, because the H_ENTER
    hypercall (and other hypercalls that deal with HPTEs) will continue
    to require the HPTE value to be supplied in the old format. At
    present the kernel will not boot in HPT mode on POWER9 under a
    hypervisor.

    This fixes and partially reverts commit 50de596de8be
    ("powerpc/mm/hash: Add support for Power9 Hash", 2016-04-29).

    Fixes: 50de596de8be ("powerpc/mm/hash: Add support for Power9 Hash")
    Signed-off-by: Paul Mackerras
    Reviewed-by: Aneesh Kumar K.V
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Paul Mackerras
     
  • commit 1d701d3dd8caf6660ff33c3c23a115b4649c5cdb upstream.

    Fix to return a negative error code from the st_rproc_state() error
    handling case instead of 0, as done elsewhere in this function.

    Fixes: 63edb0310a5c ("remoteproc: Supply controller driver for ST's Remote Processors")
    Signed-off-by: Wei Yongjun
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun