08 Apr, 2016

11 commits

  • SKX is similar to BDX

    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Len Brown
     
  • This driver registers cpuidle devices when a CPU comes online, but it
    leaves the registrations in place when a CPU goes offline. The module
    exit code only unregisters the currently online CPUs, leaving the
    devices for offline CPUs dangling.

    This patch changes the driver to clean up all registrations on exit,
    even those from CPUs that are offline.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • If a cpuidle registration error occurs during the hot plug notifier
    callback, we should really inform the hot plug machinery instead of
    just ignoring the error. This patch changes the callback to properly
    return on error.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • The helper function, intel_idle_cpu_init, registers one new device
    with the cpuidle layer. If the registration should fail, that
    function immediately calls intel_idle_cpuidle_devices_uninit() to
    unregister every last CPU's device. However, it makes no sense to do
    so, when called from the hot plug notifier callback.

    This patch moves the call to intel_idle_cpuidle_devices_uninit()
    outside of the helper function to the one call site that actually
    needs to perform the de-registrations.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • This driver sets the broadcast tick quite early on during probe and does
    not clean up again in cast of failure. This patch moves the setup call
    after the registration, placing the on_each_cpu() calls within the global
    CPU lock region.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • The helper function, intel_idle_cpuidle_devices_uninit, frees the
    globally allocated per-CPU data. However, this function is invoked
    from the hot plug notifier callback at a time when freeing that data
    is not safe.

    If the call to cpuidle_register_driver() should fail (say, due to lack
    of memory), then the driver will free its per-CPU region. On the
    *next* CPU_ONLINE event, the driver will happily use the region again
    and even free it again if the failure repeats.

    This patch fixes the issue by moving the call to free_percpu() outside
    of the helper function at the two call sites that actually need to
    free the per-CPU data.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • In the module_init() method, if the per-CPU allocation fails, then the
    active cpuidle registration is not cleaned up. This patch fixes the
    issue by attempting the allocation before registration, and then
    cleaning it up again on registration failure.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • In the module_exit() method, this driver first frees its per-CPU
    pointer, then unregisters a callback making use of the pointer.
    Furthermore, the function, intel_idle_cpuidle_devices_uninit, is racy
    against CPU hot plugging as it calls for_each_online_cpu().

    This patch corrects the issues by unregistering first on the exit path
    while holding the hot plug lock.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • The function, intel_idle_cpuidle_driver_init, makes calls on each CPU
    to auto_demotion_disable() and c1e_promotion_disable(). These calls
    are redundant, as intel_idle_cpu_init() does the same calls just a bit
    later on. They are also premature, as the driver registration may yet
    fail.

    This patch removes the redundant code.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • The function, intel_idle_cpuidle_driver_init, delivers no error codes
    at all. This patch changes the function to return 'void' instead of
    returning zero.

    Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     
  • Signed-off-by: Richard Cochran
    Signed-off-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Richard Cochran
     

24 Mar, 2016

3 commits


21 Mar, 2016

1 commit

  • Commit a9ceb78bc75c (cpuidle,menu: use interactivity_req to disable
    polling) changed the behavior of the fallback state selection part
    of menu_select() so it looks at interactivity_req instead of
    data->next_timer_us when it makes its decision. That effectively
    caused polling to be used more often as fallback idle which led to
    significant increases of energy consumption in some cases.

    Commit e132b9b3bc7f (cpuidle: menu: use high confidence factors
    only when considering polling) changed that logic again to be more
    predictable, but that didn't help with the increased energy
    consumption problem.

    For this reason, go back to making decisions on which state to fall
    back to based on data->next_timer_us which is the time we know for
    sure something will happen rather than a prediction (which may be
    inaccurate and turns out to be so often enough to be problematic).
    However, take the target residency of the first proper idle state
    (C1) into account, so that state is not used as the fallback one
    if its target residency is greater than data->next_timer_us.

    Fixes: a9ceb78bc75c (cpuidle,menu: use interactivity_req to disable polling)
    Signed-off-by: Rafael J. Wysocki
    Reported-and-tested-by: Doug Smythies

    Rafael J. Wysocki
     

17 Mar, 2016

1 commit

  • The menu governor uses five different factors to pick the
    idle state:
    - the user configured latency_req
    - the time until the next timer (next_timer_us)
    - the typical sleep interval, as measured recently
    - an estimate of sleep time by dividing next_timer_us by an observed factor
    - a load corrected version of the above, divided again by load

    Only the first three items are known with enough confidence that
    we can use them to consider polling, instead of an actual CPU
    idle state, because the cost of being wrong about polling can be
    excessive power use.

    The latter two are used in the menu governor's main selection
    loop, and can result in choosing a shallower idle state when
    the system is expected to be busy again soon.

    This pushes a busy system in the "performance" direction of
    the performance<>power tradeoff, when choosing between idle
    states, but stays more strictly on the "power" state when
    deciding between polling and C1.

    Signed-off-by: Rik van Riel
    Signed-off-by: Rafael J. Wysocki

    Rik van Riel
     

