24 Mar, 2020

1 commit

  • There are at least 3 models of the HP x2 10 models:

    Bay Trail SoC + AXP288 PMIC
    Cherry Trail SoC + AXP288 PMIC
    Cherry Trail SoC + TI PMIC

    Like on the other HP x2 10 models we need to ignore wakeup for ACPI GPIO
    events on the external embedded-controller pin to avoid spurious wakeups
    on the HP x2 10 CHT + AXP288 model too.

    This commit adds an extra DMI based quirk for the HP x2 10 CHT + AXP288
    model, ignoring wakeups for ACPI GPIO events on the EC interrupt pin
    on this model. This fixes spurious wakeups from suspend on this model.

    Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
    Reported-and-tested-by: Marc Lehmann
    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200302111225.6641-4-hdegoede@redhat.com
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Hans de Goede
     

11 Mar, 2020

4 commits

  • Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
    quirk mechanism") was added to deal with spurious wakeups on one specific
    model of the HP x2 10 series. In the mean time I have learned that there
    are at least 3 different HP x2 10 models:

    Bay Trail SoC + AXP288 PMIC
    Cherry Trail SoC + AXP288 PMIC
    Cherry Trail SoC + TI PMIC

    And the original quirk is only correct for (and only matches the)
    Cherry Trail SoC + TI PMIC model.

    The Bay Trail SoC + AXP288 PMIC model has different DMI strings, has
    the external EC interrupt on a different GPIO pin and only needs to ignore
    wakeups on the EC interrupt, the INT0002 device works fine on this model.

    This commit adds an extra DMI based quirk for the HP x2 10 BYT + AXP288
    model, ignoring wakeups for ACPI GPIO events on the EC interrupt pin
    on this model. This fixes spurious wakeups from suspend on this model.

    Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200302111225.6641-3-hdegoede@redhat.com
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Hans de Goede
     
  • Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
    quirk mechanism") was added to deal with spurious wakeups on one specific
    model of the HP x2 10 series.

    The approach taken there was to add a bool controlling wakeup support for
    all ACPI GPIO events. This was sufficient for the specific HP x2 10 model
    the commit was trying to fix, but in the mean time other models have
    turned up which need a similar workaround to avoid spurious wakeups from
    suspend, but only for one of the pins on which the ACPI tables request
    ACPI GPIO events.

    Since the honor_wakeup option was added to be able to ignore wake events,
    the name was perhaps not the best, this commit renames it to ignore_wake
    and changes it to a string with the following format:
    gpiolib_acpi.ignore_wake=controller@pin[,controller@pin[,...]]

    This allows working around spurious wakeup issues on a per pin basis.

    This commit also reworks the existing quirk for the HP x2 10 so that
    it functions as before.

    Note:
    -This removes the honor_wakeup parameter. This has only been upstream for
    a short time and to the best of my knowledge there are no users using
    this module parameter.

    -The controller@pin[,controller@pin[,...]] syntax is based on an existing
    kernel module parameter using the same controller@pin format. That version
    uses ';' as separator, but in practice that is problematic because grub2
    cannot handle this without taking special care to escape the ';', so here
    we are using a ',' as separator instead which does not have this issue.

    Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200302111225.6641-2-hdegoede@redhat.com
    Acked-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Linus Walleij

    Hans de Goede
     
  • Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
    quirk mechanism") added a quirk for some models of the HP x2 10 series.

    There are 2 issues with the comment describing the quirk:
    1) The comment claims the DMI quirk applies to all Cherry Trail based HP x2
    10 models. In the mean time I have learned that there are at least 3
    models of the HP x2 10 models:

    Bay Trail SoC + AXP288 PMIC
    Cherry Trail SoC + AXP288 PMIC
    Cherry Trail SoC + TI PMIC

    And this quirk's DMI matches only match the Cherry Trail SoC + TI PMIC
    SoC, which is good because we want a slightly different quirk for the
    others. This commit updates the comment to make it clear that the quirk
    is only for the Cherry Trail SoC + TI PMIC models.

    2) The comment says that it is ok to disable wakeup on all ACPI GPIO event
    handlers, because there is only the one for the embedded-controller
    events. This is not true, there also is a handler for the special
    INT0002 device which is related to USB wakeups. We need to also disable
    wakeups on that one because the device turns of the USB-keyboard built
    into the dock when closing the lid. The XHCI controller takes a while
    to notice this, so it only notices it when already suspended, causing
    a spurious wakeup because of this. So disabling wakeup on all handlers
    is the right thing to do, but not because there only is the one handler
    for the EC events. This commit updates the comment to correctly reflect
    this.

    Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200302111225.6641-1-hdegoede@redhat.com
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Hans de Goede
     
  • The implementation if .irq_disable() which kicks in between
    the gpiolib and the driver is not properly mimicking the
    expected semantics of the irqchip core: the irqchip will
    call .irq_disable() if that exists, else it will call
    mask_irq() which first checks if .irq_mask() is defined
    before calling it.

    Since we are calling it unconditionally, we get this bug
    from drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c, as it only
    defines .irq_mask_ack and not .irq_mask:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = (ptrval)
    (...)
    PC is at 0x0
    LR is at gpiochip_irq_disable+0x20/0x30

    Fix this by only calling .irq_mask() if it exists.

    Cc: Brian Masney
    Cc: Hans Verkuil
    Cc: stable@vger.kernel.org
    Reviewed-by: Bartosz Golaszewski
    Fixes: 461c1a7d4733 ("gpiolib: override irq_enable/disable")
    Signed-off-by: Linus Walleij
    Link: https://lore.kernel.org/r/20200306132326.1329640-1-linus.walleij@linaro.org

    Linus Walleij
     

