18 Apr, 2012

22 commits

  • These functions allow the driver core to automatically clean up any
    allocations made by drivers, thus leading to simplified drivers.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • When we compile pinctrl layer for platforms without CONFIG_PINCONF, we get
    following compilation errors:

    drivers/built-in.o: In function `pinctrl_show':
    linux-2.6/drivers/pinctrl/core.c:1116: undefined
    reference to `pinconf_show_setting'
    drivers/built-in.o: In function `pinctrl_maps_show':
    linux-2.6/drivers/pinctrl/core.c:1071: undefined
    reference to `pinconf_show_map'
    drivers/built-in.o: In function `pinctrl_init_device_debugfs':
    linux-2.6/drivers/pinctrl/core.c:1224: undefined
    reference to `pinconf_init_device_debugfs'
    make[1]: *** [.tmp_vmlinux1] Error 1

    This patch fixes this.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Linus Walleij

    Viresh Kumar
     
  • Add a pinconf op so that pin controller drivers can decode their pin
    config settings for debugfs.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Only provide prototypes for pin{mux,conf}.c debugfs-related functions
    when both CONFIG_PIN* /and/ CONFIG_DEBUG_FS are enabled, otherwise
    provide static inlines.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • With the finalization of the external driver API and the device
    tree support, this subsystem is now mature and can be promoted to
    non-experimental status.

    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Implement pinctrl_ops dt_node_to_map() and dt_free_map(). These allow
    complete specification of the desired pinmux configuration using device
    tree.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Define a new binding for the Tegra pin controller, which is capable of
    defining all aspects of desired pin multiplexing and pin configuration.
    This is all based on the new common pinctrl bindings.

    Add Tegra30 binding based on Tegra20 binding.

    Add some basic stuff that was missing before:
    * How many and what reg property entries must be provided.
    * An example.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This places the file in the new location for all pin controller bindings.

    Also, rename the file using the full compatible value for easier
    avoidance of conflicts between multiple bindings.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • The core pin controller bindings define:
    * The fact that pin controllers expose pin configurations as nodes in
    device tree.
    * That the bindings for those pin configuration nodes is defined by the
    individual pin controller drivers.
    * A standardized set of properties for client devices to define numbered
    or named pin configuration states, each referring to some number of the
    afore-mentioned pin configuration nodes.
    * That the bindings for the client devices determines the set of numbered
    or named states that must exist.

    Signed-off-by: Stephen Warren
    Acked-by: Shawn Guo
    Acked-by: Tony Lindgren
    Acked-by: Linus Walleij
    Acked-by: Simon Glass
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This patch adds macros of_property_for_each_u32() and
    of_property_for_each_string(), which iterate over an array of values
    within a device-tree property. Usage is for example:

    struct property *prop;
    const __be32 *p;
    u32 u;
    of_property_for_each_u32(np, "propname", prop, p, u)
    printk("U32 value: %x\n", u);

    struct property *prop;
    const char *s;
    of_property_for_each_string(np, "propname", prop, s)
    printk("String value: %s\n", s);

    Based on work by Rob Herring

    Cc: Grant Likely
    Signed-off-by: Stephen Warren
    Acked-by: Rob Herring
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • If drivers try to obtain pinctrl handles for a pin controller that
    has not yet registered to the subsystem, we need to be able to
    back out and retry with deferred probing. So let's return
    -EPROBE_DEFER whenever this location fails. Also downgrade the
    errors to info, maybe we will even set them to debug once the
    deferred probing is commonplace.

    Cc: Arnd Bergmann
    Reviewed-by: Mark Brown
    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This patch can avoid kernel oops in case the mux or config
    function is not supported by driver.

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • Do not use get_functions_count before checking.

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • Most of the SoC drivers implement list_groups() and list_functions()
    routines for pinctrl and pinmux. These routines continue returning
    zero until the selector argument is greater than total count of
    available groups or functions.

    This patch replaces these list_*() routines with get_*_count()
    routines, which returns the number of available selection for SoC
    driver. pinctrl layer will use this value to check the range it can
    choose.

    This patch fixes all user drivers for this change. There are other
    routines in user drivers, which have checks to check validity of
    selector passed to them. It is also no more required and hence
    removed.

    Documentation updated as well.

    Acked-by: Stephen Warren
    Signed-off-by: Viresh Kumar
    [Folded in fix and fixed a minor merge artifact manually]
    Signed-off-by: Linus Walleij

    Viresh Kumar
     
  • As long as there is no other non-const variable marked __initdata in the
    same compilation unit it doesn't hurt. If there were one however
    compilation would fail with

    error: $variablename causes a section type conflict

    because a section containing const variables is marked read only and so
    cannot contain non-const variables.

    Signed-off-by: Uwe Kleine-König
    Cc: Randy Dunlap
    Signed-off-by: Linus Walleij

    Uwe Kleine-König
     
  • Missed one group from the documentation when proofreading.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Linus Walleij

    Viresh Kumar
     
  • pinctrl/devicetree.c won't compile when !CONFIG_PINCTRL, since the
    pinctrl headers don't declare some types when !PINCTRL. Make sure
    pinctrl/Makefile only attempts to compile devicetree.c when OF &&
    PINCTRL.

    Acked-by: Dong Aisheng
    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • During pinctrl_get(), if the client device has a device tree node, look
    for the common pinctrl properties there. If found, parse the referenced
    device tree nodes, with the help of the pinctrl drivers, and generate
    mapping table entries from them.

    During pinctrl_put(), free any results of device tree parsing.

    Acked-by: Dong Aisheng
    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Most code assumes that the pinctrl ops are present. Validate this when
    registering a pinctrl driver. Remove the one place in the code that
    was checking whether one of these non-optional ops was present.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Macros in call ARRAY_SIZE(), the definition of
    which eventually calls BUILD_BUG_ON_ZERO(), which is defined in
    . Include that so that every .c file using the pinctrl macros
    doesn't have to do that itself.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • The pinctrl_register_mappings is defined in core.c, so change the dependent
    macro from CONFIG_MUX to CONFIG_PINCTRL.

    The compile error message is:
    drivers/pinctrl/core.c:886: error: redefinition of 'pinctrl_register_mappings'
    include/linux/pinctrl/machine.h:160: note: previous definition of 'pinctrl_register_mappings' was here
    make[2]: *** [drivers/pinctrl/core.o] Error 1
    make[1]: *** [drivers/pinctrl] Error 2
    make: *** [drivers] Error 2

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     

