15 Feb, 2016

1 commit

  • 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
     

11 Feb, 2016

1 commit

  • Calling component_add() may result in the completion of a set of
    devices, which will try to bring up a master. In bringing the master
    up, we populate its match array with the current set of children.

    If binding any of the devices fails, component_add() itself will fail,
    free the struct component entry, and return to the caller. The
    now-freed entry is never removed from the master's match array, and
    will later be used in a futile attempt to bind to freed memory.

    Bring component_add's behaviour on failure to bring up a master into
    line with component_del by removing the (to-be-freed) component from
    the master's match array.

    The specific case which broke was:
    - rockchip_drm_drv adds a component master
    - dwhdmi_rockchip adds a child component in probe (master incomplete)
    - rockchip_drm_vop adds two children in probe, which completes the
    set
    - inside component_add, we try to bring up the master, having
    populated the master's match array, and fail with EPROBE_DEFER from
    dwhdmi_rockchip; we delete the putative component
    - rockchip_drm_vop's probe fails and returns EPROBE_DEFER
    - we later re-probe rockchip_drm_vop and add the component; the
    master is complete, so we attempt to bring it up again
    - walking the match array, we find the previous child, whose master
    pointer doesn't match (as it has been freed in the meantime)
    - rockchip_drm_vop probe fails, and will never be attempted again

    Fixes: ffc30b74fd6d01588bd3fdebc3b1acc0857e6fc8
    Signed-off-by: Daniel Stone
    Cc: Russell King
    Cc: Thierry Reding
    Cc: Laurent Pinchart
    Signed-off-by: Russell King

    Daniel Stone
     

09 Feb, 2016

