28 May, 2016

1 commit

  • Most users of IS_ERR_VALUE() in the kernel are wrong, as they
    pass an 'int' into a function that takes an 'unsigned long'
    argument. This happens to work because the type is sign-extended
    on 64-bit architectures before it gets converted into an
    unsigned type.

    However, anything that passes an 'unsigned short' or 'unsigned int'
    argument into IS_ERR_VALUE() is guaranteed to be broken, as are
    8-bit integers and types that are wider than 'unsigned long'.

    Andrzej Hajda has already fixed a lot of the worst abusers that
    were causing actual bugs, but it would be nice to prevent any
    users that are not passing 'unsigned long' arguments.

    This patch changes all users of IS_ERR_VALUE() that I could find
    on 32-bit ARM randconfig builds and x86 allmodconfig. For the
    moment, this doesn't change the definition of IS_ERR_VALUE()
    because there are probably still architecture specific users
    elsewhere.

    Almost all the warnings I got are for files that are better off
    using 'if (err)' or 'if (err < 0)'.
    The only legitimate user I could find that we get a warning for
    is the (32-bit only) freescale fman driver, so I did not remove
    the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
    For 9pfs, I just worked around one user whose calling conventions
    are so obscure that I did not dare change the behavior.

    I was using this definition for testing:

    #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
    unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))

    which ends up making all 16-bit or wider types work correctly with
    the most plausible interpretation of what IS_ERR_VALUE() was supposed
    to return according to its users, but also causes a compile-time
    warning for any users that do not pass an 'unsigned long' argument.

    I suggested this approach earlier this year, but back then we ended
    up deciding to just fix the users that are obviously broken. After
    the initial warning that caused me to get involved in the discussion
    (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
    asked me to send the whole thing again.

    [ Updated the 9p parts as per Al Viro - Linus ]

    Signed-off-by: Arnd Bergmann
    Cc: Andrzej Hajda
    Cc: Andrew Morton
    Link: https://lkml.org/lkml/2016/1/7/363
    Link: https://lkml.org/lkml/2016/5/27/486
    Acked-by: Srinivas Kandagatla # For nvmem part
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

26 May, 2016

1 commit

  • …erry.reding/linux-pwm

    Pull pwm updates from Thierry Reding:
    "This set of changes introduces an atomic API to the PWM subsystem.
    This is influenced by the DRM atomic API that was introduced a while
    back, though it is obviously a lot simpler. The fundamental idea
    remains the same, though: drivers provide a single callback to
    implement the atomic configuration of a PWM channel.

    As a side-effect the PWM subsystem gains the ability for initial state
    retrieval, so that the logical state mirrors that of the hardware.
    Many use-cases don't care about this, but for others it is essential.

    These new features require changes in all users, which these patches
    take care of. The core is transitioned to use the atomic callback if
    available and provides a fallback mechanism for other drivers.

    Changes to transition users and drivers to the atomic API are
    postponed to v4.8"

    * tag 'pwm/for-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (30 commits)
    pwm: Add information about polarity, duty cycle and period to debugfs
    pwm: Switch to the atomic API
    pwm: Update documentation
    pwm: Add core infrastructure to allow atomic updates
    pwm: Add hardware readout infrastructure
    pwm: Move the enabled/disabled info into pwm_state
    pwm: Introduce the pwm_state concept
    pwm: Keep PWM state in sync with hardware state
    ARM: Explicitly apply PWM config extracted from pwm_args
    drm: i915: Explicitly apply PWM config extracted from pwm_args
    input: misc: pwm-beeper: Explicitly apply PWM config extracted from pwm_args
    input: misc: max8997: Explicitly apply PWM config extracted from pwm_args
    backlight: lm3630a: explicitly apply PWM config extracted from pwm_args
    backlight: lp855x: Explicitly apply PWM config extracted from pwm_args
    backlight: lp8788: Explicitly apply PWM config extracted from pwm_args
    backlight: pwm_bl: Use pwm_get_args() where appropriate
    fbdev: ssd1307fb: Use pwm_get_args() where appropriate
    regulator: pwm: Use pwm_get_args() where appropriate
    leds: pwm: Use pwm_get_args() where appropriate
    input: misc: max77693: Use pwm_get_args() where appropriate
    ...

    Linus Torvalds
     

24 May, 2016

1 commit

  • Pull drm updates from Dave Airlie:
    "Here's the main drm pull request for 4.7, it's been a busy one, and
    I've been a bit more distracted in real life this merge window. Lots
    more ARM drivers, not sure if it'll ever end. I think I've at least
    one more coming the next merge window.

    But changes are all over the place, support for AMD Polaris GPUs is in
    here, some missing GM108 support for nouveau (found in some Lenovos),
    a bunch of MST and skylake fixes.

    I've also noticed a few fixes from Arnd in my inbox, that I'll try and
    get in asap, but I didn't think they should hold this up.

    New drivers:
    - Hisilicon kirin display driver
    - Mediatek MT8173 display driver
    - ARC PGU - bitstreamer on Synopsys ARC SDP boards
    - Allwinner A13 initial RGB output driver
    - Analogix driver for DisplayPort IP found in exynos and rockchip

    DRM Core:
    - UAPI headers fixes and C++ safety
    - DRM connector reference counting
    - DisplayID mode parsing for Dell 5K monitors
    - Removal of struct_mutex from drivers
    - Connector registration cleanups
    - MST robustness fixes
    - MAINTAINERS updates
    - Lockless GEM object freeing
    - Generic fbdev deferred IO support

    panel:
    - Support for a bunch of new panels

    i915:
    - VBT refactoring
    - PLL computation cleanups
    - DSI support for BXT
    - Color manager support
    - More atomic patches
    - GEM improvements
    - GuC fw loading fixes
    - DP detection fixes
    - SKL GPU hang fixes
    - Lots of BXT fixes

    radeon/amdgpu:
    - Initial Polaris support
    - GPUVM/Scheduler/Clock/Power improvements
    - ASYNC pageflip support
    - New mesa feature support

    nouveau:
    - GM108 support
    - Power sensor support improvements
    - GR init + ucode fixes.
    - Use GPU provided topology information

    vmwgfx:
    - Add host messaging support

    gma500:
    - Some cleanups and fixes

    atmel:
    - Bridge support
    - Async atomic commit support

    fsl-dcu:
    - Timing controller for LCD support
    - Pixel clock polarity support

    rcar-du:
    - Misc fixes

    exynos:
    - Pipeline clock support
    - Exynoss4533 SoC support
    - HW trigger mode support
    - export HDMI_PHY clock
    - DECON5433 fixes
    - Use generic prime functions
    - use DMA mapping APIs

    rockchip:
    - Lots of little fixes

    vc4:
    - Render node support
    - Gamma ramp support
    - DPI output support

    msm:
    - Mostly cleanups and fixes
    - Conversion to generic struct fence

    etnaviv:
    - Fix for prime buffer handling
    - Allow hangcheck to be coalesced with other wakeups

    tegra:
    - Gamme table size fix"

    * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (1050 commits)
    drm/edid: add displayid detailed 1 timings to the modelist. (v1.1)
    drm/edid: move displayid validation to it's own function.
    drm/displayid: Iterate over all DisplayID blocks
    drm/edid: move displayid tiled block parsing into separate function.
    drm: Nuke ->vblank_disable_allowed
    drm/vmwgfx: Report vmwgfx version to vmware.log
    drm/vmwgfx: Add VMWare host messaging capability
    drm/vmwgfx: Kill some lockdep warnings
    drm/nouveau/gr/gf100-: fix race condition in fecs/gpccs ucode
    drm/nouveau/core: recognise GM108 chipsets
    drm/nouveau/gr/gm107-: fix touching non-existent ppcs in attrib cb setup
    drm/nouveau/gr/gk104-: share implementation of ppc exception init
    drm/nouveau/gr/gk104-: move rop_active_fbps init to nonctx
    drm/nouveau/bios/pll: check BIT table version before trying to parse it
    drm/nouveau/bios/pll: prevent oops when limits table can't be parsed
    drm/nouveau/volt/gk104: round up in gk104_volt_set
    drm/nouveau/fb/gm200: setup mmu debug buffer registers at init()
    drm/nouveau/fb/gk20a,gm20b: setup mmu debug buffer registers at init()
    drm/nouveau/fb/gf100-: allocate mmu debug buffers
    drm/nouveau/fb: allow chipset-specific actions for oneinit()
    ...

    Linus Torvalds
     

21 May, 2016

3 commits

  • Pull char / misc driver updates from Greg KH:
    "Here's the big char and misc driver update for 4.7-rc1.

    Lots of different tiny driver subsystems have updates here with new
    drivers and functionality. Details in the shortlog.

    All have been in linux-next with no reported issues for a while"

    * tag 'char-misc-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (125 commits)
    mcb: Delete num_cells variable which is not required
    mcb: Fixed bar number assignment for the gdd
    mcb: Replace ioremap and request_region with the devm version
    mcb: Implement bus->dev.release callback
    mcb: export bus information via sysfs
    mcb: Correctly initialize the bus's device
    mei: bus: call mei_cl_read_start under device lock
    coresight: etb10: adjust read pointer only when needed
    coresight: configuring ETF in FIFO mode when acting as link
    coresight: tmc: implementing TMC-ETF AUX space API
    coresight: moving struct cs_buffers to header file
    coresight: tmc: keep track of memory width
    coresight: tmc: make sysFS and Perf mode mutually exclusive
    coresight: tmc: dump system memory content only when needed
    coresight: tmc: adding mode of operation for link/sinks
    coresight: tmc: getting rid of multiple read access
    coresight: tmc: allocating memory when needed
    coresight: tmc: making prepare/unprepare functions generic
    coresight: tmc: splitting driver in ETB/ETF and ETR components
    coresight: tmc: cleaning up header file
    ...

    Linus Torvalds
     
  • Pull tty and serial driver updates from Greg KH:
    "Here's the large TTY and Serial driver update for 4.7-rc1.

    A few new serial drivers are added here, and Peter has fixed a bunch
    of long-standing bugs in the tty layer and serial drivers as normal.
    Full details in the shortlog.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (88 commits)
    MAINTAINERS: 8250: remove website reference
    serial: core: Fix port mutex assert if lockdep disabled
    serial: 8250_dw: fix wrong logic in dw8250_check_lcr()
    tty: vt, finish looping on duplicate
    tty: vt, return error when con_startup fails
    QE-UART: add "fsl,t1040-ucc-uart" to of_device_id
    serial: mctrl_gpio: Drop support for out1-gpios and out2-gpios
    serial: 8250dw: Add device HID for future AMD UART controller
    Fix OpenSSH pty regression on close
    serial: mctrl_gpio: add IRQ locking
    serial: 8250: Integrate Fintek into 8250_base
    serial: mps2-uart: add support for early console
    serial: mps2-uart: add MPS2 UART driver
    dt-bindings: document the MPS2 UART bindings
    serial: sirf: Use generic uart-has-rtscts DT property
    serial: sirf: Introduce helper variable struct device_node *np
    serial: mxs-auart: Use generic uart-has-rtscts DT property
    serial: imx: Use generic uart-has-rtscts DT property
    doc: DT: Add Generic Serial Device Tree Bindings
    serial: 8250: of: Make tegra_serial_handle_break() static
    ...

    Linus Torvalds
     
  • Pull fbdev updates from Tomi Valkeinen:

    - imxfb: fix lcd power up

    - small fixes and cleanups

    * tag 'fbdev-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
    fbdev: Use IS_ENABLED() instead of checking for built-in or module
    efifb: Don't show the mapping VA
    video: AMBA CLCD: Remove unncessary include in amba-clcd.c
    fbdev: ssd1307fb: Fix charge pump setting
    Documentation: fb: fix spelling mistakes
    fbdev: fbmem: implement error handling in fbmem_init()
    fbdev: sh_mipi_dsi: remove driver
    video: fbdev: imxfb: add some error handling
    video: fbdev: imxfb: fix semantic of .get_power and .set_power
    video: fbdev: omap2: Remove deprecated regulator_can_change_voltage() usage

    Linus Torvalds
     

17 May, 2016

8 commits

  • Call pwm_apply_args() just after requesting the PWM device so that the
    polarity and period are initialized according to the information
    provided in pwm_args.

    This is an intermediate state, and pwm_apply_args() should be dropped as
    soon as the atomic PWM infrastructure is in place and the driver makes
    use of it.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • Call pwm_apply_args() just after requesting the PWM device so that the
    polarity and period are initialized according to the information
    provided in pwm_args.

    This is an intermediate state, and pwm_apply_args() should be dropped as
    soon as the atomic PWM infrastructure is in place and the driver makes
    use of it.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • Call pwm_apply_args() just after requesting the PWM device so that the
    polarity and period are initialized according to the information
    provided in pwm_args.

    This is an intermediate state, and pwm_apply_args() should be dropped as
    soon as the atomic PWM infrastructure is in place and the driver makes
    use of it.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • The PWM framework has clarified the concept of reference PWM config (the
    platform dependent config retrieved from the DT or the PWM lookup table)
    and real PWM state.

    Use pwm_get_args() when the PWM user wants to retrieve this reference
    config and not the current state.

    This is part of the rework allowing the PWM framework to support
    hardware readout and expose real PWM state even when the PWM has just
    been requested (before the user calls pwm_config/enable/disable()).

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • The PWM framework has clarified the concept of reference PWM config (the
    platform dependent config retrieved from the DT or the PWM lookup table)
    and real PWM state.

    Use pwm_get_args() when the PWM user wants to retrieve this reference
    config and not the current state.

    This is part of the rework allowing the PWM framework to support
    hardware readout and expose real PWM state even when the PWM has just
    been requested (before the user calls pwm_config/enable/disable()).

    Signed-off-by: Boris Brezillon
    Signed-off-by: Thierry Reding

    Boris Brezillon
     
  • pwm->period field is not supposed to be changed by PWM users. The only
    ones authorized to change it are the PWM core and PWM drivers.

    Signed-off-by: Boris Brezillon
    Acked-by: Lee Jones
    Signed-off-by: Thierry Reding

    Boris BREZILLON
     
  • The PWM period will be set when calling pwm_config. Remove this useless
    call to pwm_set_period(), which might mess up the internal PWM state.

    Signed-off-by: Boris Brezillon
    Acked-by: Lee Jones
    Signed-off-by: Thierry Reding

    Boris BREZILLON
     
  • Pull ACPI updates from Rafael Wysocki:
    "The new features here are ACPI 6.1 support (and some previously
    missing bits of ACPI 6.0 support) in ACPICA and two new drivers, a
    driver for the ACPI Generic Event Device (GED) feature introduced by
    ACPI 6.1 and the INT3406 thermal driver for display thermal
    management. Also the value returned by the _HRV (hardware revision)
    ACPI object will be exported to user space via sysfs now.

    In addition to that, ACPI on ARM64 will not depend on EXPERT any more.

    The rest is mostly fixes and cleanups and some code reorganization.

    Specifics:

    - In-kernel ACPICA code update to the upstream release 20160422
    adding support for ACPI 6.1 along with some previously missing bits
    of ACPI 6.0 support, making a fair amount of fixes and cleanups and
    reducing divergences between the upstream ACPICA and the in-kernel
    code (Bob Moore, Lv Zheng, Al Stone, Aleksey Makarov, Will Miles)

    - ACPI Generic Event Device (GED) support and a fix for it (Sinan
    Kaya, Paul Gortmaker)

    - INT3406 thermal driver for display thermal management and ACPI
    backlight support code reorganization related to it (Aaron Lu, Arnd
    Bergmann)

    - Support for exporting the value returned by the _HRV (hardware
    revision) ACPI object via sysfs (Betty Dall)

    - Removal of the EXPERT dependency for ACPI on ARM64 (Mark Brown)

    - Rework of the handling of ACPI _OSI mechanism allowing the
    _OSI("Darwin") support to be overridden from the kernel command
    line among other things (Lv Zheng, Chen Yu)

    - Rework of the ACPI tables override mechanism to prepare it for the
    introduction of overlays support going forward (Lv Zheng, Rafael
    Wysocki)

    - Fixes related to the ECDT support and module-level execution of AML
    (Lv Zheng)

    - ACPI PCI interrupts management update to make it work better on
    ARM64 mostly (Sinan Kaya)

    - ACPI SRAT handling update to make the code process all entires in
    the table order regardless of the entry type (Lukasz Anaczkowski)

    - EFI power off support for full-hardware ACPI platforms that don't
    support ACPI S5 (Chen Yu)

    - Fixes and cleanups related to the ACPI core's sysfs interface (Dan
    Carpenter, Betty Dall)

    - acpi_dev_present() API rework to reduce possible confusion related
    to it (Lukas Wunner)

    - Removal of CLK_IS_ROOT from two ACPI drivers (Stephen Boyd)"

    * tag 'acpi-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (82 commits)
    ACPI / video: mark acpi_video_get_levels() inline
    Thermal / ACPI / video: add INT3406 thermal driver
    ACPI / GED: make evged.c explicitly non-modular
    ACPI / tables: Fix DSDT override mechanism
    ACPI / sysfs: fix error code in get_status()
    ACPICA: Update version to 20160422
    ACPICA: Move all ASCII utilities to a common file
    ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write()
    ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support in acpi_hw_read()
    ACPICA: Executer: Introduce a set of macros to handle bit width mask generation
    ACPICA: Hardware: Add optimized access bit width support
    ACPICA: Utilities: Add ACPI_IS_ALIGNED() macro
    ACPICA: Renamed some #defined flag constants for clarity
    ACPICA: ACPI 6.0, tools/iasl: Add support for new resource descriptors
    ACPICA: ACPI 6.0: Update _BIX support for new package element
    ACPICA: ACPI 6.1: Support for new PCCT subtable
    ACPICA: Refactor evaluate_object to reduce nesting
    ACPICA: Divergence: remove unwanted spaces for typedef
    ACPI,PCI,IRQ: remove SCI penalize function
    ACPI,PCI,IRQ: remove redundant code in acpi_irq_penalty_init()
    ..

    Linus Torvalds
     