10 Feb, 2020

7 commits

  • Typcasting "irq_state" leads to the below static checker warning:
    The fix is to declare "irq_state" as unsigned long instead of u32.

    drivers/gpio/gpio-sifive.c:97 sifive_gpio_irq_enable()
    warn: passing casted pointer '&chip->irq_state' to
    'assign_bit()' 32 vs 64.

    Fixes: 96868dce644d ("gpio/sifive: Add GPIO driver for SiFive SoCs")
    Reported-by: Dan Carpenter
    Signed-off-by: Yash Shah
    Link: https://lore.kernel.org/r/1580189061-14091-1-git-send-email-yash.shah@sifive.com
    Reviewed-by: Marc Zyngier
    Signed-off-by: Linus Walleij

    Yash Shah
     
  • Care is taken with "index", however with the current version
    the actual xgpio_writereg is using index for data but
    xgpio_regoffset(chip, i) for the offset. And since i is already
    incremented it is incorrect. This patch fixes it so that index
    is used for the offset too.

    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Thomas
    Link: https://lore.kernel.org/r/20200125221410.8022-1-pthomas8589@gmail.com
    Signed-off-by: Linus Walleij

    Paul Thomas
     
  • Remove unnecessary argument when setting PIN_CONFIG_BIAS_DISABLE. No
    argument is expected by pinctrl, so removing it should be harmless.

    Fixes: 2148ad7790ea ("gpiolib: add support for disabling line bias")
    Signed-off-by: Kent Gibson
    Signed-off-by: Bartosz Golaszewski

    Kent Gibson
     
  • They are defined in gpio/driver.h now.

    Signed-off-by: Axel Lin
    Signed-off-by: Bartosz Golaszewski

    Axel Lin
     
  • Commit d90f36851d65 ("gpiolib: have a single place of calling
    set_config()") introduced a regression where we don't pass the right
    variable as argument to the set_config() callback of gpio driver from
    gpio_set_config(). After reverting two additional patches that came
    on top of it - this addresses the issue by changing the type of the last
    argument of gpio_do_set_config() to unsigned long and making sure the
    packed config variable is actually used in gpio_set_config().

    Fixes: d90f36851d65 ("gpiolib: have a single place of calling set_config()")
    Signed-off-by: Bartosz Golaszewski
    Tested-by: Guenter Roeck

    Bartosz Golaszewski
     
  • This reverts commit e5e42ad224a040f93bf112e96f82b3a0ed97ffab.

    This patch came on top of another patch that introduced a regression.
    Revert it before addressing the culprit.

    Signed-off-by: Bartosz Golaszewski
    Tested-by: Guenter Roeck

    Bartosz Golaszewski
     
  • This reverts commit d18fddff061d2796525e6d4a958cb3d30aed8efd.

    This patch came on top of another patch that introduced a regression.
    Revert it before addressing the culprit.

    Signed-off-by: Bartosz Golaszewski
    Tested-by: Guenter Roeck

    Bartosz Golaszewski
     

04 Feb, 2020

1 commit

  • 'PTR_ERR(p) == -E*' is a stronger condition than IS_ERR(p).
    Hence, IS_ERR(p) is unneeded.

    The semantic patch that generates this commit is as follows:

    //
    @@
    expression ptr;
    constant error_code;
    @@
    -IS_ERR(ptr) && (PTR_ERR(ptr) == - error_code)
    +PTR_ERR(ptr) == - error_code
    //

    Link: http://lkml.kernel.org/r/20200106045833.1725-1-masahiroy@kernel.org
    Signed-off-by: Masahiro Yamada
    Cc: Julia Lawall
    Acked-by: Stephen Boyd [drivers/clk/clk.c]
    Acked-by: Bartosz Golaszewski [GPIO]
    Acked-by: Wolfram Sang [drivers/i2c]
    Acked-by: Rafael J. Wysocki [acpi/scan.c]
    Acked-by: Rob Herring
    Cc: Eric Biggers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

03 Feb, 2020

1 commit

  • Pull MFD updates from Lee Jones:
    "New Drivers:
    - Add support for ROHM BD71828 PMICs and GPIOs
    - Add support for Qualcomm Aqstic Audio Codecs WCD9340 and WCD9341

    New Device Support:
    - Add support for BD71828 to BD70528 RTC driver
    - Add support for Intel's Jasper Lake to LPSS PCI

    New Functionality:
    - Add support for Power Key to ROHM BD71828
    - Add support for Clocks to ROHM BD71828
    - Add support for GPIOs to Dialog DA9062
    - Add support for USB PD Notify to ChromiumOS EC
    - Allow callers to specify args when requesting regmap lookup; syscon

    Fix-ups:
    - Improve error handling and sanity checking; atmel-hlcdc, dln2
    - Device Tree support/documentation; bd71828, da9062, xylon,logicvc,
    ab8500, max14577, atmel-usart
    - Match devices using platform IDs; bd7xxxx
    - Refactor BD718x7 regulator component; bd718x7-regulator
    - Use standard interfaces/helpers; syscon, sm501
    - Trivial (whitespace, spelling, etc); ab8500-core, Kconfig
    - Remove unused code; db8500-prcmu, tqmx86
    - Wait until boot has finished before accessing registers;
    madera-core
    - Provide missing register value defaults; cs47l15-tables
    - Allow more time for hardware to reset; madera-core

    Bug Fixes:
    - Fix erroneous register values; rohm-bd70528
    - Fix register volatility; axp20x, rn5t618
    - Fix Kconfig dependencies; MFD_MAX77650
    - Fix incorrect compatible string; da9062-core
    - Fix syscon_regmap_lookup_by_phandle_args() stub; syscon"

    * tag 'mfd-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (41 commits)
    mfd: syscon: Fix syscon_regmap_lookup_by_phandle_args() dummy
    mfd: wcd934x: Add support to wcd9340/wcd9341 codec
    mfd: syscon: Add arguments support for syscon reference
    mfd: rn5t618: Mark ADC control register volatile
    dt-bindings: atmel-usart: Add microchip,sam9x60-{usart, dbgu}
    dt-bindings: atmel-usart: Remove wildcard
    mfd: cros_ec: Add cros-usbpd-notify subdevice
    mfd: da9062: Fix watchdog compatible string
    mfd: madera: Allow more time for hardware reset
    mfd: cs47l15: Add missing register default
    mfd: madera: Wait for boot done before accessing any other registers
    mfd: Kconfig: Rename Samsung to lowercase
    mfd: tqmx86: remove set but not used variable 'i2c_ien'
    mfd: dbx500-prcmu: Drop DSI pll clock functions
    mfd: dbx500-prcmu: Drop set_display_clocks()
    mfd: max77650: Select REGMAP_IRQ in Kconfig
    mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile
    mfd: ab8500: Fix ab8500-clk typo
    mfd: intel-lpss: Add Intel Jasper Lake PCI IDs
    dt-bindings: mfd: max14577: Add reference to max14040_battery.txt descriptions
    ...

    Linus Torvalds
     

30 Jan, 2020

2 commits

  • Pull pin control updates from Linus Walleij:
    "This is the bulk of pin control changes, nothing too exciting about
    this.

    Some changes hit arch/sh and arch/arm but are well isolated and
    acknowledged by the respective arch maintainers.

    Core changes:

    - Dropped the chained IRQ setup callback into GPIOLIB as we got rid
    of the last users of that in this changeset.

    New drivers:

    - New driver for Ingenic X1830.

    - New driver for Freescale i.MX8MP.

    Driver enhancements:

    - Fix all remaining Intel drivers to pass their IRQ chips along with
    the GPIO chips.

    - Intel Baytrail allocates its irqchip dynamically.

    - Intel Lynxpoint is thoroughly rewritten and modernized.

    - Aspeed AST2600 pin muxing and configuration is much improved.

    - Qualcomm SC7180 functions are updated and wakeup interrupt map is
    provided.

    - A whole slew of Renesas SH-PFC cleanups and improvements.

    - Fix up the Intel DT bindings to use the generic YAML DT bindings
    schema (a first user of this)"

    * tag 'pinctrl-v5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (99 commits)
    pinctrl: madera: Remove extra blank line
    pinctrl: qcom: Don't lock around irq_set_irq_wake()
    pinctrl: mvebu: armada-37xx: use use platform api
    gpio: Drop the chained IRQ handler assign function
    pinctrl: freescale: Add i.MX8MP pinctrl driver support
    dt-bindings: imx: Add pinctrl binding doc for i.MX8MP
    pinctrl: tigerlake: Tiger Lake uses _HID enumeration
    pinctrl: sunrisepoint: Add Coffee Lake-S ACPI ID
    pinctrl: iproc: Use platform_get_irq_optional() to avoid error message
    pinctrl: dt-bindings: Fix some errors in the lgm and pinmux schema
    pinctrl: intel: Pass irqchip when adding gpiochip
    pinctrl: intel: Add GPIO pin mapping ranges via callback
    pinctrl: baytrail: Replace WARN with dev_info_once when setting direct-irq pin to output
    pinctrl: baytrail: Do not clear IRQ flags on direct-irq enabled pins
    pinctrl: sunrisepoint: Add missing Interrupt Status register offset
    pinctrl: sh-pfc: Split R-Car H3 support in two independent drivers
    pinctrl: artpec6: fix __iomem on reg in set
    pinctrl: ingenic: Use devm_platform_ioremap_resource()
    pinctrl: ingenic: Factorize irq_set_type function
    pinctrl: ingenic: Remove duplicated ingenic_chip_info structures
    ...

    Linus Torvalds
     
  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v5.6 kernel cycle.

    This is a pretty calm cycle so far, nothing special going on really.
    Some more changes will come in from the irqchip and pin control trees.

    I also deleted an orphan include file for FMC that was dangling since
    subsystem was removed.

    Core changes:

    - Document the usecases for the kernelspace vs userspace handling of
    GPIOs.

    - Handle MSI (message signalled interrupts) properly in the core
    hierarchical irqdomain code.

    - Fix a rare race condition while initializing the descriptor array.

    New drivers:

    - Xylon LogiCVC GPIO driver.

    - WDC934x GPIO controller driver.

    Driver improvements:

    - Implemented suspend/resume in the Tegra driver.

    - MPC8xx edge detection fixup.

    - Properly convert ThunderX to use hierarchical irqdomain with
    GPIOLIB_IRQCHIP on top of the revert of the previous buggy
    switchover. This time it works (hopefully).

    Misc:

    - Drop a FMC remnant file

    - A slew of fixes"

    * tag 'gpio-v5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (48 commits)
    MAINTAINERS: Replace Tien Hock Loh as Altera PIO maintainer
    gpiolib: hold gpio devices lock until ->descs array is initialised
    gpio: aspeed-sgpio: fixed typos
    gpio: mvebu: clear irq in edge cause register before unmask edge irq
    gpiolib: Lower verbosity when allocating hierarchy irq
    gpiolib: Remove duplicated function gpio_do_set_config()
    gpio: Fix the no return statement warning
    gpio: wcd934x: Add support to wcd934x gpio controller
    gpiolib: remove set but not used variable 'config'
    gpio: vx855: fixed a typo
    gpio: mockup: sort headers alphabetically
    gpio: mockup: update the license tag
    gpio: Remove the unused flags
    gpiolib: Set lockdep class for hierarchical irq domains
    gpio: thunderx: Switch to GPIOLIB_IRQCHIP
    gpiolib: Add the support for the msi parent domain
    gpiolib: Add support for the irqdomain which doesn't use irq_fwspec as arg
    gpio: Add use guidance documentation
    dt-bindings: gpio: wcd934x: Add bindings for gpio
    gpio: altera: change to platform_get_irq_optional to avoid false-positive error
    ...

    Linus Torvalds
     

28 Jan, 2020

2 commits

  • Pull irq updates from Thomas Gleixner:
    "The interrupt departement provides:

    - A mechanism to shield isolated tasks from managed interrupts:

    The affinity of managed interrupts is completely controlled by the
    kernel and user space has no influence on them. The reason is that
    the automatically assigned affinity correlates to the multi-queue
    CPU handling of block devices.

    If the generated affinity mask spaws both housekeeping and isolated
    CPUs the interrupt could be routed to an isolated CPU which would
    then be disturbed by I/O submitted by a housekeeping CPU.

    The new mechamism ensures that as long as one housekeeping CPU is
    online in the assigned affinity mask the interrupt is routed to a
    housekeeping CPU.

    If there is no online housekeeping CPU in the affinity mask, then
    the interrupt is routed to an isolated CPU to keep the device queue
    intact, but unless the isolated CPU submits I/O by itself these
    interrupts are not raised.

    - A small addon to the device tree irqdomain core code to avoid
    duplication in irq chip drivers

    - Conversion of the SiFive PLIC to hierarchical domains

    - The usual pile of new irq chip drivers: SiFive GPIO, Aspeed SCI,
    NXP INTMUX, Meson A1 GPIO

    - The first cut of support for the new ARM GICv4.1

    - The usual pile of fixes and improvements in core and driver code"

    * tag 'irq-core-2020-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (33 commits)
    genirq, sched/isolation: Isolate from handling managed interrupts
    irqchip/gic-v4.1: Allow direct invalidation of VLPIs
    irqchip/gic-v4.1: Suppress per-VLPI doorbell
    irqchip/gic-v4.1: Add VPE INVALL callback
    irqchip/gic-v4.1: Add VPE eviction callback
    irqchip/gic-v4.1: Add VPE residency callback
    irqchip/gic-v4.1: Add mask/unmask doorbell callbacks
    irqchip/gic-v4.1: Plumb skeletal VPE irqchip
    irqchip/gic-v4.1: Implement the v4.1 flavour of VMOVP
    irqchip/gic-v4.1: Don't use the VPE proxy if RVPEID is set
    irqchip/gic-v4.1: Implement the v4.1 flavour of VMAPP
    irqchip/gic-v4.1: VPE table (aka GICR_VPROPBASER) allocation
    irqchip/gic-v3: Add GICv4.1 VPEID size discovery
    irqchip/gic-v3: Detect GICv4.1 supporting RVPEID
    irqchip/gic-v3-its: Fix get_vlpi_map() breakage with doorbells
    irqdomain: Fix a memory leak in irq_domain_push_irq()
    irqchip: Add NXP INTMUX interrupt multiplexer support
    dt-bindings: interrupt-controller: Add binding for NXP INTMUX interrupt multiplexer
    irqchip: Define EXYNOS_IRQ_COMBINER
    irqchip/meson-gpio: Add support for meson a1 SoCs
    ...

    Linus Torvalds
     
  • Pull MMC updates from Ulf Hansson:
    "There are no updates for the MEMSTICK subsystem this time. But note
    that I am also carrying a patch from the pinctrl tree, which has been
    shared through an immutable branch.

    Summary:

    MMC core:
    - Convert to reasonable timeouts for all CMD6 commands (updates for
    BKOPS, CACHE_FLUSH and INAND_CMD38_ARG_EXT_CSD) for eMMC
    - Respect f_max clock rate at card initialization
    - Add gpiod_toggle_active_low() API
    - Consolidate slot-gpio code by using gpiod_toggle_active_low()

    MMC host:
    - Add pinctrl_select_default_state() API
    - Consolidate pintctrl code by using pinctrl_select_default_state()
    - mmci: Support any block sizes for SDIO for some variants
    - mmci: Enable reset control for stm32_sdmmc
    - mmc_spi: Toggle SPI_CS_HIGH polarity rather than hard-coding it
    - renesas_sdhi: Add support for the r8a77961 variant
    - renesas_sdhi: A few minor improvements
    - rockchip-dw-mshc: Add support for the rk3308 variant
    - sdhci: Enable support for external DMA controllers
    - sdhci: Fixup error path when sending CMD12
    - sdhci-brcmstb: Add support for 7216b0 variant
    - sdhci-brcmstb: Add support for command queuing (CQHCI)
    - sdhci-brcmstb: Add support for eMMC HS400ES mode
    - sdhci-msm: Add support for the sc7180 variant
    - sdhci-msm: Add support for command queuing (CQHCI)
    - sdhci-of-at91: Add support for the SAM9x60 variant
    - sdhci-of-at91: Improve support for tunings
    - sdhci-of-esdhc: A few fixups for some clock related issues
    - sdhci-omap: Add support for the am335x and the am437x variants
    - sdhci-omap: Improve support for erase operations
    - sdhci-omap: Add support for external DMA"

    * tag 'mmc-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (89 commits)
    mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch()
    mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD
    mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC
    mmc: sdhci-cadence: remove unneeded 'inline' marker
    dt-bindings: mmc: rockchip-dw-mshc: add description for rk3308
    dt-bindings: mmc: convert rockchip dw-mshc bindings to yaml
    dt-bindings: mmc: convert synopsys dw-mshc bindings to yaml
    mmc: sdhci-msm: Add CQHCI support for sdhci-msm
    mmc: sdhci: Let a vendor driver supply and update ADMA descriptor size
    mmc: sdhci-of-esdhc: fix serious issue clock is always disabled
    mmc: sdhci-of-esdhc: fix transfer mode register reading
    mmc: sdhci-brcmstb: Fix incorrect switch to HS mode
    mmc: sdhci-brcmstb: Add support for Command Queuing (CQE)
    mmc: sdhci-brcmstb: Add shutdown callback
    mmc: sdhci-brcmstb: Fix driver to defer on clk_get defer
    mmc: sdhci-brcmstb: Add ability to use HS400ES transfer mode
    dt-bindings: mmc: brcm,sdhci-brcmstb: Add support for 7216b0
    mmc: core: limit probe clock frequency to configured f_max
    mmc: sdhci-milbeaut: Remove redundant platform_get_irq error message
    mmc: sdhci: fix an issue of mixing different types
    ...

    Linus Torvalds
     

26 Jan, 2020

1 commit


24 Jan, 2020

1 commit

  • ROHM BD71828 PMIC contains 4 pins which can be configured by OTP
    to be used for general purposes. First 3 can be used as outputs
    and 4.th pin can be used as input. Allow them to be controlled
    via GPIO framework.

    The driver assumes all of the pins are configured as GPIOs and
    trusts that the reserved pins in other OTP configurations are
    excluded from control using "gpio-reserved-ranges" device tree
    property (or left untouched by GPIO users).

    Typical use for 4.th pin (input) is to use it as HALL sensor
    input so that this pin state is toggled when HALL sensor detects
    LID position change (from close to open or open to close). PMIC
    HW implements some extra logic which allows PMIC to power-up the
    system when this pin is toggled. Please see the data sheet for
    details of GPIO options which can be selected by OTP settings.

    Signed-off-by: Matti Vaittinen
    Reviewed-by: Bartosz Golaszewski
    Reviewed-by: Linus Walleij
    Signed-off-by: Lee Jones

    Matti Vaittinen
     

23 Jan, 2020

6 commits

  • If a driver consuming the GPIO chip is being probed at the same time as
    the GPIO driver is registering the chip, it is possible for the
    consuming driver to see the ->descs array in an uninitialised state.
    For example, the gpio-keys-polled driver can fail like this:

    kernel: gpiod_request: invalid GPIO (no device)
    kernel: gpio-keys-polled PRP0001:07: failed to get gpio: -22
    kernel: gpio-keys-polled: probe of PRP0001:07 failed with error -22

    This patch makes gpiochip_add() hold the lock protecting gpio_devices
    until it has finished setting desc->gdev on the newly inserted list
    entry.

    Signed-off-by: Dan Callaghan
    Link: https://lore.kernel.org/r/20200121001216.15964-1-dan.callaghan@opengear.com
    Signed-off-by: Linus Walleij

    Dan Callaghan
     
  • This fixes some various typos.

    Signed-off-by: Sachin Agarwal
    Link: https://lore.kernel.org/r/20200118105319.68637-1-sachinagarwal@sachins-MacBook-2.local
    Signed-off-by: Linus Walleij

    Sachin agarwal
     
  • gpiochip_set_chained_irqchip() would assign a chained handler
    to a GPIO chip. We now populate struct gpio_irq_chip for all
    chained GPIO irqchips so drop this function.

    Cc: Andy Shevchenko
    Signed-off-by: Linus Walleij
    Link: https://lore.kernel.org/r/20200113220800.77817-1-linus.walleij@linaro.org
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • When input GPIO set from 0 to 1, the interrupt bit asserted in the GPIO
    Interrupt Cause Register (ICR) even if the corresponding interrupt
    masked in the GPIO Interrupt Mask Register.

    Because interrupt mask register only affects assertion of the interrupt
    bits in Main Interrupt Cause Register and it does not affect the
    setting of bits in the GPIO ICR.

    So, there is problem, when we unmask interrupt with already
    asserted bit in the GPIO ICR, then false interrupt immediately occurs
    even if GPIO don't change their value since last unmask.

    Signed-off-by: Maxim Kiselev
    Link: https://lore.kernel.org/r/20200115073811.24438-1-bigunclemax@gmail.com
    Signed-off-by: Linus Walleij

    Maxim Kiselev
     
  • In the current codes, the following 3 lines would be output to
    the console for each irq line.
    gpio gpiochip0: (gpio_thunderx): allocate IRQ 10, hwirq 0
    gpio gpiochip0: (gpio_thunderx): found parent hwirq 245784
    gpio gpiochip0: (gpio_thunderx): alloc_irqs_parent for 10 parent hwirq 245784

    In general, there are about tens of irq lines for each gpio chip,
    and then it would emit so many insignificant log in the boot process.
    These infos are more suitable for the dbg purpose. So change these
    to the dbg level. With this change, about 200 lines are suppressed
    on my Marvell cn96xx board.

    Signed-off-by: Kevin Hao
    Link: https://lore.kernel.org/r/20200120095625.25164-1-haokexin@gmail.com
    Signed-off-by: Linus Walleij

    Kevin Hao
     
  • …t/pinctrl/intel into devel

    intel-pinctrl for v5.6-1

    * Tiger Lake appears to have _HID enumeration, thus driver has been updated
    * Coffee Lake-S has the same IP as Sunrisepoint, thus ID has been added
    * Baytrail has got more clean ups and bug fixes, such as direct IRQ handling
    * Lynxpoint GPIO has been converted to true pin control driver
    * The common driver now uses IRQ chip enumeration via GPIO chip

    The following is an automated git shortlog grouped by driver:

    baytrail:
    - Replace WARN with dev_info_once when setting direct-irq pin to output
    - Do not clear IRQ flags on direct-irq enabled pins
    - Reuse struct intel_pinctrl in the driver
    - Use local variable to keep device pointer
    - Keep pointer to struct device instead of its container
    - Use GPIO direction definitions
    - Move IRQ valid mask initialization to a dedicated callback
    - Group GPIO IRQ chip initialization
    - Allocate IRQ chip dynamic

    cherryview:
    - Use GPIO direction definitions

    intel:
    - Pass irqchip when adding gpiochip
    - Add GPIO <-> pin mapping ranges via callback
    - Share struct intel_pinctrl for wider use
    - Use GPIO direction definitions

    lynxpoint:
    - Update summary in the driver
    - Switch to pin control API
    - Add GPIO <-> pin mapping ranges via callback
    - Implement ->pin_dbg_show()
    - Add pin control operations
    - Reuse struct intel_pinctrl in the driver
    - Add pin control data structures
    - Implement intel_gpio_get_direction callback
    - Implement ->irq_ack() callback
    - Move ownership check to IRQ chip
    - Move lp_irq_type() closer to IRQ related routines
    - Move ->remove closer to ->probe()
    - Extract lp_gpio_acpi_use() for future use
    - Convert unsigned to unsigned int
    - Switch to memory mapped IO accessors
    - Keep pointer to struct device instead of its container
    - Relax GPIO request rules
    - Assume 2 bits for mode selector
    - Use standard pattern for memory allocation
    - Use %pR to print IO resource
    - Drop useless assignment
    - Correct amount of pins
    - Use raw_spinlock for locking
    - Move GPIO driver to pin controller folder

    sunrisepoint:
    - Add Coffee Lake-S ACPI ID
    - Add missing Interrupt Status register offset

    tigerlake:
    - Tiger Lake uses _HID enumeration

    Linus Walleij
     

21 Jan, 2020

1 commit

  • Adds the GPIO driver for SiFive RISC-V SoCs.

    Signed-off-by: Wesley W. Terpstra
    [Atish: Various fixes and code cleanup]
    Signed-off-by: Atish Patra
    Signed-off-by: Yash Shah
    Signed-off-by: Marc Zyngier
    Reviewed-by: Bartosz Golaszewski
    Reviewed-by: Linus Walleij
    Link: https://lore.kernel.org/r/1575976274-13487-6-git-send-email-yash.shah@sifive.com

    Yash Shah
     

17 Jan, 2020

3 commits


15 Jan, 2020

10 commits

  • This patch adds support to wcd934x gpio block found in
    WCD9340/WC9341 Audio codecs.

    Signed-off-by: Srinivas Kandagatla
    Link: https://lore.kernel.org/r/20200107130844.20763-3-srinivas.kandagatla@linaro.org
    Signed-off-by: Linus Walleij

    Srinivas Kandagatla
     
  • drivers/gpio/gpiolib.c: In function gpio_set_config:
    drivers/gpio/gpiolib.c:3053:16: warning:
    variable config set but not used [-Wunused-but-set-variable]

    commit d90f36851d65 ("gpiolib: have a single place
    of calling set_config()") left behind this unused variable.

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20200108121117.45060-1-yuehaibing@huawei.com
    Reviewed-by: Bartosz Golaszewski
    Signed-off-by: Linus Walleij

    YueHaibing
     
  • we had written "betwee" rather than "between".

    Signed-off-by: Sachin agarwal
    Link: https://lore.kernel.org/r/20200112143312.66048-1-sachinagarwal@sachins-MacBook-2.local
    Signed-off-by: Linus Walleij

    Sachin agarwal
     
  • For consistency and easier maintenance: sort the headers alphabetically.

    Signed-off-by: Bartosz Golaszewski
    Link: https://lore.kernel.org/r/20200114150253.28716-3-brgl@bgdev.pl
    Signed-off-by: Linus Walleij

    Bartosz Golaszewski
     
  • The current GPL v2.0 or later SPDX tag is 'GPL-2.0-or-later' as defined
    at https://spdx.org/licenses/.

    Signed-off-by: Bartosz Golaszewski
    Link: https://lore.kernel.org/r/20200114150253.28716-2-brgl@bgdev.pl
    Signed-off-by: Linus Walleij

    Bartosz Golaszewski
     
  • drivers/gpio/gpio-grgpio.c: In function ‘grgpio_remove’:
    drivers/gpio/gpio-grgpio.c:438:16: warning: unused variable ‘flags’ [-Wunused-variable]
    unsigned long flags;
    ^
    Fixes: 25d071b3f6db ("gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_remove()")
    Signed-off-by: Shaokun Zhang
    Link: https://lore.kernel.org/r/1579009062-7154-1-git-send-email-zhangshaokun@hisilicon.com
    Reviewed-by: Bartosz Golaszewski
    Signed-off-by: Linus Walleij

    Shaokun Zhang
     
  • I see the following lockdep splat in the qcom pinctrl driver when
    attempting to suspend the device.

    ============================================
    WARNING: possible recursive locking detected
    5.4.2 #2 Tainted: G S
    --------------------------------------------
    cat/6536 is trying to acquire lock:
    ffffff814787ccc0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94

    but task is already holding lock:
    ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94

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

    CPU0
    ----
    lock(&irq_desc_lock_class);
    lock(&irq_desc_lock_class);

    *** DEADLOCK ***

    May be due to missing lock nesting notation

    7 locks held by cat/6536:
    #0: ffffff8140e0c420 (sb_writers#7){.+.+}, at: vfs_write+0xc8/0x19c
    #1: ffffff8121eec480 (&of->mutex){+.+.}, at: kernfs_fop_write+0x128/0x1f4
    #2: ffffff8147cad668 (kn->count#263){.+.+}, at: kernfs_fop_write+0x130/0x1f4
    #3: ffffffd011446000 (system_transition_mutex){+.+.}, at: pm_suspend+0x108/0x354
    #4: ffffff814302b970 (&dev->mutex){....}, at: __device_suspend+0x16c/0x420
    #5: ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
    #6: ffffff81479b8c10 (&pctrl->lock){....}, at: msm_gpio_irq_set_wake+0x48/0x7c

    stack backtrace:
    CPU: 4 PID: 6536 Comm: cat Tainted: G S 5.4.2 #2
    Call trace:
    dump_backtrace+0x0/0x174
    show_stack+0x20/0x2c
    dump_stack+0xdc/0x144
    __lock_acquire+0x52c/0x2268
    lock_acquire+0x1dc/0x220
    _raw_spin_lock_irqsave+0x64/0x80
    __irq_get_desc_lock+0x64/0x94
    irq_set_irq_wake+0x40/0x144
    msm_gpio_irq_set_wake+0x5c/0x7c
    set_irq_wake_real+0x40/0x5c
    irq_set_irq_wake+0x70/0x144
    cros_ec_rtc_suspend+0x38/0x4c
    platform_pm_suspend+0x34/0x60
    dpm_run_callback+0x64/0xcc
    __device_suspend+0x314/0x420
    dpm_suspend+0xf8/0x298
    dpm_suspend_start+0x84/0xb4
    suspend_devices_and_enter+0xbc/0x628
    pm_suspend+0x214/0x354
    state_store+0xb0/0x108
    kobj_attr_store+0x14/0x24
    sysfs_kf_write+0x4c/0x64
    kernfs_fop_write+0x158/0x1f4
    __vfs_write+0x54/0x18c
    vfs_write+0xdc/0x19c
    ksys_write+0x7c/0xe4
    __arm64_sys_write+0x20/0x2c
    el0_svc_common+0xa8/0x160
    el0_svc_compat_handler+0x2c/0x38
    el0_svc_compat+0x8/0x10

    This is because the msm_gpio_irq_set_wake() function calls
    irq_set_irq_wake() as a backup in case the irq comes in during the path
    to idle. Given that we're calling irqchip functions from within an
    irqchip we need to set the lockdep class to be different for this child
    controller vs. the default one that the parent irqchip gets.

    This used to be done before this driver was converted to hierarchical
    irq domains in commit e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in
    hierarchy") via the gpiochip_irq_map() function. With hierarchical irq
    domains this function has been replaced by
    gpiochip_hierarchy_irq_domain_alloc(). Therefore, set the lockdep class
    like was done previously in the irq domain path so we can avoid this
    lockdep warning.

    Fixes: fdd61a013a24 ("gpio: Add support for hierarchical IRQ domains")
    Cc: Thierry Reding
    Cc: Brian Masney
    Cc: Lina Iyer
    Cc: Marc Zyngier
    Cc: Maulik Shah
    Signed-off-by: Stephen Boyd
    Link: https://lore.kernel.org/r/20200114231103.85641-1-swboyd@chromium.org
    Signed-off-by: Linus Walleij

    Stephen Boyd
     
  • The main parts of this patch are from commit a7fc89f9d5fc ("gpio:
    thunderx: Switch to GPIOLIB_IRQCHIP") and patch [1]. And also adjust
    thunderx_gpio_child_to_parent_hwirq() and add
    thunderx_gpio_populate_parent_alloc_info() to make sure that
    the correct hwirq are passed to the parent msi irqdomain.

    [1] https://patchwork.ozlabs.org/patch/1210180/

    Signed-off-by: Kevin Hao
    Link: https://lore.kernel.org/r/20200114082821.14015-5-haokexin@gmail.com
    Signed-off-by: Linus Walleij

    Kevin Hao
     
  • If the gpio's parent irqdomain is a msi irqdomain, we should ignore
    the EEXIST error returned by the msi irqdomain because all the msi
    interrupts have already been allocated.

    Signed-off-by: Kevin Hao
    Link: https://lore.kernel.org/r/20200114082821.14015-4-haokexin@gmail.com
    Signed-off-by: Linus Walleij

    Kevin Hao
     
  • Some gpio's parent irqdomain may not use the struct irq_fwspec as
    argument, such as msi irqdomain. So rename the callback
    populate_parent_fwspec() to populate_parent_alloc_arg() and make it
    allocate and populate the specific struct which is needed by the
    parent irqdomain.

    Signed-off-by: Kevin Hao
    Link: https://lore.kernel.org/r/20200114082821.14015-3-haokexin@gmail.com
    Signed-off-by: Linus Walleij

    Kevin Hao