1 commit

  • …nel/git/broonie/regmap

    Pull regmap fix from Mark Brown:
    "A single revert back to v4.4 endianness handling.

    Commit 29bb45f25ff3 ("regmap-mmio: Use native endianness for
    read/write") attempted to fix some long standing bugs in the MMIO
    implementation for big endian systems caused by duplicate byte
    swapping in both regmap and readl()/writel(). Sadly the fix makes
    things worse rather than better, so revert it for now"

    * tag 'regmap-fix-v4.5-big-endian' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
    regmap: mmio: Revert to v4.4 endianness handling

    Linus Torvalds
     

06 Feb, 2016

1 commit


05 Feb, 2016

1 commit

  • Commit 29bb45f25ff3 (regmap-mmio: Use native endianness for read/write)
    attempted to fix some long standing bugs in the MMIO implementation for
    big endian systems caused by duplicate byte swapping in both regmap and
    readl()/writel() which affected MIPS systems as when they are in big
    endian mode they flip the endianness of all registers in the system, not
    just the CPU. MIPS systems had worked around this by declaring regmap
    using IPs as little endian which is inaccurate, unfortunately the issue
    had not been reported.

    Sadly the fix makes things worse rather than better. By changing the
    behaviour to match the documentation it caused behaviour changes for
    other IPs which broke them and by using the __raw I/O accessors to avoid
    the endianness swapping in readl()/writel() it removed some memory
    ordering guarantees and could potentially generate unvirtualisable
    instructions on some architectures.

    Unfortunately sorting out all this mess in any half way sensible fashion
    was far too invasive to go in during an -rc cycle so instead let's go
    back to the old broken behaviour for v4.5, the better fixes are already
    queued for v4.6. This does mean that we keep the broken MIPS DTs for
    another release but that seems the least bad way of handling the
    situation.

    Reported-by: Johannes Berg
    Signed-off-by: Mark Brown

    Mark Brown
     

04 Feb, 2016

1 commit

  • There is a WARN_ON() in dev_pm_domain_set() that triggers on attempts
    to set the pm_domain pointer for devices with a driver bound.

    However, that WARN_ON() triggers on attempts to clear the pointer
    too and the test it uses is based on checking the device's
    p->knode_driver pointer which still is set when the device bus
    type's/driver's ->remove callback has been executed. This
    leads to false-positive warnings when bus type code calls
    dev_pm_domain_set() to clear the pm_domain pointer after
    invoking the driver's ->remove() callback.

    To avoid those false-positives, make dev_pm_domain_set() check
    if the pointer passed to it is NULL and skip the warning in
    that case.

    Fixes: 989561de9b51 (PM / Domains: add setter for dev.pm_domain)
    Signed-off-by: Rafael J. Wysocki
    Tested-by: Andy Shevchenko
    Tested-by: Sinan Kaya
    Tested-by: Steven Rostedt
    Acked-by: Ulf Hansson

    Rafael J. Wysocki
     

03 Feb, 2016

1 commit

  • The only remaining caller of genpd_poweron() is conditionally compiled
    based on CONFIG_PM_GENERIC_DOMAINS_OF, so we get a warning when that is
    unset.

    By moving the locking/unlocking of the genpd outside genpd_poweron(), thus
    to the caller, genpd_poweron() becomes redundant.

    Within this context let's then rename the wrapper function,
    __genpd_poweron(), to genpd_poweron() as it will then be consistent with
    its friend genpd_poweroff().

    This change silence the warning about the unused function.

    Reported-by: Arnd Bergmann
    Fixes: ea823c7cbffa "PM / Domains: Remove pm_genpd_poweron() API"
    Signed-off-by: Ulf Hansson
    Acked-by: Arnd Bergmann
    Cc: 4.4+ # 4.4+
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     

01 Feb, 2016

2 commits

  • Pull driver core fix from Greg KH:
    "Here's a single driver core fix that resolves an issue a lot of users
    have been hitting for a while now. It's been tested a lot and has
    been in linux-next successfully for a while"

    * tag 'driver-core-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    base/platform: Fix platform drivers with no probe callback

    Linus Torvalds
     
  • Pull IRQ fixes from Ingo Molnar:
    "Mostly irqchip driver fixes, but also an irq core crash fix and a
    build fix"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    irqchip/mxs: Add missing set_handle_irq()
    irqchip/atmel-aic: Fix wrong bit operation for IRQ priority
    irqchip/gic-v3-its: Recompute the number of pages on page size change
    base: Export platform_msi_domain_[alloc,free]_irqs
    of: MSI: Simplify irqdomain lookup
    irqdomain: Allow domain lookup with DOMAIN_BUS_WIRED token
    irqchip: Fix dependencies for archs w/o HAS_IOMEM
    irqchip/s3c24xx: Mark init_eint as __maybe_unused
    genirq: Validate action before dereferencing it in handle_irq_event_percpu()

    Linus Torvalds
     

30 Jan, 2016

1 commit

  • * pm-cpuidle:
    cpuidle: coupled: remove unused define cpuidle_coupled_lock
    cpuidle: fix fallback mechanism for suspend to idle in absence of enter_freeze

    * pm-cpufreq:
    cpufreq: cpufreq-dt: avoid uninitialized variable warnings:
    cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype
    cpufreq: Use list_is_last() to check last entry of the policy list
    cpufreq: Fix NULL reference crash while accessing policy->governor_data

    * pm-domains:
    PM / Domains: Fix typo in comment
    PM / Domains: Fix potential deadlock while adding/removing subdomains
    PM / domains: fix lockdep issue for all subdomains

    * pm-sleep:
    PM: APM_EMULATION does not depend on PM

    Rafael J. Wysocki
     

28 Jan, 2016

3 commits

  • Acked-by: Kevin Hilman
    Signed-off-by: Moritz Fischer
    Signed-off-by: Rafael J. Wysocki

    Moritz Fischer
     
  • We must preserve the same order of how we acquire and release the lock for
    genpd, as otherwise we may encounter deadlocks.

    The power on phase of a genpd starts by acquiring its lock. Then it walks
    the hierarchy of its parent domains to be able to power on these first, as
    per design of genpd.

    From a locking perspective this means the locks of the parents becomes
    acquired after the lock of the subdomain.

    Let's fix pm_genpd_add|remove_subdomain() to maintain the same order of
    acquiring/releasing the genpd lock as being applied in the power on/off
    sequence.

    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • component_master_add_with_match calls find_components which, if any
    components already exist, it attaches to the master struct. However, if
    we later encounter an error the master struct is deleted, leaving
    components with a dangling pointer to it.

    If the error was a temporary one, e.g. for probe deferral, then when
    the master device is re-probed, it will fail to find the required
    components as they appear to already be attached to a master.

    Fix this by nulling components pointers to the master struct when it is
    deleted. This code is factored out into a separate function so it can be
    shared with component_master_del.

    Signed-off-by: Jon Medhurst
    Signed-off-by: Russell King

    Jon Medhurst (Tixy)
     

27 Jan, 2016

2 commits

  • Maarten reports that the addition of releasing match data to the
    component helper results in a general protection fault on x86_64.

    This is caused by the devm resources being freed in reverse order
    to their allocation, which caused a use-after-free of the match
    array.

    Switch the match array to be a more conventional kmalloc/kfree()
    affair, explicitly freeing it along with the parent match data
    structure.

    Reported-by: Maarten Lankhorst
    Fixes: ce657b1cddf1 ("component: add support for releasing match data")
    Signed-off-by: Russell King

    Russell King
     
  • Since b8b2c7d845d5, platform_drv_probe() is called for all platform
    devices. If drv->probe is NULL, and dev_pm_domain_attach() fails,
    platform_drv_probe() will return the error code from dev_pm_domain_attach().

    This causes real_probe() to enter the "probe_failed" path and set
    dev->driver to NULL. Before b8b2c7d845d5, real_probe() would assume
    success if both dev->bus->probe and drv->probe were missing. As a result,
    a device and driver could be "bound" together just by matching their names;
    this doesn't work any more after b8b2c7d845d5.

    This may cause problems later for certain usage of platform_driver_register()
    and platform_device_register_simple(). I observed a panic while loading
    the tpm_tis driver with parameter "force=1" (i.e. registering tpm_tis as
    a platform driver), because tpm_tis_init's assumption that the device
    returned by platform_device_register_simple() was bound didn't hold any more
    (tpmm_chip_alloc() dereferences chip->pdev->driver, causing panic).

    This patch restores the previous (4.3.0 and earlier) behavior of
    platform_drv_probe() in the case when the associated platform driver has
    no "probe" function.

    Fixes: b8b2c7d845d5 ("base/platform: assert that dev_pm_domain callbacks are called unconditionally")
    Signed-off-by: Martin Wilck
    Cc: stable # 4.4
    Cc: Martin Fuzzey
    Acked-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Martin Wilck
     

26 Jan, 2016

1 commit

  • The new function platform_msi_domain_{alloc,free}_irqs are meant to be
    used in platform drivers, which can be built as modules. Therefore, it
    makes sense to export them to be used from kernel modules.

    Signed-off-by: Thomas Petazzoni
    Acked-by: Marc Zyngier
    Cc: Greg Kroah-Hartman
    Cc: Rob Herring
    Cc: Frank Rowand
    Cc: Grant Likely
    Cc: Jiang Liu
    Link: http://lkml.kernel.org/r/1453816347-32720-4-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Thomas Petazzoni
     

23 Jan, 2016

1 commit

  • parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
    inode_foo(inode) being mutex_foo(&inode->i_mutex).

    Please, use those for access to ->i_mutex; over the coming cycle
    ->i_mutex will become rwsem, with ->lookup() done with it held
    only shared.

    Signed-off-by: Al Viro

    Al Viro
     

22 Jan, 2016

2 commits

  • During genpd_poweron, genpd->lock is acquired recursively for each
    parent (master) domain, which are separate objects. This confuses
    lockdep, which considers every operation on genpd->lock as being done on
    the same lock class. This leads to the following false positive warning:

    =============================================
    [ INFO: possible recursive locking detected ]
    4.4.0-rc4-xu3s #32 Not tainted
    ---------------------------------------------
    swapper/0/1 is trying to acquire lock:
    (&genpd->lock){+.+...}, at: [] __genpd_poweron+0x64/0x108

    but task is already holding lock:
    (&genpd->lock){+.+...}, at: [] genpd_dev_pm_attach+0x168/0x1b8

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&genpd->lock);
    lock(&genpd->lock);

    *** DEADLOCK ***

    May be due to missing lock nesting notation

    3 locks held by swapper/0/1:
    #0: (&dev->mutex){......}, at: [] __driver_attach+0x48/0x98
    #1: (&dev->mutex){......}, at: [] __driver_attach+0x58/0x98
    #2: (&genpd->lock){+.+...}, at: [] genpd_dev_pm_attach+0x168/0x1b8

    stack backtrace:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.0-rc4-xu3s #32
    Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (dump_stack+0x84/0xc4)
    [] (dump_stack) from [] (__lock_acquire+0x1f88/0x215c)
    [] (__lock_acquire) from [] (lock_acquire+0xa4/0xd0)
    [] (lock_acquire) from [] (mutex_lock_nested+0x70/0x4d4)
    [] (mutex_lock_nested) from [] (__genpd_poweron+0x64/0x108)
    [] (__genpd_poweron) from [] (genpd_dev_pm_attach+0x170/0x1b8)
    [] (genpd_dev_pm_attach) from [] (platform_drv_probe+0x2c/0xac)
    [] (platform_drv_probe) from [] (driver_probe_device+0x208/0x2fc)
    [] (driver_probe_device) from [] (__driver_attach+0x94/0x98)
    [] (__driver_attach) from [] (bus_for_each_dev+0x68/0x9c)
    [] (bus_for_each_dev) from [] (bus_add_driver+0x1a0/0x218)
    [] (bus_add_driver) from [] (driver_register+0x78/0xf8)
    [] (driver_register) from [] (exynos_drm_register_drivers+0x28/0x74)
    [] (exynos_drm_register_drivers) from [] (exynos_drm_init+0x6c/0xc4)
    [] (exynos_drm_init) from [] (do_one_initcall+0x90/0x1dc)
    [] (do_one_initcall) from [] (kernel_init_freeable+0x158/0x1f8)
    [] (kernel_init_freeable) from [] (kernel_init+0x8/0xe8)
    [] (kernel_init) from [] (ret_from_fork+0x14/0x24)

    This patch replaces mutex_lock with mutex_lock_nested() and uses
    recursion depth to annotate each genpd->lock operation with separate
    lockdep subclass.

    Reported-by: Anand Moon
    Signed-off-by: Marek Szyprowski
    Tested-by: Anand Moon
    Tested-by: Tobias Jakobi
    Acked-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Marek Szyprowski
     
  • Merge third patch-bomb from Andrew Morton:
    "I'm pretty much done for -rc1 now:

    - the rest of MM, basically

    - lib/ updates

    - checkpatch, epoll, hfs, fatfs, ptrace, coredump, exit

    - cpu_mask simplifications

    - kexec, rapidio, MAINTAINERS etc, etc.

    - more dma-mapping cleanups/simplifications from hch"

    * emailed patches from Andrew Morton : (109 commits)
    MAINTAINERS: add/fix git URLs for various subsystems
    mm: memcontrol: add "sock" to cgroup2 memory.stat
    mm: memcontrol: basic memory statistics in cgroup2 memory controller
    mm: memcontrol: do not uncharge old page in page cache replacement
    Documentation: cgroup: add memory.swap.{current,max} description
    mm: free swap cache aggressively if memcg swap is full
    mm: vmscan: do not scan anon pages if memcg swap limit is hit
    swap.h: move memcg related stuff to the end of the file
    mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online
    mm: vmscan: pass memcg to get_scan_count()
    mm: memcontrol: charge swap to cgroup2
    mm: memcontrol: clean up alloc, online, offline, free functions
    mm: memcontrol: flatten struct cg_proto
    mm: memcontrol: rein in the CONFIG space madness
    net: drop tcp_memcontrol.c
    mm: memcontrol: introduce CONFIG_MEMCG_LEGACY_KMEM
    mm: memcontrol: allow to disable kmem accounting for cgroup2
    mm: memcontrol: account "kmem" consumers in cgroup2 memory controller
    mm: memcontrol: move kmem accounting code to CONFIG_MEMCG
    mm: memcontrol: separate kmem code from legacy tcp accounting code
    ...

    Linus Torvalds
     