13 May, 2016

2 commits


10 May, 2016

6 commits


09 May, 2016

2 commits


05 May, 2016

2 commits


02 May, 2016

1 commit

  • Export fb_deferred_io_mmap so drivers can change vma->vm_page_prot.
    When the framebuffer memory is allocated using dma_alloc_writecombine()
    instead of vmalloc(), I get cache syncing problems on ARM.
    This solves it:

    static int drm_fbdev_cma_deferred_io_mmap(struct fb_info *info,
    struct vm_area_struct *vma)
    {
    fb_deferred_io_mmap(info, vma);
    vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);

    return 0;
    }

    Could this have been done in the core?
    Drivers that don't set (struct fb_ops *)->fb_mmap, gets a call to
    fb_pgprotect() at the end of the default fb_mmap implementation
    (drivers/video/fbdev/core/fbmem.c). This is an architecture specific
    function that on many platforms uses pgprot_writecombine(), but not on
    all. And looking at some of the fb_mmap implementations, some of them
    sets vm_page_prot to nocache for instance, so I think the safest bet is
    to do this in the driver and not in the fbdev core. And we can't call
    fb_pgprotect() from fb_deferred_io_mmap() either because we don't have
    access to the file pointer that powerpc needs.

    Signed-off-by: Noralf Trønnes
    Acked-by: Tomi Valkeinen
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1461856717-6476-5-git-send-email-noralf@tronnes.org

    Noralf Trønnes
     