16 Apr, 2012

11 commits

  • Linus Torvalds
     
  • Pull ARM fixes from Russell King:
    "Nothing too disasterous, the biggest thing being the removal of the
    regulator support for vcore in the AMBA driver; only one SoC was using
    this and it got broken during the last merge window, which then
    started causing problems for other people. Mutual agreement was
    reached for it to be removed."

    * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
    ARM: 7386/1: jump_label: fixup for rename to static_key
    ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE
    ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic MMU
    ARM: 7359/2: smp_twd: Only wait for reprogramming on active cpus
    ARM: 7383/1: nommu: populate vectors page from paging_init
    ARM: 7381/1: nommu: fix typo in mm/Kconfig
    ARM: 7380/1: DT: do not add a zero-sized memory property
    ARM: 7379/1: DT: fix atags_to_fdt() second call site
    ARM: 7366/3: amba: Remove AMBA level regulator support
    ARM: 7377/1: vic: re-read status register before dispatching each IRQ handler
    ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets incremented

    Linus Torvalds
     
  • The 'max' range needs to be unsigned, since the size of the user address
    space is bigger than 2GB.

    We know that 'count' is positive in 'long' (that is checked in the
    caller), so we will truncate 'max' down to something that fits in a
    signed long, but before we actually do that, that comparison needs to be
    done in unsigned.

    Bug introduced in commit 92ae03f2ef99 ("x86: merge 32/64-bit versions of
    'strncpy_from_user()' and speed it up"). On x86-64 you can't trigger
    this, since the user address space is much smaller than 63 bits, and on
    x86-32 it works in practice, since you would seldom hit the strncpy
    limits anyway.

    I had actually tested the corner-cases, I had only tested them on
    x86-64. Besides, I had only worried about the case of a pointer *close*
    to the end of the address space, rather than really far away from it ;)

    This also changes the "we hit the user-specified maximum" to return
    'res', for the trivial reason that gcc seems to generate better code
    that way. 'res' and 'count' are the same in that case, so it really
    doesn't matter which one we return.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • c5905afb0 ("static keys: Introduce 'struct static_key'...") renamed
    struct jump_label_key to struct static_key. Fixup ARM for this to
    eliminate these build warnings:

    include/linux/jump_label.h:113:2:
    warning: passing argument 1 of 'arch_static_branch' from incompatible pointer type
    include/asm/jump_label.h:17:82:
    note: expected 'struct jump_label_key *' but argument is of type 'struct static_key *'

    Signed-off-by: Rabin Vincent
    Signed-off-by: Russell King

    Rabin Vincent
     
  • Currently when ThumbEE is not enabled (!CONFIG_ARM_THUMBEE) the ThumbEE
    register states are not saved/restored at context switch. The default state
    of the ThumbEE Ctrl register (TEECR) allows userspace accesses to the
    ThumbEE Base Handler register (TEEHBR). This can cause unexpected behaviour
    when people use ThumbEE on !CONFIG_ARM_THUMBEE kernels, as well as allowing
    covert communication - eg between userspace tasks running inside chroot
    jails.

    This patch sets up TEECR in order to prevent user-space access to TEEHBR
    when !CONFIG_ARM_THUMBEE. In this case, tasks are sent SIGILL if they try to
    access TEEHBR.

    Cc: stable@vger.kernel.org
    Reviewed-by: Will Deacon
    Signed-off-by: Jonathan Austin
    Signed-off-by: Russell King

    Jonathan Austin
     
  • If a bank of memory spanning the 4GB boundary is added on a !CONFIG_LPAE
    kernel then we will hang early during boot since the memory bank will
    have wrapped around to zero.

    This patch truncates memory banks for !LPAE configurations when the end
    address is not representable in 32 bits.

    Acked-by: Nicolas Pitre
    Signed-off-by: Will Deacon
    Signed-off-by: Russell King

    Will Deacon
     
  • During booting of cpu1, there is a short window where cpu1
    is online, but not active where cpu1 is occupied by waiting
    to become active. If cpu0 then decides to schedule something
    on cpu1 and wait for it to complete, before cpu0 has set
    cpu1 active, we have a deadlock.

    Typically it's this CPU frequency transition that happens at
    this time, so let's just not wait for it to happen, it will
    happen whenever the CPU eventually comes online instead.

    Cc: Peter Zijlstra
    Cc: stable@kernel.org
    Signed-off-by: Jonas Aaberg
    Reviewed-by: Rickard Andersson
    Signed-off-by: Linus Walleij
    Signed-off-by: Russell King

    Linus Walleij
     
  • Commit 26f41062f28d ("PCI: check for pci bar restore completion and
    retry") attempted to address problems with PCI BAR restoration on
    systems where FLR had not been completed before pci_restore_state() was
    called, but it did that in an utterly wrong way.

    First off, instead of retrying the writes for the BAR registers only, it
    did that for all of the PCI config space of the device, including the
    status register (whose value after the write quite obviously need not be
    the same as the written one). Second, it added arbitrary delay to
    pci_restore_state() even for systems where the PCI config space
    restoration was successful at first attempt. Finally, the mdelay(10) it
    added to every iteration of the writing loop was way too much of a delay
    for any reasonable device.

    All of this actually caused resume failures for some devices on Mikko's
    system.

    To fix the regression, make pci_restore_state() only retry the writes
    for BAR registers and only wait if the first read from the register
    doesn't return the written value. Additionaly, make it wait for 1 ms,
    instead of 10 ms, after every failing attempt to write into config
    space.

    Reported-by: Mikko Vinni
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Pull "ARM: a few more SoC fixes for 3.4-rc" from Olof Johansson:
    - A handful of warning and build fixes for Qualcomm MSM
    - Build/warning and bug fixes for Samsung Exynos
    - A fix from Rob Herring that removes misplaced interrupt-parent
    properties from a few device trees
    - A fix to OMAP dealing with cpufreq build errors, removing some of the
    offending code since it was redundant anyway

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: OMAP: clock: cleanup CPUfreq leftovers, fix build errors
    ARM: dts: remove blank interrupt-parent properties
    ARM: EXYNOS: Fix Kconfig dependencies for device tree enabled machine files
    ARM: EXYNOS: Remove broken config values for touchscren for NURI board
    ARM: EXYNOS: set fix xusbxti clock for NURI and Universal210 boards
    ARM: EXYNOS: fix regulator name for NURI board
    ARM: SAMSUNG: make SAMSUNG_PM_DEBUG select DEBUG_LL
    ARM: msm: Fix section mismatches in proc_comm.c
    video: msm: Fix section mismatches in mddi.c
    arm: msm: trout: fix compile failure
    arm: msm: halibut: remove unneeded fixup
    ARM: EXYNOS: Add PDMA and MDMA physical base address defines
    ARM: S5PV210: Fix compiler warning in dma.c file
    ARM: EXYNOS: Fix compile error in exynos5250-cpufreq.c
    ARM: EXYNOS: Add missing definition for IRQ_I2S0
    ARM: S5PV210: fix unused LDO supply field from wm8994_pdata

    Linus Torvalds
     
  • Pull another round of sound fixes from Takashi Iwai:
    "A few regression fixes for Realtek HD-audio codecs, mainly specific to
    some laptop models."

    * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda/realtek - Fix mem leak (and rid us of trailing whitespace).
    ALSA: hda/realtek - Add quirk for Mac Pro 5,1 machines
    ALSA: hda/realtek - Add a fixup entry for Acer Aspire 8940G
    ALSA: hda/realtek - Fix GPIO1 setup for Acer Aspire 4930 & co
    ALSA: hda/realtek - Add a few ALC882 model strings back

    Linus Torvalds
     
  • Commit 18a4d0a22ed6 ("[SCSI] Handle disk devices which can not process
    medium access commands") introduced a bug in which we would attempt to
    dereference the scsi driver even when the device had no ULD attached.

    Ensure that a driver is registered and make the driver accessor function
    more resilient to errors during device discovery.

    Reported-by: Elric Fu
    Reported-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Linus Torvalds

    Martin K. Petersen
     

15 Apr, 2012

4 commits

  • …/git/kgene/linux-samsung into fixes

    * 'v3.4-samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
    ARM: EXYNOS: Fix Kconfig dependencies for device tree enabled machine files
    ARM: EXYNOS: Remove broken config values for touchscren for NURI board
    ARM: EXYNOS: set fix xusbxti clock for NURI and Universal210 boards
    ARM: EXYNOS: fix regulator name for NURI board
    ARM: SAMSUNG: make SAMSUNG_PM_DEBUG select DEBUG_LL
    ARM: EXYNOS: Add PDMA and MDMA physical base address defines
    ARM: S5PV210: Fix compiler warning in dma.c file
    ARM: EXYNOS: Fix compile error in exynos5250-cpufreq.c
    ARM: EXYNOS: Add missing definition for IRQ_I2S0
    ARM: S5PV210: fix unused LDO supply field from wm8994_pdata

    Olof Johansson
     
  • Now that we have OPP layer, and OMAP CPUfreq driver is using it, we no
    longer need/use the clock framework code for filling up CPUfreq
    tables. Remove it.

    Removing this code also eliminates build errors when CPU_FREQ_TABLE
    support is not enabled.

    Thanks to Russell King for pointing out the parts I missed under
    plat-omap in the original version and also pointing out the build
    errors when CPUFREQ_TABLE support was not enabled.

    Cc: Russell King
    Signed-off-by: Kevin Hilman
    Acked-by: Paul Walmsley
    Acked-by: Tony Lindgren
    Signed-off-by: Olof Johansson

    Kevin Hilman
     
  • These were incorrectly introduced and can cause problems for of_irq_init.

    The correct way to define a root controller is no interrupt-parent set at
    all or the interrupt-parent is set to the root controller itself when
    inherited from a parent node.

    Signed-off-by: Rob Herring
    Tested-by: Lee Jones
    Signed-off-by: Olof Johansson

    Rob Herring
     
  • From David Brown:
    "Here are some fixes for msm that fix problems caused by the latest
    ARM code. The ones from Daniel remove unneeded fixups that now
    cause compilation failures. Mine fix section mismatches, that were
    incompletely fixed earlier."

    * 'msm-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm:
    ARM: msm: Fix section mismatches in proc_comm.c
    video: msm: Fix section mismatches in mddi.c
    arm: msm: trout: fix compile failure
    arm: msm: halibut: remove unneeded fixup

    Olof Johansson
     

14 Apr, 2012

3 commits