21 Jan, 2016

5 commits

  • Pull more power management and ACPI updates from Rafael Wysocki:
    "This includes fixes on top of the previous batch of PM+ACPI updates
    and some new material as well.

    From the new material perspective the most significant are the driver
    core changes that should allow USB devices to stay suspended over
    system suspend/resume cycles if they have been runtime-suspended
    already beforehand. Apart from that, ACPICA is updated to upstream
    revision 20160108 (cosmetic mostly, but including one fixup on top of
    the previous ACPICA update) and there are some devfreq updates the
    didn't make it before (due to timing).

    A few recent regressions are fixed, most importantly in the cpuidle
    menu governor and in the ACPI backlight driver and some x86 platform
    drivers depending on it.

    Some more bugs are fixed and cleanups are made on top of that.

    Specifics:

    - Modify the driver core and the USB subsystem to allow USB devices
    to stay suspended over system suspend/resume cycles if they have
    been runtime-suspended already beforehand and fix some bugs on top
    of these changes (Tomeu Vizoso, Rafael Wysocki).

    - Update ACPICA to upstream revision 20160108, including updates of
    the ACPICA's copyright notices, a code fixup resulting from a
    regression fix that was necessary in the upstream code only (the
    regression fixed by it has never been present in Linux) and a
    compiler warning fix (Bob Moore, Lv Zheng).

    - Fix a recent regression in the cpuidle menu governor that broke it
    on practically all architectures other than x86 and make a couple
    of optimizations on top of that fix (Rafael Wysocki).

    - Clean up the selection of cpuidle governors depending on whether or
    not the kernel is configured for tickless systems (Jean Delvare).

    - Revert a recent commit that introduced a regression in the ACPI
    backlight driver, address the problem it attempted to fix in a
    different way and revert one more cosmetic change depending on the
    problematic commit (Hans de Goede).

    - Add two more ACPI backlight quirks (Hans de Goede).

    - Fix a few minor problems in the core devfreq code, clean it up a
    bit and update the MAINTAINERS information related to it (Chanwoo
    Choi, MyungJoo Ham).

    - Improve an error message in the ACPI fan driver (Andy Lutomirski).

    - Fix a recent build regression in the cpupower tool (Shreyas
    Prabhu)"

    * tag 'pm+acpi-4.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
    cpuidle: menu: Avoid pointless checks in menu_select()
    sched / idle: Drop default_idle_call() fallback from call_cpuidle()
    cpupower: Fix build error in cpufreq-info
    cpuidle: Don't enable all governors by default
    cpuidle: Default to ladder governor on ticking systems
    time: nohz: Expose tick_nohz_enabled
    ACPICA: Update version to 20160108
    ACPICA: Silence a -Wbad-function-cast warning when acpi_uintptr_t is 'uintptr_t'
    ACPICA: Additional 2016 copyright changes
    ACPICA: Reduce regression fix divergence from upstream ACPICA
    ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Satellite R830
    ACPI / video: Revert "thinkpad_acpi: Use acpi_video_handles_brightness_key_presses()"
    ACPI / video: Document acpi_video_handles_brightness_key_presses() a bit
    ACPI / video: Fix using an uninitialized mutex / list_head in acpi_video_handles_brightness_key_presses()
    ACPI / video: Revert "ACPI / video: driver must be registered before checking for keypresses"
    ACPI / fan: Improve acpi_device_update_power error message
    ACPI / video: Add disable_backlight_sysfs_if quirk for the Toshiba Portege R700
    cpuidle: menu: Fix menu_select() for CPUIDLE_DRIVER_STATE_START == 0
    MAINTAINERS: Add devfreq-event entry
    MAINTAINERS: Add missing git repository and directory for devfreq
    ...

    Linus Torvalds
     
  • This wasn't an asm-generic header to start with, and can be merged into
    dma-mapping.h trivially.

    Signed-off-by: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Aurelien Jacquiot
    Cc: Chris Metcalf
    Cc: David Howells
    Cc: Geert Uytterhoeven
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Helge Deller
    Cc: James Hogan
    Cc: Jesper Nilsson
    Cc: Koichi Yasutake
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Mikael Starvik
    Cc: Steven Miao
    Cc: Vineet Gupta
    Cc: Christian Borntraeger
    Cc: Joerg Roedel
    Cc: Sebastian Ott
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • This series converts all remaining architectures to use dma_map_ops and
    the generic implementation of the DMA API. This not only simplifies the
    code a lot, but also prepares for possible future changes like more
    generic non-iommu dma_ops implementations or generic per-device
    dma_map_ops.

    This patch (of 16):

    We have a couple architectures that do not want to support this code, so
    add another Kconfig symbol that disables the code similar to what we do
    for the nommu case.

    Signed-off-by: Christoph Hellwig
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Steven Miao
    Cc: Ley Foon Tan
    Cc: David Howells
    Cc: Koichi Yasutake
    Cc: Chris Metcalf
    Cc: "David S. Miller"
    Cc: Aurelien Jacquiot
    Cc: Geert Uytterhoeven
    Cc: Helge Deller
    Cc: James Hogan
    Cc: Jesper Nilsson
    Cc: Mark Salter
    Cc: Mikael Starvik
    Cc: Vineet Gupta
    Cc: Christian Borntraeger
    Cc: Joerg Roedel
    Cc: Sebastian Ott
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • The only user of the lvalue-ness of the cpu_*_mask variables is in
    drivers/base/cpu.c, and that is mostly a work-around for the fact that not
    even const variables can be used in static initialization. Now that the
    underlying struct cpumasks are exposed we can take their address.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Rusty Russell
    Acked-by: Greg Kroah-Hartman
    Cc: Michael Ellerman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     
  • * pm-core:
    driver core: Avoid NULL pointer dereferences in device_is_bound()
    platform: Do not detach from PM domains on shutdown
    USB / PM: Allow USB devices to remain runtime-suspended when sleeping
    PM / sleep: Go direct_complete if driver has no callbacks
    PM / Domains: add setter for dev.pm_domain
    device core: add device_is_bound()

    Rafael J. Wysocki
     