01 May, 2016

2 commits


29 Apr, 2016

1 commit

  • regulator_can_change_voltage() is deprecated and it's use is not necessary
    as commit:
    6a0028b3dd67b regulator: Deprecate regulator_can_change_voltage()
    describers it clearly.
    As there is no practical use of it it can be removed.
    At this point the regulator_set_voltage() calls can not be removed as the
    DT data need to be fixed first.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Tomi Valkeinen

    Peter Ujfalusi
     

28 Apr, 2016

3 commits

  • Allows the efifb driver to be built for ARM and arm64. This simply involves
    updating the Kconfig dependency expression, and supplying dummy versions of
    efifb_setup_from_dmi().

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Cc: Borislav Petkov
    Cc: David Herrmann
    Cc: Mark Rutland
    Cc: Peter Jones
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-25-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • Since efifb can only be built directly into the kernel, drop the module
    specific includes and definitions. Drop some other includes we don't need
    as well.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Acked-by: Peter Jones
    Cc: Borislav Petkov
    Cc: David Herrmann
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-20-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     
  • The efifb quirks handling based on DMI identification of the platform is
    specific to x86, so move it to x86 arch code.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Matt Fleming
    Acked-by: David Herrmann
    Acked-by: Peter Jones
    Cc: Borislav Petkov
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/1461614832-17633-19-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Ard Biesheuvel
     