17 Feb, 2016

2 commits


15 Feb, 2016

13 commits

  • Linus Torvalds
     
  • Pull char/misc driver fixes from Greg KH:
    "Here are 3 fixes for some reported issues. Two nvmem driver fixes,
    and one mei fix. All have been in linux-next just fine"

    * tag 'char-misc-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    nvmem: qfprom: Specify LE device endianness
    nvmem: core: return error for non word aligned access
    mei: validate request value in client notify request ioctl

    Linus Torvalds
     
  • Pull driver core fix from Greg KH:
    "Here is one driver core, well klist, fix for 4.5-rc4.

    It fixes a problem found in the scsi device list traversal that
    probably also could be triggered by other subsystems.

    The fix has been in linux-next for a while with no reported problems"

    * tag 'driver-core-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    klist: fix starting point removed bug in klist iterators

    Linus Torvalds
     
  • Pull tty/serial fixes from Greg KH:
    "Here are a number of small tty and serial driver fixes for 4.5-rc4
    that resolve some reported issues.

    One of them got reverted as it wasn't correct based on testing, and
    all have been in linux-next for a while"

    * tag 'tty-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    Revert "8250: uniphier: allow modular build with 8250 console"
    pty: make sure super_block is still valid in final /dev/tty close
    pty: fix possible use after free of tty->driver_data
    tty: Add support for PCIe WCH382 2S multi-IO card
    serial/omap: mark wait_for_xmitr as __maybe_unused
    serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485)
    8250: uniphier: allow modular build with 8250 console
    tty: Drop krefs for interrupted tty lock

    Linus Torvalds
     
  • Pull PHY fixes from Greg KH:
    "Here are a couple of PHY driver fixes for 4.5-rc4.

    A few small phy issues. All have been in linux-next with no reported
    issues"

    * tag 'usb-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
    phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload
    phy: twl4030-usb: Relase usb phy on unload
    phy: core: fix wrong err handle for phy_power_on
    phy: Restrict phy-hi6220-usb to HiSilicon arm64

    Linus Torvalds
     
  • Pull perf tooling fixes from Thomas Gleixner:
    "Another round of fixes for the perf tooling side:

    - Prevent a NULL pointer dereference in tracepoint error handling

    - Fix a thread handling bug in the intel_pt error handling code

    - Search both .eh_frame and .debug_frame sections as toolchains seem
    to have random choices of storing the CFI information

    - Fix the perf state interval output values, which got broken when
    fixing the overall output"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf stat: Fix interval output values
    perf probe: Search both .eh_frame and .debug_frame sections for probe location
    perf tools: Fix thread lifetime related segfaut in intel_pt
    perf tools: tracepoint_error() can receive e=NULL, robustify it

    Linus Torvalds
     
  • Pull lockdep fix from Thomas Gleixner:
    "A single fix for the stack trace caching logic in lockdep, where the
    duplicate avoidance managed to store no back trace at all"

    * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    locking/lockdep: Fix stack trace caching logic

    Linus Torvalds
     
  • Pull timer fix from Thomas Gleixner:
    "A single fix preventing a 32bit overflow in timespec/val to cputime
    conversions on 32bit machines"

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    cputime: Prevent 32bit overflow in time[val|spec]_to_cputime()

    Linus Torvalds
     
  • Pull irqchip fixes from Thomas Gleixner:
    "Another set of ARM SoC related irqchip fixes:
    - Plug a memory leak in gicv3-its
    - Limit features to the root gic interrupt controller
    - Add a missing barrier in the gic-v3 IAR access
    - Another compile test fix for sun4i"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irqchip/gic-v3: Make sure read from ICC_IAR1_EL1 is visible on redestributor
    irqchip/gic: Only set the EOImodeNS bit for the root controller
    irqchip/gic: Only populate set_affinity for the root controller
    irqchip/gicv3-its: Fix memory leak in its_free_tables()
    irqchip/sun4i: Fix compilation outside of arch/arm

    Linus Torvalds
     
  • Pull x86 fixes from Thomas Gleixner:
    "Two small fixlets for x86:

    - Prevent a KASAN false positive in thread_saved_pc()

    - Fix a 32-bit truncation problem in the x86 numa code"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/mm/numa: Fix 32-bit memblock range truncation bug on 32-bit NUMA kernels
    x86: Fix KASAN false positives in thread_saved_pc()

    Linus Torvalds
     
  • Pull MIPS fixes from Ralf Baechle:
    "Here's the first round of MIPS fixes after the merge window:

    - Detect Octeon III's PCI correctly.
    - Fix return value of the MT7620 probing function.
    - Wire up the copy_file_range syscall.
    - Fix 64k page support on 32 bit kernels.
    - Fix the early Coherency Manager probe.
    - Allow only hardware-supported page sizes to be selected for R6000.
    - Fix corner cases for the RDHWR nstruction emulation on old hardware.
    - Fix FPU handling corner cases.
    - Remove stale entry for BCM33xx from the MAINTAINERS file.
    - 32 and 64 bit ELF headers are different, handle them correctly"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
    mips: Differentiate between 32 and 64 bit ELF header
    MIPS: Octeon: Update OCTEON_FEATURE_PCIE for Octeon III
    MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe()
    MIPS: Fix early CM probing
    MIPS: Wire up copy_file_range syscall.
    MIPS: Fix 64k page support for 32 bit kernels.
    MIPS: R6000: Don't allow 64k pages for R6000.
    MIPS: traps.c: Correct microMIPS RDHWR emulation
    MIPS: traps.c: Don't emulate RDHWR in the CpU #0 exception handler
    MAINTAINERS: Remove stale entry for BCM33xx chips
    MIPS: Fix FPU disable with preemption
    MIPS: Properly disable FPU in start_thread()
    MIPS: Fix buffer overflow in syscall_get_arguments()

    Linus Torvalds
     
  • Pull ARM fixes from Russell King:
    "A couple of ARM fixes from Linus for the ICST clock generator code"

    [ "Linus" here is Linus Walleij. Name-stealer.

    Linus "there can be only one" Torvalds ]

    * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    ARM: 8519/1: ICST: try other dividends than 1
    ARM: 8517/1: ICST: avoid arithmetic overflow in icst_hz()

    Linus Torvalds
     
  • Pull component helper fixes from Russell King:
    "A few fixes for problems people have encountered with the recent
    update to the component helpers"

    * 'component' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    component: remove device from master match list on failed add
    component: Detach components when deleting master struct
    component: fix crash on x86_64 with hda audio drivers

    Linus Torvalds
     