18 Jan, 2016

1 commit

  • …/git/shuah/linux-kselftest

    Pull kselftest updates from Shuah Khan:
    "This 14 patch update:

    - adds a new test for intel_pstate driver
    - adds empty string and async test cases to firmware class tests
    - fixes and cleans up several existing tests"

    * tag 'linux-kselftest-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
    selftests: firmware: add empty string and async tests
    firmware: actually return NULL on failed request_firmware_nowait()
    test: firmware_class: add asynchronous request trigger
    test: firmware_class: use kstrndup() where appropriate
    test: firmware_class: report errors properly on failure
    selftests/seccomp: fix 32-bit build warnings
    add breakpoints/.gitignore
    add ptrace/.gitignore
    update .gitignore in selftests/timers
    update .gitignore in selftests/vm
    tools, testing, add test for intel_pstate driver
    selftest/ipc: actually test it
    selftests/capabilities: actually test it
    selftests/capabilities: clean up for Makefile

    Linus Torvalds
     

16 Jan, 2016

1 commit

  • Prevent userspace from trying and failing to online ZONE_DEVICE pages
    which are meant to never be onlined.

    For example on platforms with a udev rule like the following:

    SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"

    ...will generate futile attempts to online the ZONE_DEVICE sections.
    Example kernel messages:

    Built 1 zonelists in Node order, mobility grouping on. Total pages: 1004747
    Policy zone: Normal
    online_pages [mem 0x248000000-0x24fffffff] failed

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     