18 Apr, 2016

2 commits

  • The change fixes a check of gpio_to_desc() return value, the function
    returns either a valid pointer to struct gpio_desc or NULL, this makes
    IS_ERR() check invalid and may lead to a NULL pointer dereference in
    runtime.

    Signed-off-by: Vladimir Zapolskiy
    Signed-off-by: Tomi Valkeinen

    Vladimir Zapolskiy
     
  • The current compile-time check for inversed IENB/CNTL does not
    work in multiplatform boots: as soon as versatile is included
    in the build, the IENB/CNTL is switched and breaks graphics.
    Convert this to a runtime switch.

    Cc: stable@vger.kernel.org
    Cc: Rob Herring
    Cc: Russell King
    Fixes: a29da136de34 ("ARM: versatile: convert to multi-platform")
    Signed-off-by: Linus Walleij
    Signed-off-by: Tomi Valkeinen

    Linus Walleij
     

05 Apr, 2016

1 commit

  • PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
    ago with promise that one day it will be possible to implement page
    cache with bigger chunks than PAGE_SIZE.

    This promise never materialized. And unlikely will.

    We have many places where PAGE_CACHE_SIZE assumed to be equal to
    PAGE_SIZE. And it's constant source of confusion on whether
    PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
    especially on the border between fs and mm.

    Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
    breakage to be doable.

    Let's stop pretending that pages in page cache are special. They are
    not.

    The changes are pretty straight-forward:

    - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

    - page_cache_get() -> get_page();

    - page_cache_release() -> put_page();

    This patch contains automated changes generated with coccinelle using
    script below. For some reason, coccinelle doesn't patch header files.
    I've called spatch for them manually.

    The only adjustment after coccinelle is revert of changes to
    PAGE_CAHCE_ALIGN definition: we are going to drop it later.

    There are few places in the code where coccinelle didn't reach. I'll
    fix them manually in a separate patch. Comments and documentation also
    will be addressed with the separate patch.

    virtual patch

    @@
    expression E;
    @@
    - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    expression E;
    @@
    - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    @@
    - PAGE_CACHE_SHIFT
    + PAGE_SHIFT

    @@
    @@
    - PAGE_CACHE_SIZE
    + PAGE_SIZE

    @@
    @@
    - PAGE_CACHE_MASK
    + PAGE_MASK

    @@
    expression E;
    @@
    - PAGE_CACHE_ALIGN(E)
    + PAGE_ALIGN(E)

    @@
    expression E;
    @@
    - page_cache_get(E)
    + get_page(E)

    @@
    expression E;
    @@
    - page_cache_release(E)
    + put_page(E)

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