14 Feb, 2016

5 commits

  • Pull more rdma fixes from Doug Ledford:
    "I think we are getting pretty close to done now. There are four
    one-off fixes in this update:

    - fix ipoib multicast joins
    - fix mlx4 error handling
    - fix mlx5 size computation
    - fix a thinko in core code"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
    IB/mlx5: Fix RC transport send queue overhead computation
    IB/ipoib: fix for rare multicast join race condition
    IB/core: Fix reading capability mask of the port info class
    net/mlx4: fix some error handling in mlx4_multi_func_init()

    Linus Torvalds
     
  • Pull SCSI target fixes from Nicholas Bellinger:
    "This includes the long awaited series to address a set of bugs around
    active I/O remote-port LUN_RESET, as well as properly handling this
    same case with concurrent fabric driver session disconnect ->
    reconnect.

    Note this set of LUN_RESET bug-fixes has been surviving extended
    testing on both v4.5-rc1 and v3.14.y code over the last weeks, and is
    CC'ed for stable as it's something folks using multiple ESX connected
    hosts with slow backends can certainly trigger.

    The highlights also include:

    - Fix WRITE_SAME/DISCARD emulation 4k sector conversion in
    target/iblock (Mike Christie)

    - Fix TMR abort interaction and AIO type TMR response in qla2xxx
    target (Quinn Tran + Swapnil Nagle)

    - Fix >= v3.17 stale descriptor pointer regression in qla2xxx target
    (Quinn Tran)

    - Fix >= v4.5-rc1 return regression with unmap_zeros_data_store new
    configfs store handler (nab)

    - Add CPU affinity flag + convert qla2xxx to use bit (Quinn + HCH +
    Bart)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
    qla2xxx: use TARGET_SCF_USE_CPUID flag to indiate CPU Affinity
    target/transport: add flag to indicate CPU Affinity is observed
    target: Fix incorrect unmap_zeroes_data_store return
    qla2xxx: Use ATIO type to send correct tmr response
    qla2xxx: Fix stale pointer access.
    target/user: Fix cast from pointer to phys_addr_t
    target: Drop legacy se_cmd->task_stop_comp + REQUEST_STOP usage
    target: Fix race with SCF_SEND_DELAYED_TAS handling
    target: Fix remote-port TMR ABORT + se_cmd fabric stop
    target: Fix TAS handling for multi-session se_node_acls
    target: Fix LUN_RESET active TMR descriptor handling
    target: Fix LUN_RESET active I/O handling for ACK_KREF
    qla2xxx: Fix TMR ABORT interaction issue between qla2xxx and TCM
    qla2xxx: Fix warning reported by static checker
    target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors

    Linus Torvalds
     
  • Pull thermal management fixes from Eduardo Valentin:
    "Specifics in this pull request:

    - Compilation fixes on SPEAR, and U8500 thermal drivers.
    - RCAR thermal driver now recognizes OF-thermal based thermal zones.
    - Small code rework on OF-thermal.
    - These change have been CI tested using KernelCI bot [1,2]. \o/

    I am taking over on Rui's behalf while he is out. Happy New Chinese
    Year!

    [1] - https://kernelci.org/build/evalenti/kernel/v4.5-rc3-16-ga53b8394ec3c/
    [2] - https://kernelci.org/boot/all/job/evalenti/kernel/v4.5-rc3-16-ga53b8394ec3c/"

    * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
    thermal: cpu_cooling: fix out of bounds access in time_in_idle
    thermal: allow u8500-thermal driver to be a module
    thermal: allow spear-thermal driver to be a module
    thermal: spear: use __maybe_unused for PM functions
    thermal: rcar: enable to use thermal-zone on DT
    thermal: of: use for_each_available_child_of_node for child iterator

    Linus Torvalds
     
  • Pull another sound fix from Takashi Iwai:
    "This contains a fix for the double-free of usb-audio MIDI device at
    probe failure"

    * tag 'sound-fix-4.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: usb-audio: avoid freeing umidi object twice

    Linus Torvalds
     
  • Pull ARC fixes from Vineet Gupta:
    "I've been sitting on some of these fixes for a while.

    - Corner case of returning to delay slot from interrupt
    - Changing default interrupt prioiry level
    - Kconfig'ize support for super pages
    - Other minor fixes"

    * tag 'arc-4.5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
    ARC: mm: Introduce explicit super page size support
    ARCv2: intc: Allow interruption by lowest priority interrupt
    ARCv2: Check for LL-SC livelock only if LLSC is enabled
    ARC: shrink cpuinfo by not saving full timer BCR
    ARCv2: clocksource: Rename GRTC -> GFRC ...
    ARCv2: STAR 9000950267: Handle return from intr to Delay Slot #2

    Linus Torvalds
     