15 Jan, 2016

3 commits

  • Fix a bug where a kernel warning is triggered when performing a memory
    hotplug on ppc64. This warning may also occur on any architecture that
    uses the memory_probe_store interface.

    WARNING: at drivers/base/memory.c:200
    CPU: 9 PID: 13042 Comm: systemd-udevd Not tainted 4.4.0-rc4-00113-g0bd0f1e-dirty #7
    NIP [c00000000055e034] pages_correctly_reserved+0x134/0x1b0
    LR [c00000000055e7f8] memory_subsys_online+0x68/0x140
    Call Trace:
    memory_subsys_online+0x68/0x140
    device_online+0xb4/0x120
    store_mem_state+0xb0/0x180
    dev_attr_store+0x34/0x60
    sysfs_kf_write+0x64/0xa0
    kernfs_fop_write+0x17c/0x1e0
    __vfs_write+0x40/0x160
    vfs_write+0xb8/0x200
    SyS_write+0x60/0x110
    system_call+0x38/0xd0

    The warning is triggered because there is a udev rule that automatically
    tries to online memory after it has been added. The udev rule varies
    from distro to distro, but will generally look something like:

    SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"

    On any architecture that uses memory_probe_store to reserve memory, the
    udev rule will be triggered after the first section of the block is
    reserved and will subsequently attempt to online the entire block,
    interrupting the memory reservation process and causing the warning.
    This patch modifies memory_probe_store to add a block of memory with a
    single call to add_memory as opposed to looping through and adding each
    section individually. A single call to add_memory is protected by the
    mem_hotplug mutex which will prevent the udev rule from onlining memory
    until the reservation of the entire block is complete.

    Signed-off-by: John Allen
    Acked-by: Dave Hansen
    Cc: Nathan Fontenot
    Cc: Michael Ellerman
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John Allen
     
  • The function removes a section, not a block. Rename to reflect actual
    functionality.

    Signed-off-by: Seth Jennings
    Cc: Andrew Banman
    Cc: Daniel J Blueman
    Cc: Yinghai Lu
    Cc: Greg KH
    Cc: Russ Anderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Seth Jennings
     
  • Right now, section_count is calculated in add_memory_block(). However,
    init_memory_block() increments section_count as well, which, at first,
    seems like it would lead to an off-by-one error. There is no harm done
    because add_memory_block() immediately overwrites the
    mem->section_count, but it is messy.

    This commit moves the increment out of the common init_memory_block()
    (called by both add_memory_block() and register_new_memory()) and adds
    it to register_new_memory().

    Signed-off-by: Seth Jennings
    Cc: Andrew Banman
    Cc: Daniel J Blueman
    Cc: Yinghai Lu
    Cc: Greg KH
    Cc: Russ Anderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Seth Jennings
     

13 Jan, 2016