23 Mar, 2016

1 commit

  • Pull clk updates from Stephen Boyd:
    "The clk changes for this release cycle are mostly dominated by new
    device support in terms of LoC, but there has been some cleanup in the
    core as well as the usual minor clk additions to various drivers.

    Core:
    - parent tracking has been simplified
    - CLK_IS_ROOT is now a no-op flag, cleaning up drivers has started
    - of_clk_init() doesn't consider disabled DT nodes anymore
    - clk_unregister() had an error path bug squashed
    - of_clk_get_parent_count() has been fixed to only return unsigned ints
    - HAVE_MACH_CLKDEV is removed now that the last arch user (ARM) is gone

    New Drivers:
    - NXP LPC18xx creg
    - QCOM IPQ4019 GCC
    - TI dm814x ADPLL
    - i.MX6QP

    Updates:
    - Cyngus audio clks found on Broadcom iProc devices
    - Non-critical fixes for BCM2385 PLLs
    - Samsung exynos5433 updates for clk id errors, HDMI support,
    suspend/resume simplifications
    - USB, CAN, LVDS, and FCP clks on shmobile devices
    - sunxi got support for more clks on new SoCs and went through a
    minor refactoring/rewrite to use a simpler factor clk construct
    - rockchip added some more clk ids and added suport for fraction
    dividers
    - QCOM GDSCs in msm8996
    - A new devm helper to make adding custom actions simpler (acked by Greg)"

    * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (197 commits)
    clk: bcm2835: fix check of error code returned by devm_ioremap_resource()
    clk: renesas: div6: use RENESAS for #define
    clk: renesas: Rename header file renesas.h
    clk: max77{686,802}: Remove CLK_IS_ROOT
    clk: versatile: Remove CLK_IS_ROOT
    clk: sunxi: Remove use of variable length array
    clk: fixed-rate: Remove CLK_IS_ROOT
    clk: qcom: Remove CLK_IS_ROOT
    doc: dt: add documentation for lpc1850-creg-clk driver
    clk: add lpc18xx creg clk driver
    clk: lpc32xx: fix compilation warning
    clk: xgene: Add missing parenthesis when clearing divider value
    clk: mb86s7x: Remove CLK_IS_ROOT
    clk: x86: Remove clkdev.h and clk.h includes
    clk: x86: Remove CLK_IS_ROOT
    clk: mvebu: Remove CLK_IS_ROOT
    clk: renesas: move drivers to renesas directory
    clk: si5{14,351,70}: Remove CLK_IS_ROOT
    clk: scpi: Remove CLK_IS_ROOT
    clk: s2mps11: Remove CLK_IS_ROOT
    ...

    Linus Torvalds
     