13 Feb, 2016

4 commits

  • The 'umidi' object will be free'd on the error path by snd_usbmidi_free()
    when tearing down the rawmidi interface. So we shouldn't try to free it
    in snd_usbmidi_create() after having registered the rawmidi interface.

    Found by KASAN.

    Signed-off-by: Andrey Konovalov
    Acked-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Andrey Konovalov
     
  • Pull PCI fixes from Bjorn Helgaas:
    "These are some Renesas binding updates for PCI host controllers, a
    Broadcom fix for a regression we added in v4.5-rc1, and a fix for an
    AER use-after-free problem that can cause memory corruption.

    Summary:

    AER:
    Flush workqueue on device remove to avoid use-after-free (Sebastian Andrzej Siewior)

    Broadcom iProc host bridge driver:
    Allow multiple devices except on PAXC (Ray Jui)

    Renesas R-Car host bridge driver:
    Add gen2 device tree support for r8a7793 (Simon Horman)
    Add device tree support for r8a7793 (Simon Horman)"

    * tag 'pci-v4.5-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI: rcar: Add device tree support for r8a7793
    PCI: rcar: Add gen2 device tree support for r8a7793
    PCI: iproc: Allow multiple devices except on PAXC
    PCI/AER: Flush workqueue on device remove to avoid use-after-free

    Linus Torvalds
     
  • Merge fixes from Andrew Morton:
    "10 fixes"

    The lockdep hlist conversion is in the locking tree too, waiting for the
    next merge window. Andrew thought it should go in now. I'll take it,
    since it fixes a real problem and looks trivially correct (famous last
    words).

    * emailed patches from Andrew Morton :
    arch/x86/Kconfig: CONFIG_X86_UV should depend on CONFIG_EFI
    mm: fix pfn_t vs highmem
    kernel/locking/lockdep.c: convert hash tables to hlists
    mm,thp: fix spellos in describing __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
    mm,thp: khugepaged: call pte flush at the time of collapse
    mm/backing-dev.c: fix error path in wb_init()
    mm, dax: check for pmd_none() after split_huge_pmd()
    vsprintf: kptr_restrict is okay in IRQ when 2
    mm: fix filemap.c kernel doc warning
    ubsan: cosmetic fix to Kconfig text

    Linus Torvalds
     
  • Fix the RC QPs send queue overhead computation to take into account
    two additional segments in the WQE which are needed for registration
    operations.

    The ATOMIC and UMR segments can't coexist together, so chose maximum out
    of them.

    The commit 9e65dc371b5c ("IB/mlx5: Fix RC transport send queue overhead
    computation") was intended to update RC transport as commit messages
    states, but added the code to UC transport.

    Fixes: 9e65dc371b5c ("IB/mlx5: Fix RC transport send queue overhead computation")
    Signed-off-by: Kamal Heib
    Signed-off-by: Leon Romanovsky
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Doug Ledford

    Leon Romanovsky