2 commits

  • Pull oower management and ACPI updates from Rafael Wysocki:
    "As far as the number of commits goes, ACPICA takes the lead this time,
    followed by cpufreq and the device properties framework changes.

    The most significant new feature is the debugfs-based interface to the
    ACPICA's AML debugger added in the previous cycle and a new user space
    tool for accessing it.

    On the cpufreq front, the core is updated to handle governors more
    efficiently, particularly on systems where a single cpufreq policy
    object is shared between multiple CPUs, and there are quite a few
    changes in drivers (intel_pstate, cpufreq-dt etc).

    The device properties framework is updated to handle built-in (ie
    included in the kernel itself) device properties better, among other
    things by adding a fallback mechanism that will allow drivers to
    provide default properties to be used in case the plaform firmware
    doesn't provide the properties expected by them.

    The Operating Performance Points (OPP) framework gets new DT bindings
    and debugfs support.

    A new cpufreq driver for ST platforms is added and the ACPI driver for
    AMD SoCs will now support the APM X-Gene ACPI I2C device.

    The rest is mostly fixes and cleanups all over.

    Specifics:

    - Add a debugfs-based interface for interacting with the ACPICA's AML
    debugger introduced in the previous cycle and a new user space tool
    for that, fix some bugs related to the AML debugger and clean up
    the code in question (Lv Zheng, Dan Carpenter, Colin Ian King,
    Markus Elfring).

    - Update ACPICA to upstream revision 20151218 including a number of
    fixes and cleanups in the ACPICA core (Bob Moore, Lv Zheng, Labbe
    Corentin, Prarit Bhargava, Colin Ian King, David E Box, Rafael
    Wysocki).

    In particular, the previously added erroneous support for the _SUB
    object is dropped, the concatenate operator will support all ACPI
    objects now, the Debug Object handling is improved, the SuperName
    handling of parameters being control methods is fixed, the
    ObjectType operator handling is updated to follow ACPI 5.0A and the
    handling of CondRefOf and RefOf is updated accordingly, module-
    level code will be executed after loading each ACPI table now
    (instead of being run once after all tables containing AML have
    been loaded), the Operation Region handlers management is updated
    to fix some reported problems and a the ACPICA code in the kernel
    is more in line with the upstream now.

    - Update the ACPI backlight driver to provide information on whether
    or not it will generate key-presses for brightness change hotkeys
    and update some platform drivers (dell-wmi, thinkpad_acpi) to use
    that information to avoid sending double key-events to users pace
    for these, add new ACPI backlight quirks (Hans de Goede, Aaron Lu,
    Adrien Schildknecht).

    - Improve the ACPI handling of interrupt GPIOs (Christophe Ricard).

    - Fix the handling of the list of device IDs of device objects found
    in the ACPI namespace and add a helper for checking if there is a
    device object for a given device ID (Lukas Wunner).

    - Change the logic in the ACPI namespace scanning code to create
    struct acpi_device objects for all ACPI device objects found in the
    namespace even if _STA fails for them which helps to avoid device
    enumeration problems on Microsoft Surface 3 (Aaron Lu).

    - Add support for the APM X-Gene ACPI I2C device to the ACPI driver
    for AMD SoCs (Loc Ho).

    - Fix the long-standing issue with the DMA controller on Intel SoCs
    where ACPI tables have no power management support for the DMA
    controller itself, but it can be powered off automatically when the
    last (other) device on the SoC is powered off via ACPI and clean up
    the ACPI driver for Intel SoCs (acpi-lpss) after previous attempts
    to fix that problem (Andy Shevchenko).

    - Assorted ACPI fixes and cleanups (Andy Lutomirski, Colin Ian King,
    Javier Martinez Canillas, Ken Xue, Mathias Krause, Rafael Wysocki,
    Sinan Kaya).

    - Update the device properties framework for better handling of
    built-in properties, add support for built-in properties to the
    platform bus type, update the MFD subsystem's handling of device
    properties and add support for passing default configuration data
    as device properties to the intel-lpss MFD drivers, convert the
    designware I2C driver to use the unified device properties API and
    add a fallback mechanism for using default built-in properties if
    the platform firmware fails to provide the properties as expected
    by drivers (Andy Shevchenko, Mika Westerberg, Heikki Krogerus,
    Andrew Morton).

    - Add new Device Tree bindings to the Operating Performance Points
    (OPP) framework and update the exynos4412 DT binding accordingly,
    introduce debugfs support for the OPP framework (Viresh Kumar,
    Bartlomiej Zolnierkiewicz).

    - Migrate the mt8173 cpufreq driver to the new OPP bindings (Pi-Cheng
    Chen).

    - Update the cpufreq core to make the handling of governors more
    efficient, especially on systems where policy objects are shared
    between multiple CPUs (Viresh Kumar, Rafael Wysocki).

    - Fix cpufreq governor handling on configurations with
    CONFIG_HZ_PERIODIC set (Chen Yu).

    - Clean up the cpufreq core code related to the boost sysfs knob
    support and update the ACPI cpufreq driver accordingly (Rafael
    Wysocki).

    - Add a new cpufreq driver for ST platforms and corresponding Device
    Tree bindings (Lee Jones).

    - Update the intel_pstate driver to allow the P-state selection
    algorithm used by it to depend on the CPU ID of the processor it is
    running on, make it use a special P-state selection algorithm (with
    an IO wait time compensation tweak) on Atom CPUs based on the
    Airmont and Silvermont cores so as to reduce their energy
    consumption and improve intel_pstate documentation (Philippe
    Longepe, Srinivas Pandruvada).

    - Update the cpufreq-dt driver to support registering cooling devices
    that use the (P * V^2 * f) dynamic power draw formula where V is
    the voltage, f is the frequency and P is a constant coefficient
    provided by Device Tree and update the arm_big_little cpufreq
    driver to use that support (Punit Agrawal).

    - Assorted cpufreq driver (cpufreq-dt, qoriq, pcc-cpufreq,
    blackfin-cpufreq) updates (Andrzej Hajda, Hongtao Jia, Jacob
    Tanenbaum, Markus Elfring).

    - cpuidle core tweaks related to polling and measured_us calculation
    (Rik van Riel).

    - Removal of modularity from a few cpuidle drivers (clps711x, ux500,
    exynos) that cannot be built as modules in practice (Paul
    Gortmaker).

    - PM core update to prevent devices from being probed during system
    suspend/resume which is generally problematic and may lead to
    inconsistent behavior (Grygorii Strashko).

    - Assorted updates of the PM core and related code (Julia Lawall,
    Manuel Pégourié-Gonnard, Maruthi Bayyavarapu, Rafael Wysocki, Ulf
    Hansson).

    - PNP bus type updates (Christophe Le Roy, Heiner Kallweit).

    - PCI PM code cleanups (Jarkko Nikula, Julia Lawall).

    - cpupower tool updates (Jacob Tanenbaum, Thomas Renninger)"

    * tag 'pm+acpi-4.5-rc1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (177 commits)
    PM / clk: don't leave clocks enabled when driver not bound
    i2c: dw: Add APM X-Gene ACPI I2C device support
    ACPI / APD: Add APM X-Gene ACPI I2C device support
    ACPI / LPSS: change 'does not have' to 'has' in comment
    Revert "dmaengine: dw: platform: provide platform data for Intel"
    dmaengine: dw: return immediately from IRQ when DMA isn't in use
    dmaengine: dw: platform: power on device on shutdown
    ACPI / LPSS: override power state for LPSS DMA device
    PM / OPP: Use snprintf() instead of sprintf()
    Documentation: cpufreq: intel_pstate: enhance documentation
    ACPI, PCI, irq: remove redundant check for null string pointer
    ACPI / video: driver must be registered before checking for keypresses
    cpufreq-dt: fix handling regulator_get_voltage() result
    cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC
    PM / sleep: Add support for read-only sysfs attributes
    ACPI: Fix white space in a structure definition
    ACPI / SBS: fix inconsistent indenting inside if statement
    PNP: respect PNP_DRIVER_RES_DO_NOT_CHANGE when detaching
    ACPI / PNP: constify device IDs
    ACPI / PCI: Simplify acpi_penalize_isa_irq()
    ...

    Linus Torvalds
     
  • Pull component updates from Russell King:
    "Updates for the component helper merged last year.

    This update removes the old add_components method of detecting and
    looking up the components associated with a master device. Last time
    I checked during the 4.4-rc cycle, there were no users of the old
    interfaces, as has been the case for some time now. Breakage due to
    conflicting development is possible, in which case this pull will have
    to be reverted - however, these changes have been in linux-next since
    Dec 7th without any problems reported.

    Removal of that then allows us to change the way we track components
    internally, allowing us to release data that has been used for
    matching at the appropriate time, thereby allowing any resource leaks
    caused by that missing functionality to be resolved"

    * 'component' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    component: add support for releasing match data
    component: track components via array rather than list
    component: move check for unbound master into try_to_bring_up_masters()
    component: remove old add_components method

    Linus Torvalds
     