22 Mar, 2016

1 commit

  • Pull drm updates from Dave Airlie:
    "This is the main drm pull request for 4.6 kernel.

    Overall the coolest thing here for me is the nouveau maxwell signed
    firmware support from NVidia, it's taken a long while to extract this
    from them.

    I also wish the ARM vendors just designed one set of display IP, ARM
    display block proliferation is definitely increasing.

    Core:
    - drm_event cleanups
    - Internal API cleanup making mode_fixup optional.
    - Apple GMUX vga switcheroo support.
    - DP AUX testing interface

    Panel:
    - Refactoring of DSI core for use over more transports.

    New driver:
    - ARM hdlcd driver

    i915:
    - FBC/PSR (framebuffer compression, panel self refresh) enabled by default.
    - Ongoing atomic display support work
    - Ongoing runtime PM work
    - Pixel clock limit checks
    - VBT DSI description support
    - GEM fixes
    - GuC firmware scheduler enhancements

    amdkfd:
    - Deferred probing fixes to avoid make file or link ordering.

    amdgpu/radeon:
    - ACP support for i2s audio support.
    - Command Submission/GPU scheduler/GPUVM optimisations
    - Initial GPU reset support for amdgpu

    vmwgfx:
    - Support for DX10 gen mipmaps
    - Pageflipping and other fixes.

    exynos:
    - Exynos5420 SoC support for FIMD
    - Exynos5422 SoC support for MIPI-DSI

    nouveau:
    - GM20x secure boot support - adds acceleration for Maxwell GPUs.
    - GM200 support
    - GM20B clock driver support
    - Power sensors work

    etnaviv:
    - Correctness fixes for GPU cache flushing
    - Better support for i.MX6 systems.

    imx-drm:
    - VBlank IRQ support
    - Fence support
    - OF endpoint support

    msm:
    - HDMI support for 8996 (snapdragon 820)
    - Adreno 430 support
    - Timestamp queries support

    virtio-gpu:
    - Fixes for Android support.

    rockchip:
    - Add support for Innosilicion HDMI

    rcar-du:
    - Support for 4 crtcs
    - R8A7795 support
    - RCar Gen 3 support

    omapdrm:
    - HDMI interlace output support
    - dma-buf import support
    - Refactoring to remove a lot of legacy code.

    tilcdc:
    - Rewrite of pageflipping code
    - dma-buf support
    - pinctrl support

    vc4:
    - HDMI modesetting bug fixes
    - Significant 3D performance improvement.

    fsl-dcu (FreeScale):
    - Lots of fixes

    tegra:
    - Two small fixes

    sti:
    - Atomic support for planes
    - Improved HDMI support"

    * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (1063 commits)
    drm/amdgpu: release_pages requires linux/pagemap.h
    drm/sti: restore mode_fixup callback
    drm/amdgpu/gfx7: add MTYPE definition
    drm/amdgpu: removing BO_VAs shouldn't be interruptible
    drm/amd/powerplay: show uvd/vce power gate enablement for tonga.
    drm/amd/powerplay: show uvd/vce power gate info for fiji
    drm/amdgpu: use sched fence if possible
    drm/amdgpu: move ib.fence to job.fence
    drm/amdgpu: give a fence param to ib_free
    drm/amdgpu: include the right version of gmc header files for iceland
    drm/radeon: fix indentation.
    drm/amd/powerplay: add uvd/vce dpm enabling flag to fix the performance issue for CZ
    drm/amdgpu: switch back to 32bit hw fences v2
    drm/amdgpu: remove amdgpu_fence_is_signaled
    drm/amdgpu: drop the extra fence range check v2
    drm/amdgpu: signal fences directly in amdgpu_fence_process
    drm/amdgpu: cleanup amdgpu_fence_wait_empty v2
    drm/amdgpu: keep all fences in an RCU protected array v2
    drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ring
    drm/amdgpu: RCU protected amd_sched_fence_release
    ...

    Linus Torvalds
     

