18 Dec, 2019

1 commit

  • commit 04fb02757ae5188031eb71b2f6f189edb1caf5dc upstream.

    As explained in the following commit a9a1a4833613 ("pinctrl:
    armada-37xx: Fix gpio interrupt setup") the armada_37xx_irq_set_type()
    function can be called before the initialization of the mask field.

    That means that we can't use this field in this function and need to
    workaround it using hwirq.

    Fixes: 30ac0d3b0702 ("pinctrl: armada-37xx: Add edge both type gpio irq support")
    Cc: stable@vger.kernel.org
    Reported-by: Russell King
    Signed-off-by: Gregory CLEMENT
    Link: https://lore.kernel.org/r/20191115155752.2562-1-gregory.clement@bootlin.com
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Gregory CLEMENT
     

09 Oct, 2019

1 commit

  • The configuration registers for the LED group have inverted
    polarity, which puts the GPIO into open-drain state when used in
    GPIO mode. Switch to '0' for GPIO and '1' for LED modes.

    Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx")
    Signed-off-by: Patrick Williams
    Cc:
    Link: https://lore.kernel.org/r/20191001155154.99710-1-alpawi@amazon.com
    Signed-off-by: Linus Walleij

    Patrick Williams
     

05 Oct, 2019

1 commit

  • The 37xx configuration registers are only 32 bits long, so
    pins 32-35 spill over into the next register. The calculation
    for the register address was done, but the bitmask was not, so
    any configuration to pin 32 or above resulted in a bitmask that
    overflowed and performed no action.

    Fix the register / offset calculation to also adjust the offset.

    Fixes: 5715092a458c ("pinctrl: armada-37xx: Add gpio support")
    Signed-off-by: Patrick Williams
    Acked-by: Gregory CLEMENT
    Cc:
    Link: https://lore.kernel.org/r/20191001154634.96165-1-alpawi@amazon.com
    Signed-off-by: Linus Walleij

    Patrick Williams
     

27 Aug, 2019

2 commits

  • With CP115 standalone modules, all MPP configuration are
    possible. Handle this new possibility thanks to the new
    "marvell,cp115-standalone-pinctrl" compatible property.

    Signed-off-by: Grzegorz Jaszczyk
    [: mention the new compatible in the
    commit log]
    Signed-off-by: Miquel Raynal
    Link: https://lore.kernel.org/r/20190805101607.29811-4-miquel.raynal@bootlin.com
    Signed-off-by: Linus Walleij

    Grzegorz Jaszczyk
     
  • Add missing definition for function 0xe on CP-110 MPP-62.
    The pin function is Data Strobe for SDIO interface.

    Signed-off-by: Konstantin Porotchkin
    Signed-off-by: Miquel Raynal
    Link: https://lore.kernel.org/r/20190805101607.29811-2-miquel.raynal@bootlin.com
    Signed-off-by: Linus Walleij

    Konstantin Porotchkin
     

14 Jul, 2019

1 commit

  • Pull pin control updates from Linus Walleij:
    "This is the bulk of pin control changes for the v5.3 kernel cycle:

    Core changes:

    - Device links can optionally be added between a pin control producer
    and its consumers. This will affect how the system power management
    is handled: a pin controller will not suspend before all of its
    consumers have been suspended.

    This was necessary for the ST Microelectronics STMFX expander and
    need to be tested on other systems as well: it makes sense to make
    this default in the long run.

    Right now it is opt-in per driver.

    - Drive strength can be specified in microamps. With decreases in
    silicon technology, milliamps isn't granular enough, let's make it
    possible to select drive strengths in microamps.

    Right now the Meson (AMlogic) driver needs this.

    New drivers:

    - New subdriver for the Tegra 194 SoC.

    - New subdriver for the Qualcomm SDM845.

    - New subdriver for the Qualcomm SM8150.

    - New subdriver for the Freescale i.MX8MN (Freescale is now a product
    line of NXP).

    - New subdriver for Marvell MV98DX1135.

    Driver improvements:

    - The Bitmain BM1880 driver now supports pin config in addition to
    muxing.

    - The Qualcomm drivers can now reserve some GPIOs as taken aside and
    not usable for users. This is used in ACPI systems to take out some
    GPIO lines used by the BIOS so that noone else (neither kernel nor
    userspace) will play with them by mistake and crash the machine.

    - A slew of refurbishing around the Aspeed drivers (board management
    controllers for servers) in preparation for the new Aspeed AST2600
    SoC.

    - A slew of improvements over the SH PFC drivers as usual.

    - Misc cleanups and fixes"

    * tag 'pinctrl-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (106 commits)
    pinctrl: aspeed: Strip moved macros and structs from private header
    pinctrl: aspeed: Fix missed include
    pinctrl: baytrail: Use GENMASK() consistently
    pinctrl: baytrail: Re-use data structures from pinctrl-intel.h
    pinctrl: baytrail: Use defined macro instead of magic in byt_get_gpio_mux()
    pinctrl: qcom: Add SM8150 pinctrl driver
    dt-bindings: pinctrl: qcom: Add SM8150 pinctrl binding
    dt-bindings: pinctrl: qcom: Document missing gpio nodes
    pinctrl: aspeed: Add implementation-related documentation
    pinctrl: aspeed: Split out pinmux from general pinctrl
    pinctrl: aspeed: Clarify comment about strapping W1C
    pinctrl: aspeed: Correct comment that is no longer true
    MAINTAINERS: Add entry for ASPEED pinctrl drivers
    dt-bindings: pinctrl: aspeed: Convert AST2500 bindings to json-schema
    dt-bindings: pinctrl: aspeed: Convert AST2400 bindings to json-schema
    dt-bindings: pinctrl: aspeed: Split bindings document in two
    pinctrl: qcom: Add irq_enable callback for msm gpio
    pinctrl: madera: Fixup SPDX headers
    pinctrl: qcom: sdm845: Fix CONFIG preprocessor guard
    pinctrl: tegra: Add bitmask support for parked bits
    ...

    Linus Torvalds
     

25 Jun, 2019

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


21 Jan, 2019

1 commit

  • Armada 3700 PCIe IP relies on the pinctrl IP managed by this
    driver. For reasons related to the PCI core's organization when
    suspending/resuming, PCI host controller drivers must reconfigure
    their register at suspend_noirq()/resume_noirq() which happens after
    suspend()/suspend_late() and before resume_early()/resume().

    In the current state, after resuming from a suspend to RAM cycle the
    PCIe IP is reconfigured before the pinctrl one which produces an
    interrupt storm. The solution to support PCIe resume operation is to
    change the "priority" of this pinctrl driver PM callbacks to
    "_noirq()".

    Signed-off-by: Miquel Raynal
    Acked-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Miquel Raynal
     

11 Jan, 2019

2 commits

  • Declare the PCIe1 Wakeup which was initially missing.

    Signed-off-by: Gregory CLEMENT
    Tested-by: Miquel Raynal
    Signed-off-by: Linus Walleij

    Gregory CLEMENT
     
  • This is a cleanup and fix of the patch by Ken Ma .

    Fix the mpp definitions according to newest revision of the
    specification:
    - northbridge:
    fix pmic1 gpio number to 7
    fix pmic0 gpio number to 6
    - southbridge
    split pcie1 group bit mask to BIT(5) and BIT(9)
    fix ptp group bit mask to BIT(11) | BIT(12) | BIT(13)
    add smi group with bit mask BIT(4)

    [gregory: split the pcie group in 2, as at hardware level they can be
    configured separately]
    Signed-off-by: Marek Behún
    Signed-off-by: Gregory CLEMENT
    Tested-by: Miquel Raynal
    Signed-off-by: Linus Walleij

    Marek Behún
     

14 Sep, 2018

1 commit

  • These drivers are GPIO drivers, and the do not need to use the
    legacy header in , go directly for
    instead.

    Replace any use of GPIOF_* with 0/1, these flags are for
    consumers, not drivers.

    Get rid of a few gpio_to_irq() users that was littering
    around the place, use local callbacks or avoid using it at
    all.

    Signed-off-by: Linus Walleij

    Linus Walleij
     

29 Aug, 2018

1 commit

  • In preparation to remove the node name pointer from struct device_node,
    convert printf users to use the %pOFn format specifier.

    Cc: Linus Walleij
    Cc: Dong Aisheng
    Cc: Fabio Estevam
    Cc: Shawn Guo
    Cc: Stefan Agner
    Cc: Pengutronix Kernel Team
    Cc: Sean Wang
    Cc: Matthias Brugger
    Cc: Carlo Caione
    Cc: Kevin Hilman
    Cc: Jason Cooper
    Cc: Andrew Lunn
    Cc: Gregory Clement
    Cc: Sebastian Hesselbarth
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Nicolas Ferre
    Cc: Alexandre Belloni
    Cc: Heiko Stuebner
    Cc: Tony Lindgren
    Cc: Haojian Zhuang
    Cc: Patrice Chotard
    Cc: Barry Song
    Cc: Maxime Coquelin
    Cc: Alexandre Torgue
    Cc: Maxime Ripard
    Cc: Chen-Yu Tsai
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-mediatek@lists.infradead.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-amlogic@lists.infradead.org
    Cc: linux-rockchip@lists.infradead.org
    Cc: linux-omap@vger.kernel.org
    Acked-by: Dong Aisheng
    Reviewed-by: Alexandre Belloni
    Acked-by: Tony Lindgren
    Acked-by: Sean Wang
    Acked-by: Chen-Yu Tsai
    Acked-by: Heiko Stuebner
    Signed-off-by: Rob Herring
    Signed-off-by: Linus Walleij

    Rob Herring
     

29 Jun, 2018

1 commit

  • Add suspend/resume hooks in pinctrl driver to handle S2RAM operations.

    Beyond the traditional register save/restore operations, these hooks
    also keep the GPIOs used for both-edge IRQ synchronized between their
    level (low/high) and expected IRQ polarity (falling/rising edge).

    Since pinctrl is an infrastructure module, its resume should be issued
    prior to other IO drivers. The pinctrl PM operations are requested at
    early/late stages for this reason.

    Suggested-by: Ken Ma
    Signed-off-by: Miquel Raynal
    Reviewed-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Miquel Raynal
     

13 Jun, 2018

2 commits

  • The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
    This patch replaces cases of:

    devm_kzalloc(handle, a * b, gfp)

    with:
    devm_kcalloc(handle, a * b, gfp)

    as well as handling cases of:

    devm_kzalloc(handle, a * b * c, gfp)

    with:

    devm_kzalloc(handle, array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    devm_kcalloc(handle, array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    devm_kzalloc(handle, 4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    Some manual whitespace fixes were needed in this patch, as Coccinelle
    really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    expression HANDLE;
    type TYPE;
    expression THING, E;
    @@

    (
    devm_kzalloc(HANDLE,
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression HANDLE;
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    expression HANDLE;
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    expression HANDLE;
    identifier SIZE, COUNT;
    @@

    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression HANDLE;
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression HANDLE;
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    expression HANDLE;
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression HANDLE;
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression HANDLE;
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
    |
    devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2, ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     
  • The devm_kmalloc() function has a 2-factor argument form,
    devm_kmalloc_array(). This patch replaces cases of:

    devm_kmalloc(handle, a * b, gfp)

    with:
    devm_kmalloc_array(handle, a * b, gfp)

    as well as handling cases of:

    devm_kmalloc(handle, a * b * c, gfp)

    with:

    devm_kmalloc(handle, array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    devm_kmalloc_array(handle, array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    devm_kmalloc(handle, 4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    Some manual whitespace fixes were needed in this patch, as Coccinelle
    really liked to write "=devm_kmalloc..." instead of "= devm_kmalloc...".

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    expression HANDLE;
    type TYPE;
    expression THING, E;
    @@

    (
    devm_kmalloc(HANDLE,
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    devm_kmalloc(HANDLE,
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression HANDLE;
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    devm_kmalloc(HANDLE,
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    expression HANDLE;
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    expression HANDLE;
    identifier SIZE, COUNT;
    @@

    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression HANDLE;
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    devm_kmalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression HANDLE;
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    devm_kmalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    devm_kmalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    expression HANDLE;
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    devm_kmalloc(HANDLE,
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression HANDLE;
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    devm_kmalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kmalloc(HANDLE,
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kmalloc(HANDLE,
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression HANDLE;
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    devm_kmalloc(HANDLE, sizeof(THING) * C2, ...)
    |
    devm_kmalloc(HANDLE, sizeof(TYPE) * C2, ...)
    |
    devm_kmalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kmalloc(HANDLE, C1 * C2, ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - devm_kmalloc
    + devm_kmalloc_array
    (HANDLE,
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

24 May, 2018

1 commit

  • Until now, if we found spurious irq in irq_handler, we only updated the
    status in register but not the status in the code. Due to this the system
    will got stuck dues to the infinite loop

    [gregory.clement@bootlin.com: update comment and add fix and stable tags]
    Fixes: 30ac0d3b0702 ("pinctrl: armada-37xx: Add edge both type gpio irq support")
    Cc:
    Signed-off-by: Terry Zhou
    Reviewed-by: Gregory CLEMENT
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Terry Zhou
     

23 May, 2018

1 commit

  • The Armada 98dx3236 SoCs don't have a different MPP sel value for nand
    specific pins so "dev" was technically correct. But all the other Armada
    SoCs use "nand" in their dts and the pin is specific to the nand
    interface so use "nand" for the function name.

    Signed-off-by: Chris Packham
    Acked-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Chris Packham
     

16 May, 2018

2 commits


03 Feb, 2018

1 commit

  • Pull pin control updates from Linus Walleij:
    "This is the bulk of pin control changes for the v4.16 kernel cycle.
    Like with GPIO it is actually a bit calm this time.

    Core changes:

    - After lengthy discussions and partly due to my ignorance, we have
    merged a patch making pinctrl_force_default() and
    pinctrl_force_sleep() reprogram the states into the hardware of any
    hogged pins, even if they are already in the desired state.

    This only apply to hogged pins since groups of pins owned by
    drivers need to be managed by each driver, lest they could not do
    things like runtime PM and put pins to sleeping state even if the
    system as a whole is not in sleep.

    New drivers:

    - New driver for the Microsemi Ocelot SoC. This is used in ethernet
    switches.

    - The X-Powers AXP209 GPIO driver was extended to also deal with pin
    control and moved over from the GPIO subsystem. This circuit is a
    mixed-mode integrated circuit which is part of AllWinner designs.

    - New subdriver for the Qualcomm MSM8998 SoC, core of a high end
    mobile devices (phones) chipset.

    - New subdriver for the ST Microelectronics STM32MP157 MPU and
    STM32F769 MCU from the STM32 family.

    - New subdriver for the MediaTek MT7622 SoC. This is used for
    routers, repeater, gateways and such network infrastructure.

    - New subdriver for the NXP (former Freescale) i.MX 6ULL. This SoC
    has multimedia features and target "smart devices", I guess in-car
    entertainment, in-flight entertainment, industrial control panels
    etc.

    General improvements:

    - Incremental improvements on the SH-PFC subdrivers for things like
    the CAN bus.

    - Enable the glitch filter on Baytrail GPIOs used for interrupts.

    - Proper handling of pins to GPIO ranges on the Semtec SX150X

    - An IRQ setup ordering fix on MCP23S08.

    - A good set of janitorial coding style fixes"

    * tag 'pinctrl-v4.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (102 commits)
    pinctrl: mcp23s08: fix irq setup order
    pinctrl: Forward declare struct device
    pinctrl: sunxi: Use of_clk_get_parent_count() instead of open coding
    pinctrl: stm32: add STM32F769 MCU support
    pinctrl: sx150x: Add a static gpio/pinctrl pin range mapping
    pinctrl: sx150x: Register pinctrl before adding the gpiochip
    pinctrl: sx150x: Unregister the pinctrl on release
    pinctrl: ingenic: Remove redundant dev_err call in ingenic_pinctrl_probe()
    pinctrl: sprd: Use seq_putc() in sprd_pinconf_group_dbg_show()
    pinctrl: pinmux: Use seq_putc() in pinmux_pins_show()
    pinctrl: abx500: Use seq_putc() in abx500_gpio_dbg_show()
    pinctrl: mediatek: mt7622: align error handling of mtk_hw_get_value call
    pinctrl: mediatek: mt7622: fix potential uninitialized value being returned
    pinctrl: uniphier: refactor drive strength get/set functions
    pinctrl: imx7ulp: constify struct imx_cfg_params_decode
    pinctrl: imx: constify struct imx_pinctrl_soc_info
    pinctrl: imx7d: simplify imx7d_pinctrl_probe
    pinctrl: imx: use struct imx_pinctrl_soc_info as a const
    pinctrl: sunxi-pinctrl: fix pin funtion can not be match correctly.
    pinctrl: qcom: Add msm8998 pinctrl driver
    ...

    Linus Torvalds
     

08 Jan, 2018

1 commit


20 Dec, 2017

1 commit


29 Nov, 2017

1 commit

  • The direction_output callback of the gpio_chip structure is supposed to
    set the output direction but also to set the value of the gpio. For the
    armada-37xx driver this callback acted as the gpio_set_direction callback
    for the pinctrl.

    This patch fixes the behavior of the direction_output callback by also
    applying the value received as parameter.

    Cc: stable@vger.kernel.org
    Fixes: 5715092a458c ("pinctrl: armada-37xx: Add gpio support")
    Reported-by: Alexandre Belloni
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Gregory CLEMENT
     

17 Nov, 2017

1 commit

  • Pull pin control updates from Linus Walleij:
    "This is the bulk of pin control changes for the v4.15 kernel cycle:

    Core:

    - The pin control Kconfig entry PINCTRL is now turned into a
    menuconfig option. This obviously has the implication of making the
    subsystem menu visible in menuconfig. This is happening because of
    two things:

    (a) Intel have started to deploy and depend on pin controllers in
    a way that is affecting users directly. This happens on the
    highly integrated laptop chipsets named after geographical
    places: baytrail, broxton, cannonlake, cedarfork, cherryview,
    denverton, geminilake, lewisburg, merrifield, sunrisepoint...
    It started a while back and now it is ever more evident that
    this is crucial infrastructure for x86 laptops and not an
    embedded obscurity anymore. Users need to be aware.

    (b) Pin control expanders on I2C and SPI that are arch-agnostic.
    Currently Semtech SX150X and Microchip MCP28x08 but more are
    expected. Users will have to be able to configure these in
    directly for their set-up.

    - Just go and select GPIOLIB now that we made sure that GPIOLIB is a
    very vanilla subsystem. Do not depend on it, if we need it, select
    it.

    - Exposing the pin control subsystem in menuconfig uncovered a bunch
    of obscure bugs that are now hopefully fixed, all more or less
    pertaining to Blackfin.

    - Unified namespace for cross-calls between pin control and GPIO.

    - New support for clock skew/delay generic DT bindings and generic
    pin config options for this.

    - Minor documentation improvements.

    Various:

    - The Renesas SH-PFC pin controller has evolved a lot. It seems
    Renesas are churning out new SoCs by the minute.

    - A bunch of non-critical fixes for the Rockchip driver.

    - Improve the use of library functions instead of open coding.

    - Support the MCP28018 variant in the MCP28x08 driver.

    - Static constifying"

    * tag 'pinctrl-v4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (91 commits)
    pinctrl: gemini: Fix missing pad descriptions
    pinctrl: Add some depends on HAS_IOMEM
    pinctrl: samsung/s3c24xx: add CONFIG_OF dependency
    pinctrl: gemini: Fix GMAC groups
    pinctrl: qcom: spmi-gpio: Add pmi8994 gpio support
    pinctrl: ti-iodelay: remove redundant unused variable dev
    pinctrl: max77620: Use common error handling code in max77620_pinconf_set()
    pinctrl: gemini: Implement clock skew/delay config
    pinctrl: gemini: Use generic DT parser
    pinctrl: Add skew-delay pin config and bindings
    pinctrl: armada-37xx: Add edge both type gpio irq support
    pinctrl: uniphier: remove eMMC hardware reset pin-mux
    pinctrl: rockchip: Add iomux-route switching support for rk3288
    pinctrl: intel: Add Intel Cedar Fork PCH pin controller support
    pinctrl: intel: Make offset to interrupt status register configurable
    pinctrl: sunxi: Enforce the strict mode by default
    pinctrl: sunxi: Disable strict mode for old pinctrl drivers
    pinctrl: sunxi: Introduce the strict flag
    pinctrl: sh-pfc: Save/restore registers for PSCI system suspend
    pinctrl: sh-pfc: r8a7796: Use generic IOCTRL register description
    ...

    Linus Torvalds
     

15 Nov, 2017

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v4.15 kernel cycle:

    Core:

    - Fix the semantics of raw GPIO to actually be raw. No inversion
    semantics as before, but also no open draining, and allow the raw
    operations to affect lines used for interrupts as the caller
    supposedly knows what they are doing if they are getting the big
    hammer.

    - Rewrote the __inner_function() notation calls to names that make
    more sense. I just find this kind of code disturbing.

    - Drop the .irq_base() field from the gpiochip since now all IRQs are
    mapped dynamically. This is nice.

    - Support for .get_multiple() in the core driver API. This allows us
    to read several GPIO lines with a single register read. This has
    high value for some usecases: it can be used to create
    oscilloscopes and signal analyzers and other things that rely on
    reading several lines at exactly the same instant. Also a generally
    nice optimization. This uses the new assign_bit() macro from the
    bitops lib that was ACKed by Andrew Morton and is implemented for
    two drivers, one of them being the generic MMIO driver so everyone
    using that will be able to benefit from this.

    - Do not allow requests of Open Drain and Open Source setting of a
    GPIO line simultaneously. If the hardware actually supports
    enabling both at the same time the electrical result would be
    disastrous.

    - A new interrupt chip core helper. This will be helpful to deal with
    "banked" GPIOs, which means GPIO controllers with several logical
    blocks of GPIO inside them. This is several gpiochips per device in
    the device model, in contrast to the case when there is a 1-to-1
    relationship between a device and a gpiochip.

    New drivers:

    - Maxim MAX3191x industrial serializer, a very interesting piece of
    professional I/O hardware.

    - Uniphier GPIO driver. This is the GPIO block from the recent
    Socionext (ex Fujitsu and Panasonic) platform.

    - Tegra 186 driver. This is based on the new banked GPIO
    infrastructure.

    Other improvements:

    - Some documentation improvements.

    - Wakeup support for the DesignWare DWAPB GPIO controller.

    - Reset line support on the DesignWare DWAPB GPIO controller.

    - Several non-critical bug fixes and improvements for the Broadcom
    BRCMSTB driver.

    - Misc non-critical bug fixes like exotic errorpaths, removal of dead
    code etc.

    - Explicit comments on fall-through switch() statements"

    * tag 'gpio-v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (65 commits)
    gpio: tegra186: Remove tegra186_gpio_lock_class
    gpio: rcar: Add r8a77995 (R-Car D3) support
    pinctrl: bcm2835: Fix some merge fallout
    gpio: Fix undefined lock_dep_class
    gpio: Automatically add lockdep keys
    gpio: Introduce struct gpio_irq_chip.first
    gpio: Disambiguate struct gpio_irq_chip.nested
    gpio: Add Tegra186 support
    gpio: Export gpiochip_irq_{map,unmap}()
    gpio: Implement tighter IRQ chip integration
    gpio: Move lock_key into struct gpio_irq_chip
    gpio: Move irq_valid_mask into struct gpio_irq_chip
    gpio: Move irq_nested into struct gpio_irq_chip
    gpio: Move irq_chained_parent to struct gpio_irq_chip
    gpio: Move irq_default_type to struct gpio_irq_chip
    gpio: Move irq_handler to struct gpio_irq_chip
    gpio: Move irqdomain into struct gpio_irq_chip
    gpio: Move irqchip into struct gpio_irq_chip
    gpio: Introduce struct gpio_irq_chip
    pinctrl: armada-37xx: remove unused variable
    ...

    Linus Torvalds
     

09 Nov, 2017

1 commit


08 Nov, 2017

1 commit


04 Nov, 2017

1 commit

  • A cleanup left behind a temporary variable that is now unused:

    drivers/pinctrl/mvebu/pinctrl-armada-37xx.c: In function 'armada_37xx_irq_startup':
    drivers/pinctrl/mvebu/pinctrl-armada-37xx.c:693:20: error: unused variable 'chip' [-Werror=unused-variable]

    This removes the declarations as well.

    Fixes: 3ee9e605caea ("pinctrl: armada-37xx: Stop using struct gpio_chip.irq_base")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Walleij

    Arnd Bergmann
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

31 Oct, 2017

1 commit


20 Oct, 2017

1 commit

  • The Armada 37xx driver always initializes the IRQ base to 0, hence the
    subtraction is a no-op. Remove the subtraction and thereby the last user
    of struct gpio_chip's .irq_base field.

    Note that this was also actually a bug and only worked because of the
    above assumption. If the IRQ base had been dynamically allocated, the
    subtraction would've caused the wrong mask to be generated since the
    struct irq_data.hwirq field is an index local to the IRQ domain. As a
    result, it should now be safe to also allocate this chip's IRQ base
    dynamically, unless there are consumers left that refer to the IRQs by
    their global number.

    Signed-off-by: Thierry Reding
    Acked-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Thierry Reding
     

12 Sep, 2017

1 commit

  • Since commit dc749a09ea5e ("gpiolib: allow gpio irqchip to map irqs
    dynamically"), the irqs for gpio are not statically allocated during in
    gpiochip_irqchip_add.

    This driver was based on this assumption for initializing the mask
    associated to each interrupt this led to a NULL pointer crash in the
    kernel:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    Mem abort info:
    Exception class = DABT (current EL), IL = 32 bits
    SET = 0, FnV = 0
    EA = 0, S1PTW = 0
    Data abort info:
    ISV = 0, ISS = 0x00000068
    CM = 0, WnR = 1
    [0000000000000000] user address but active_mm is swapper
    Internal error: Oops: 96000044 [#1] PREEMPT SMP
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-06657-g3b9f8ed25dbe #576
    Hardware name: Marvell Armada 3720 Development Board DB-88F3720-DDR3 (DT)
    task: ffff80001d908000 task.stack: ffff000008068000
    PC is at armada_37xx_pinctrl_probe+0x5f8/0x670
    LR is at armada_37xx_pinctrl_probe+0x5e8/0x670
    pc : [] lr : [] pstate: 60000045
    sp : ffff00000806bb80
    x29: ffff00000806bb80 x28: 0000000000000024
    x27: 000000000000000c x26: 0000000000000001
    x25: ffff80001efee760 x24: 0000000000000000
    x23: ffff80001db6f570 x22: ffff80001db6f438
    x21: 0000000000000000 x20: ffff80001d9f4810
    x19: ffff80001db6f418 x18: 0000000000000000
    x17: 0000000000000001 x16: 0000000000000019
    x15: ffffffffffffffff x14: 0140000000000000
    x13: 0000000000000000 x12: 0000000000000030
    x11: 0101010101010101 x10: 0000000000000040
    x9 : ffff000009923580 x8 : ffff80001d400248
    x7 : ffff80001d400270 x6 : 0000000000000000
    x5 : ffff80001d400248 x4 : ffff80001d400270
    x3 : 0000000000000000 x2 : 0000000000000001
    x1 : 0000000000000001 x0 : 0000000000000000
    Process swapper/0 (pid: 1, stack limit = 0xffff000008068000)
    Call trace:
    Exception stack(0xffff00000806ba40 to 0xffff00000806bb80)
    ba40: 0000000000000000 0000000000000001 0000000000000001 0000000000000000
    ba60: ffff80001d400270 ffff80001d400248 0000000000000000 ffff80001d400270
    ba80: ffff80001d400248 ffff000009923580 0000000000000040 0101010101010101
    baa0: 0000000000000030 0000000000000000 0140000000000000 ffffffffffffffff
    bac0: 0000000000000019 0000000000000001 0000000000000000 ffff80001db6f418
    bae0: ffff80001d9f4810 0000000000000000 ffff80001db6f438 ffff80001db6f570
    bb00: 0000000000000000 ffff80001efee760 0000000000000001 000000000000000c
    bb20: 0000000000000024 ffff00000806bb80 ffff000008e25ccc ffff00000806bb80
    bb40: ffff000008e25cdc 0000000060000045 ffff00000806bb60 ffff0000081189b8
    bb60: ffffffffffffffff ffff00000811cf1c ffff00000806bb80 ffff000008e25cdc
    [] armada_37xx_pinctrl_probe+0x5f8/0x670
    [] platform_drv_probe+0x58/0xb8
    [] driver_probe_device+0x22c/0x2d8
    [] __driver_attach+0xbc/0xc0
    [] bus_for_each_dev+0x4c/0x98
    [] driver_attach+0x20/0x28
    [] bus_add_driver+0x1b8/0x228
    [] driver_register+0x60/0xf8
    [] __platform_driver_probe+0x74/0x130
    [] armada_37xx_pinctrl_driver_init+0x20/0x28
    [] do_one_initcall+0x38/0x128
    [] kernel_init_freeable+0x188/0x22c
    [] kernel_init+0x10/0x100
    [] ret_from_fork+0x10/0x18
    Code: f9403fa2 12001341 1100075a 9ac12041 (b9000001)
    ---[ end trace 8b0f4e05e1603208 ]---

    This patch moves the initialization of the mask field in the irq_startup
    function. However some callbacks such as irq_set_type and irq_set_wake
    could be called before irq_startup. For those functions the mask is
    computed at each call which is not a issue as these functions are not
    located in a hot path but are used sporadically for configuration.

    Fixes: dc749a09ea5e ("gpiolib: allow gpio irqchip to map irqs
    dynamically")
    Cc:
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Gregory CLEMENT
     

22 Aug, 2017

1 commit


14 Aug, 2017

1 commit


07 Aug, 2017

2 commits

  • On the south bridge we have pin from to 29, so it gives 30 pins (and not
    29).

    Without this patch the kernel complain with the following traces:
    cat /sys/kernel/debug/pinctrl/d0018800.pinctrl/pingroups
    [ 154.530205] armada-37xx-pinctrl d0018800.pinctrl: failed to get pin(29) name
    [ 154.537567] ------------[ cut here ]------------
    [ 154.542348] WARNING: CPU: 1 PID: 1347 at /home/gclement/open/kernel/marvell-mainline-linux/drivers/pinctrl/core.c:1610 pinctrl_groups_show+0x15c/0x1a0
    [ 154.555918] Modules linked in:
    [ 154.558890] CPU: 1 PID: 1347 Comm: cat Tainted: G W 4.13.0-rc1-00001-g19e1b9fa219d #525
    [ 154.568316] Hardware name: Marvell Armada 3720 Development Board DB-88F3720-DDR3 (DT)
    [ 154.576311] task: ffff80001d32d100 task.stack: ffff80001bdc0000
    [ 154.583048] PC is at pinctrl_groups_show+0x15c/0x1a0
    [ 154.587816] LR is at pinctrl_groups_show+0x148/0x1a0
    [ 154.592847] pc : [] lr : [] pstate: 00000145
    [ 154.600840] sp : ffff80001bdc3c80
    [ 154.604255] x29: ffff80001bdc3c80 x28: 00000000f7750000
    [ 154.609825] x27: ffff80001d05d198 x26: 0000000000000009
    [ 154.615224] x25: ffff0000089ead20 x24: 0000000000000002
    [ 154.620705] x23: ffff000008c8e1d0 x22: ffff80001be55700
    [ 154.626187] x21: ffff80001d05d100 x20: 0000000000000005
    [ 154.631667] x19: 0000000000000006 x18: 0000000000000010
    [ 154.637238] x17: 0000000000000000 x16: ffff0000081fc4b8
    [ 154.642726] x15: 0000000000000006 x14: ffff0000899e537f
    [ 154.648214] x13: ffff0000099e538d x12: 206f742064656c69
    [ 154.653613] x11: 6166203a6c727463 x10: 0000000005f5e0ff
    [ 154.659094] x9 : ffff80001bdc38c0 x8 : 286e697020746567
    [ 154.664576] x7 : ffff000008551870 x6 : 000000000000011b
    [ 154.670146] x5 : 0000000000000000 x4 : 0000000000000000
    [ 154.675544] x3 : 0000000000000000 x2 : 0000000000000000
    [ 154.681025] x1 : ffff000008c8e1d0 x0 : ffff80001be55700
    [ 154.686507] Call trace:
    [ 154.688668] Exception stack(0xffff80001bdc3ab0 to 0xffff80001bdc3be0)
    [ 154.695224] 3aa0: 0000000000000006 0001000000000000
    [ 154.703310] 3ac0: ffff80001bdc3c80 ffff0000083e3adc ffff80001bdc3bb0 00000000ffffffd8
    [ 154.711304] 3ae0: 4554535953425553 6f6674616c703d4d 4349564544006d72 6674616c702b3d45
    [ 154.719478] 3b00: 313030643a6d726f 6e69702e30303838 ffff80006c727463 ffff0000089635d8
    [ 154.727562] 3b20: ffff80001d1ca0cb ffff000008af0fa4 ffff80001bdc3b40 ffff000008c8e1dc
    [ 154.735648] 3b40: ffff80001bdc3bc0 ffff000008223174 ffff80001be55700 ffff000008c8e1d0
    [ 154.743731] 3b60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    [ 154.752354] 3b80: 000000000000011b ffff000008551870 286e697020746567 ffff80001bdc38c0
    [ 154.760446] 3ba0: 0000000005f5e0ff 6166203a6c727463 206f742064656c69 ffff0000099e538d
    [ 154.767910] 3bc0: ffff0000899e537f 0000000000000006 ffff0000081fc4b8 0000000000000000
    [ 154.776085] [] pinctrl_groups_show+0x15c/0x1a0
    [ 154.782823] [] seq_read+0x184/0x460
    [ 154.787505] [] full_proxy_read+0x60/0xa8
    [ 154.793431] [] __vfs_read+0x1c/0x110
    [ 154.799001] [] vfs_read+0x84/0x140
    [ 154.803860] [] SyS_read+0x44/0xa0
    [ 154.808983] [] el0_svc_naked+0x24/0x28
    [ 154.814459] ---[ end trace 4cbb00a92d616b95 ]---

    Cc: stable@vger.kernel.org
    Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support
    for Armada 37xx")
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Gregory CLEMENT
     
  • Pin 23 on South bridge does not belong to the rgmii group. It belongs to
    a separate group which can have 3 functions.

    Due to this the fix also have to update the way the functions are
    managed. Until now each groups used NB_FUNCS(which was 2) functions. For
    the mpp23, 3 functions are available but it is the only group which needs
    it, so on the loop involving NB_FUNCS an extra test was added to handle
    only the functions added.

    The bug was visible with the merge of the commit 07d065abf93d "arm64:
    dts: marvell: armada-3720-db: Add vqmmc regulator for SD slot", the gpio
    regulator used the gpio 23, due to this the whole rgmii group was setup
    to gpio which broke the Ethernet support on the Armada 3720 DB
    board. Thanks to this patch, the UHS SD cards (which need the vqmmc)
    _and_ the Ethernet work again.

    Cc: stable@vger.kernel.org
    Fixes: 87466ccd9401 ("pinctrl: armada-37xx: Add pin controller support
    for Armada 37xx")
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Linus Walleij

    Gregory CLEMENT
     

29 Jun, 2017

2 commits