12 Jan, 2016

9 commits

  • Pull regmap updates from Mark Brown:
    "There's no real overall theme to the regmap changes for this release,
    it's a collection of individual features. The main bits are:

    - Support for 64 bit registers, mainly for MMIO use, from Xiubo Li.

    - Support for trigger type configuration for regmap-irq from Laxman
    Dewangan.

    - Use native physical I/O for MMIO register maps to avoid confusion
    with the conversions that readl() and writel() do to little endian
    on big endian systems (with some DT updates to fix some workarounds
    people were doing), code from Simon Arlott.

    - Use a binary search rather than iteraton to improve the runtime
    performance of the rbtree code from Nikesh Oswal"

    * tag 'regmap-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
    regmap: debugfs: Use seq_file for the access map
    regmap: irq: add support for configuration of trigger type
    regmap: use IS_ALIGNED instead of % to improve the performance
    regmap: cache: Move the num_reg_defaults check as early as possible
    regmap: cache: Add warning info for the cache check
    regmap: missing case statement
    regmap: shift wrapping bugs in 64 bit code
    regmap: cache: Add 64-bit mode support
    regmap: cache: To suppress the noise of checkpatch
    regmap: fix the warning about unused variable
    regmap: add 64-bit mode support
    regmap: mmio: Add regmap_mmio_get_min_stride
    regmap: mmio: remove the useless code
    regmap: Fix leftover from struct reg_default to struct reg_sequence change
    regmap: replace kmalloc with kmalloc_array
    regmap: replace kzalloc with kcalloc
    regmap: rbtree: When adding a reg do a bsearch for target node
    regmap-mmio: Use native endianness for read/write

    Linus Torvalds
     
  • Pull pin control updates from Linus Walleij:
    "This is the bulk of pin control patches for the v4.5 series.

    Notably I have a patch to driver core from Stephen Boyd in the pull
    request, this has been ACKed by Greg so it should be OK. The internal
    API needed some tweaking to allow modular Qualcomm pin controllers.

    There is a bit of development history in here but it should all add up
    nicely and has boiled in linux-next. For example I merged in v4.4-rc5
    to get rid of some nasty merge conflicts.

    Summary:

    - New drivers:
    - PXA2xx pin controller support
    - Broadcom NSP pin controller support

    - New subdrivers:
    - Samsung EXYNOS5410 support
    - Qualcomm MSM8996 support
    - Qualcomm PM8994 support
    - Qualcomm PM8994 MPP support
    - Allwinner sunxi H3 support
    - Allwinner sunxi A80 support
    - Rockchip RK3228 support

    - Rename the Cygnus pinctrl driver to "iproc" as it is more generic
    than was originally thought.

    - A bunch of Lantiq/Xway updates especially from the OpenWRT people.

    - Several refactorings for the Super-H SH PFC pin controllers.
    Adding SCIF_CLK support.

    - Several fixes to the Atlas 7 driver.

    - Various fixes all over the place"

    * tag 'pinctrl-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (91 commits)
    pinctrl: mediatek: Modify pinctrl bindings for mt2701
    Revert "pinctrl: qcom: make PMIC drivers bool"
    pinctrl: qcom: Use platform_irq_count() instead of of_irq_count()
    driver-core: platform: Add platform_irq_count()
    pinctrl: lantiq: 2 pins have the wrong mux list
    pinctrl: qcom: make PMIC drivers bool
    pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength()
    pinctrl: mediatek: convert to arch_initcall
    pinctrl: bcm2835: Fix memory leak in error path
    pinctrl: mediatek: add missing of_node_put
    pinctrl: rockchip: add missing of_node_put
    pinctrl: sh-pfc: add missing of_node_put
    pinctrl: sirf: add missing of_node_put
    pinctrl-tegra: add missing of_node_put
    pinctrl: sunxi: Add A80 special pin controller
    pinctrl: bcm/cygnys/iproc: fixup rebase issue
    pinctrl: fixup problematic flag
    MAINTAINERS: Add co-maintainer for Renesas Pin Controllers
    pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
    pinctrl: sh-pfc: r8a7795: Add SATA support
    ...

    Linus Torvalds
     
  • Pull irq updates from Thomas Gleixner:
    "The irq department provides:

    - Support for MSI to wire bridges and a first user of it

    - More ACPI support for ARM/GIC

    - A new TS-4800 interrupt controller driver

    - RCU based free of interrupt descriptors to support the upcoming
    Intel VMD technology without introducing a locking nightmare

    - The usual pile of fixes and updates to drivers and core code"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
    irqchip/omap-intc: Add support for spurious irq handling
    irqchip/zevio: Use irq_data_get_chip_type() helper
    irqchip/omap-intc: Remove duplicate setup for IRQ chip type handler
    irqchip/ts4800: Add TS-4800 interrupt controller
    irqchip/ts4800: Add documentation for TS-4800 interrupt controller
    irq/platform-MSI: Increase the maximum MSIs the MSI framework can support
    irqchip/gicv2m: Miscellaneous fixes for v2m resources and SPI ranges
    irqchip/bcm2836: Make code more readable
    irqchip/bcm2836: Tolerate IRQs while no flag is set in ISR
    irqchip/bcm2836: Add SMP support for the 2836
    irqchip/bcm2836: Fix initialization of the LOCAL_IRQ_CNT timers
    irqchip/gic-v2m: acpi: Introducing GICv2m ACPI support
    irqchip/gic-v2m: Refactor to prepare for ACPI support
    irqdomain: Introduce is_fwnode_irqchip helper
    acpi: pci: Setup MSI domain for ACPI based pci devices
    genirq/msi: Export functions to allow MSI domains in modules
    irqchip/mbigen: Implement the mbigen irq chip operation functions
    irqchip/mbigen: Create irq domain for each mbigen device
    irqchip/mgigen: Add platform device driver for mbigen device
    dt-bindings: Documents the mbigen bindings
    ...

    Linus Torvalds
     
  • If device_is_bound() is called on a device that's not been registered
    yet, it will attepmt to dereference dev->p which is NULL, so avoid
    that by checking dev->p in there against NULL.

    Fixes: 6b9cb42752da "device core: add device_is_bound()"
    Reported-and-tested-by: Guenter Roeck
    Tested-by: Tony Lindgren
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • * pm-domains:
    PM / Domains: export symbols to add/remove devices from genpd

    Rafael J. Wysocki
     
  • * pm-opp:
    PM / OPP: Use snprintf() instead of sprintf()
    PM / OPP: Set cpu_dev->id in cpumask first
    PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties
    PM / OPP: Parse 'opp--' bindings
    PM / OPP: Parse 'opp-supported-hw' binding
    PM / OPP: Add missing doc comments
    ARM: dts: exynos4412: Rename OPP nodes as opp@
    PM / OPP: Rename OPP nodes as opp@
    PM / OPP: Remove 'operating-points-names' binding
    PM / OPP: Add {opp-microvolt|opp-microamp}- binding
    PM / OPP: Add "opp-supported-hw" binding
    PM / OPP: Add debugfs support

    Rafael J. Wysocki
     
  • * pm-pci:
    PCI / PM: Fix small typo in documentation
    PCI / PM: constify pci_platform_pm_ops structure

    * pm-core:
    PM / core: fix typo in documentation
    PM / runtime: Add new helper for conditional usage count incrementation
    MAINTAINERS: Add an entry for the PM core
    PM / runtime: Re-init runtime PM states at probe error and driver unbind
    PM / sleep: prohibit devices probing during suspend/hibernation

    Rafael J. Wysocki
     
  • * acpi-soc:
    PM / clk: don't leave clocks enabled when driver not bound
    i2c: dw: Add APM X-Gene ACPI I2C device support
    ACPI / APD: Add APM X-Gene ACPI I2C device support
    ACPI / LPSS: change 'does not have' to 'has' in comment
    Revert "dmaengine: dw: platform: provide platform data for Intel"
    dmaengine: dw: return immediately from IRQ when DMA isn't in use
    dmaengine: dw: platform: power on device on shutdown
    ACPI / LPSS: override power state for LPSS DMA device
    ACPI / LPSS: power on when probe() and otherwise when remove()
    ACPI / LPSS: do delay for all LPSS devices when D3->D0
    ACPI / LPSS: allow to use specific PM domain during ->probe()
    Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()"
    device core: add BUS_NOTIFY_DRIVER_NOT_BOUND notification
    x86/platform/iosf_mbi: Remove duplicate definitions

    Conflicts:
    drivers/i2c/busses/i2c-designware-platdrv.c

    Rafael J. Wysocki
     
  • * device-properties:
    device property: avoid allocations of 0 length
    device property: the secondary fwnode needs to depend on the primary
    device property: add spaces to PROPERTY_ENTRY_STRING macro
    include/linux/property.h: fix build issues with gcc-4.4.4
    i2c: designware: Convert to use unified device property API
    mfd: intel-lpss: Pass HSUART configuration via properties
    mfd: intel-lpss: Pass SDA hold time to I2C host controller driver
    mfd: intel-lpss: Add support for passing device properties
    mfd: core: propagate device properties to sub devices drivers
    driver core: Do not overwrite secondary fwnode with NULL if it is set
    driver core: platform: Add support for built-in device properties
    device property: Take a copy of the property set
    device property: Fallback to secondary fwnode if primary misses the property
    device property: return -EINVAL when property isn't found in ACPI
    device property: improve readability of macros
    device property: helper macros for property entry creation
    device property: keep single value inplace
    device property: refactor built-in properties support
    device property: rename helper functions
    device property: always check for fwnode type

    Rafael J. Wysocki