21 Mar, 2016

1 commit

  • Pull x86 protection key support from Ingo Molnar:
    "This tree adds support for a new memory protection hardware feature
    that is available in upcoming Intel CPUs: 'protection keys' (pkeys).

    There's a background article at LWN.net:

    https://lwn.net/Articles/643797/

    The gist is that protection keys allow the encoding of
    user-controllable permission masks in the pte. So instead of having a
    fixed protection mask in the pte (which needs a system call to change
    and works on a per page basis), the user can map a (handful of)
    protection mask variants and can change the masks runtime relatively
    cheaply, without having to change every single page in the affected
    virtual memory range.

    This allows the dynamic switching of the protection bits of large
    amounts of virtual memory, via user-space instructions. It also
    allows more precise control of MMU permission bits: for example the
    executable bit is separate from the read bit (see more about that
    below).

    This tree adds the MM infrastructure and low level x86 glue needed for
    that, plus it adds a high level API to make use of protection keys -
    if a user-space application calls:

    mmap(..., PROT_EXEC);

    or

    mprotect(ptr, sz, PROT_EXEC);

    (note PROT_EXEC-only, without PROT_READ/WRITE), the kernel will notice
    this special case, and will set a special protection key on this
    memory range. It also sets the appropriate bits in the Protection
    Keys User Rights (PKRU) register so that the memory becomes unreadable
    and unwritable.

    So using protection keys the kernel is able to implement 'true'
    PROT_EXEC on x86 CPUs: without protection keys PROT_EXEC implies
    PROT_READ as well. Unreadable executable mappings have security
    advantages: they cannot be read via information leaks to figure out
    ASLR details, nor can they be scanned for ROP gadgets - and they
    cannot be used by exploits for data purposes either.

    We know about no user-space code that relies on pure PROT_EXEC
    mappings today, but binary loaders could start making use of this new
    feature to map binaries and libraries in a more secure fashion.

    There is other pending pkeys work that offers more high level system
    call APIs to manage protection keys - but those are not part of this
    pull request.

    Right now there's a Kconfig that controls this feature
    (CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) that is default enabled
    (like most x86 CPU feature enablement code that has no runtime
    overhead), but it's not user-configurable at the moment. If there's
    any serious problem with this then we can make it configurable and/or
    flip the default"

    * 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (38 commits)
    x86/mm/pkeys: Fix mismerge of protection keys CPUID bits
    mm/pkeys: Fix siginfo ABI breakage caused by new u64 field
    x86/mm/pkeys: Fix access_error() denial of writes to write-only VMA
    mm/core, x86/mm/pkeys: Add execute-only protection keys support
    x86/mm/pkeys: Create an x86 arch_calc_vm_prot_bits() for VMA flags
    x86/mm/pkeys: Allow kernel to modify user pkey rights register
    x86/fpu: Allow setting of XSAVE state
    x86/mm: Factor out LDT init from context init
    mm/core, x86/mm/pkeys: Add arch_validate_pkey()
    mm/core, arch, powerpc: Pass a protection key in to calc_vm_flag_bits()
    x86/mm/pkeys: Actually enable Memory Protection Keys in the CPU
    x86/mm/pkeys: Add Kconfig prompt to existing config option
    x86/mm/pkeys: Dump pkey from VMA in /proc/pid/smaps
    x86/mm/pkeys: Dump PKRU with other kernel registers
    mm/core, x86/mm/pkeys: Differentiate instruction fetches
    x86/mm/pkeys: Optimize fault handling in access_error()
    mm/core: Do not enforce PKEY permissions on remote mm access
    um, pkeys: Add UML arch_*_access_permitted() methods
    mm/gup, x86/mm/pkeys: Check VMAs and PTEs for protection keys
    x86/mm/gup: Simplify get_user_pages() PTE bit handling
    ...

    Linus Torvalds
     

18 Mar, 2016

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for kernel v4.6. There is quite a
    lot of interesting stuff going on.

    The patches to other subsystems and arch-wide are ACKed as far as
    possible, though I consider things like per-arch as
    essentially a part of the GPIO subsystem so it should not be needed.

    Core changes:

    - The gpio_chip is now a *real device*. Until now the gpio chips
    were just piggybacking the parent device or (gasp) floating in
    space outside of the device model.

    We now finally make GPIO chips devices. The gpio_chip will create
    a gpio_device which contains a struct device, and this gpio_device
    struct is kept private. Anything that needs to be kept private
    from the rest of the kernel will gradually be moved over to the
    gpio_device.

    - As a result of making the gpio_device a real device, we have added
    resource management, so devm_gpiochip_add_data() will cut down on
    overhead and reduce code lines. A huge slew of patches convert
    almost all drivers in the subsystem to use this.

    - Building on making the GPIO a real device, we add the first step of
    a new userspace ABI: the GPIO character device. We take small
    steps here, so we first add a pure *information* ABI and the tool
    "lsgpio" that will list all GPIO devices on the system and all
    lines on these devices.

    We can now discover GPIOs properly from userspace. We still have
    not come up with a way to actually *use* GPIOs from userspace.

    - To encourage people to use the character device for the future, we
    have it always-enabled when using GPIO. The old sysfs ABI is still
    opt-in (and can be used in parallel), but is marked as deprecated.

    We will keep it around for the foreseeable future, but it will not
    be extended to cover ever more use cases.

    Cleanup:

    - Bjorn Helgaas removed a whole slew of per-architecture
    includes.

    This dates back to when GPIO was an opt-in feature and no shared
    library even existed: just a header file with proper prototypes was
    provided and all semantics were up to the arch to implement. These
    patches make the GPIO chip even more a proper device and cleans out
    leftovers of the old in-kernel API here and there.

    Still some cruft is left but it's very little now.

    - There is still some clamping of return values for .get() going on,
    but we now return sane values in the vast majority of drivers and
    the errorpath is sanitized. Some patches for powerpc, blackfin and
    unicore still drop in.

    - We continue to switch the ARM, MIPS, blackfin, m68k local GPIO
    implementations to use gpiochip_add_data() and cut down on code
    lines.

    - MPC8xxx is converted to use the generic GPIO helpers.

    - ATH79 is converted to use the generic GPIO helpers.

    New drivers:

    - WinSystems WS16C48

    - Acces 104-DIO-48E

    - F81866 (a F7188x variant)

    - Qoric (a MPC8xxx variant)

    - TS-4800

    - SPI serializers (pisosr): simple 74xx shift registers connected to
    SPI to obtain a dirt-cheap output-only GPIO expander.

    - Texas Instruments TPIC2810

    - Texas Instruments TPS65218

    - Texas Instruments TPS65912

    - X-Gene (ARM64) standby GPIO controller"

    * tag 'gpio-v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (194 commits)
    Revert "Share upstreaming patches"
    gpio: mcp23s08: Fix clearing of interrupt.
    gpiolib: Fix comment referring to gpio_*() in gpiod_*()
    gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit
    gpio: xgene: Fix kconfig for standby GIPO contoller
    gpio: Add generic serializer DT binding
    gpio: uapi: use 0xB4 as ioctl() major
    gpio: tps65912: fix bad merge
    Revert "gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free"
    gpio: omap: drop dev field from gpio_bank structure
    gpio: mpc8xxx: Slightly update the code for better readability
    gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip
    gpio: mpc8xxx: Fixup setting gpio direction output
    gpio: mcp23s08: Add support for mcp23s18
    dt-bindings: gpio: altera: Fix altr,interrupt-type property
    gpio: add driver for MEN 16Z127 GPIO controller
    gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free
    gpio: timberdale: Switch to devm_ioremap_resource()
    gpio: ts4800: Add IMX51 dependency
    gpiolib: rewrite gpiodev_add_to_list
    ...

    Linus Torvalds