05 Aug, 2019

1 commit

  • There is issue that system can't enter suspend while the si476x is
    working.

    The reason is that with the workqueue thread is still working after
    i2c enter suspend, then cause the cpu_suspend function failed.

    This patch is to use the system_freezable_wq instead of the system_wq,
    that the workqueue will be freeze before system enter suspend.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman

    Shengjiu Wang
     

26 Jul, 2019

1 commit


20 May, 2019

1 commit


18 Apr, 2019

20 commits


24 Mar, 2019

1 commit

  • commit ae7b8eda27b33b1f688dfdebe4d46f690a8f9162 upstream.

    There is a potential NULL pointer dereference in case devm_kzalloc()
    fails and returns NULL.

    Fix this by adding a NULL check on *lookup*

    This bug was detected with the help of Coccinelle.

    Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
    Cc: stable@vger.kernel.org
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Lee Jones
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

27 Feb, 2019

14 commits

  • [ Upstream commit 9e28989d41c0eab57ec0bb156617a8757406ff8a ]

    When mc13xxx_reg_read() fails, "old_adc0" is uninitialized and will
    contain random value. Further execution uses "old_adc0" even when
    mc13xxx_reg_read() fails.
    The fix checks the return value of mc13xxx_reg_read(), and exits
    the execution when it fails.

    Signed-off-by: Kangjie Lu
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Kangjie Lu
     
  • [ Upstream commit 75d4c5e03c2ae9902ab521024b10291f6fc9515b ]

    Use devm_regmap_add_irq_chip and clean up error path in probe
    and also the remove function.

    Reported-by: Christian Hohnstaedt
    Signed-off-by: Keerthy
    Reviewed-by: Sebastian Reichel
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Keerthy
     
  • [ Upstream commit 18e294ddafaeb80a1e2e10c9bd750a6cb8388d5b ]

    The driver adds different MFD child devices via mfd_add_devices() and
    hence it is required to call mfd_remove_devices() to remove MFD child
    devices.

    Fixes: 5e0115581bbc ("cros_ec: Move cros_ec_dev module to drivers/mfd")
    Signed-off-by: Enric Balletbo i Serra
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Enric Balletbo i Serra
     
  • [ Upstream commit ea90e7b47f0a8bd2fe14e9a88f523de7c67db90a ]

    Parts of the AXP803 are compatible with their counterparts on the AXP813.
    These include the GPIO, ADC, AC and battery power supplies.

    Signed-off-by: Oskari Lemmela
    Reviewed-by: Chen-Yu Tsai
    Tested-by: Vasily Khoruzhick
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Oskari Lemmela
     
  • [ Upstream commit 753a8d083e085c6f552c7982749de4cc7c40e2ac ]

    In the axp20x driver, the various mfd_cell lists had varying amounts
    of indentation, sometimes even within the same list. For the axp288,
    there's no alignment at all.

    Re-align the right hand side of the assignments with the least amount
    of tabs possible. Also collapse the closing bracket and the opening
    bracket of the next entry onto the same line for the axp288, to be
    consistent with all the other mfd_cell lists.

    This patch is whitespace change only. No functionality is modified.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Oskari Lemmela
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Chen-Yu Tsai
     
  • [ Upstream commit 4a19f9a65375ca9781b3ca9e810ece92edfc3e78 ]

    As axp20x-ac-power-supply now supports AXP813, add a cell for it.

    Signed-off-by: Oskari Lemmela
    Reviewed-by: Quentin Schulz
    Reviewed-by: Chen-Yu Tsai
    Tested-by: Vasily Khoruzhick
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Oskari Lemmela
     
  • [ Upstream commit 04c801c18ded421845324255e660147a6f58dcd6 ]

    Signed-off-by: Charles Keepax
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Charles Keepax
     
  • [ Upstream commit 504e4175829c44328773b96ad9c538e4783a8d22 ]

    This is required as part of the initialization sequence on certain SoCs.

    If these registers are not initialized, the hardware can be unresponsive.
    This fixes the driver on apq8060 (HP TouchPad device).

    Signed-off-by: Jonathan Marek
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Jonathan Marek
     
  • [ Upstream commit b0aff01e7aa6ad2d6998ef1323843212d1db8b04 ]

    Because BD9571MWV_DVFS_MONIVDAC is not defined in the volatile table,
    the physical register value is not updated by regmap and DVFS doesn't
    work as expected. Fix it!

    Fixes: d3ea21272094 ("mfd: Add ROHM BD9571MWV-M MFD PMIC driver")
    Signed-off-by: Dien Pham
    [wsa: rebase, add 'Fixes', reword commit message]
    Signed-off-by: Wolfram Sang
    Reviewed-by: Marek Vasut
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Dien Pham
     
  • [ Upstream commit 10628e3ecf544fa2e4e24f8e112d95c37884dc98 ]

    This function is supposed to return zero on success or negative error
    codes on error. Unfortunately, there is a bug so it sometimes returns
    non-zero, positive numbers on success.

    I noticed this bug during review and I can't test it. It does appear
    that the return is sometimes propogated back to _regmap_read() where all
    non-zero returns are treated as failure so this may affect run time.

    Fixes: 47c1697508f2 ("mfd: Align ab8500 with the abx500 interface")
    Signed-off-by: Dan Carpenter
    Reviewed-by: Linus Walleij
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Dan Carpenter
     
  • [ Upstream commit a177276aa098aa47a100d51a13eaaef029604b6d ]

    If the PMIC ID is unknown, the current code would call
    irq_domain_remove and panic, as pmic->irq_domain is only
    initialized by mt6397_irq_init.

    Return immediately with an error, if the chip ID is unsupported.

    Signed-off-by: Nicolas Boichat
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Nicolas Boichat
     
  • [ Upstream commit a3888f62fe66429fad3be7f2ba962e1e08c26fd6 ]

    When building the kernel with Clang, the following section mismatch
    warnings appear:

    WARNING: vmlinux.o(.text+0x7239cc): Section mismatch in reference from
    the function db8500_prcmu_probe() to the function
    .init.text:init_prcm_registers()
    The function db8500_prcmu_probe() references
    the function __init init_prcm_registers().
    This is often because db8500_prcmu_probe lacks a __init
    annotation or the annotation of init_prcm_registers is wrong.

    WARNING: vmlinux.o(.text+0x723e28): Section mismatch in reference from
    the function db8500_prcmu_probe() to the function
    .init.text:fw_project_name()
    The function db8500_prcmu_probe() references
    the function __init fw_project_name().
    This is often because db8500_prcmu_probe lacks a __init
    annotation or the annotation of fw_project_name is wrong.

    db8500_prcmu_probe should not be marked as __init so remove the __init
    annotation from fw_project_name and init_prcm_registers.

    Signed-off-by: Nathan Chancellor
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Nathan Chancellor
     
  • [ Upstream commit 8838555089f0345b87f4277fe5a8dd647dc65589 ]

    When building the kernel with Clang, the following section mismatch
    warning appears:

    WARNING: vmlinux.o(.text+0x3d84a3b): Section mismatch in reference from
    the function twl_probe() to the function
    .init.text:unprotect_pm_master()
    The function twl_probe() references
    the function __init unprotect_pm_master().
    This is often because twl_probe lacks a __init
    annotation or the annotation of unprotect_pm_master is wrong.

    Remove the __init annotation on the *protect_pm_master functions so
    there is no more mismatch.

    Signed-off-by: Nathan Chancellor
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Nathan Chancellor
     
  • [ Upstream commit b40ee006fe6a8a25093434e5d394128c356a48f3 ]

    Use PLATFORM_DEVID_AUTO to number mfd cells while registering, so that
    different instances are uniquely identified. This is required in order
    to support registering of multiple instances of same ti_am335x_tscadc IP.

    Signed-off-by: Vignesh R
    Signed-off-by: Lee Jones
    Signed-off-by: Sasha Levin

    Vignesh R
     

23 Jan, 2019

1 commit

  • commit ac4ca4b9f4623ba5e1ea7a582f286567c611e027 upstream.

    The tps6586x driver creates an irqchip that is used by its various child
    devices for managing interrupts. The tps6586x-rtc device is one of its
    children that uses the tps6586x irqchip. When using the tps6586x-rtc as
    a wake-up device from suspend, the following is seen:

    PM: Syncing filesystems ... done.
    Freezing user space processes ... (elapsed 0.001 seconds) done.
    OOM killer disabled.
    Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
    Disabling non-boot CPUs ...
    Entering suspend state LP1
    Enabling non-boot CPUs ...
    CPU1 is up
    tps6586x 3-0034: failed to read interrupt status
    tps6586x 3-0034: failed to read interrupt status

    The reason why the tps6586x interrupt status cannot be read is because
    the tps6586x interrupt is not masked during suspend and when the
    tps6586x-rtc interrupt occurs, to wake-up the device, the interrupt is
    seen before the i2c controller has been resumed in order to read the
    tps6586x interrupt status.

    The tps6586x-rtc driver sets it's interrupt as a wake-up source during
    suspend, which gets propagated to the parent tps6586x interrupt.
    However, the tps6586x-rtc driver cannot disable it's interrupt during
    suspend otherwise we would never be woken up and so the tps6586x must
    disable it's interrupt instead.

    Prevent the tps6586x interrupt handler from executing on exiting suspend
    before the i2c controller has been resumed by disabling the tps6586x
    interrupt on entering suspend and re-enabling it on resuming from
    suspend.

    Cc: stable@vger.kernel.org
    Signed-off-by: Jon Hunter
    Reviewed-by: Dmitry Osipenko
    Tested-by: Dmitry Osipenko
    Acked-by: Thierry Reding
    Signed-off-by: Lee Jones
    Signed-off-by: Greg Kroah-Hartman

    Jonathan Hunter
     

13 Dec, 2018

1 commit

  • commit 48a2ca0ee3994df53da230c7079a18a70ec914f9 upstream.

    This reverts commit 3aa2177e47878f7e7616da8a2050c44f22301b6e.

    That commit triggered a new WARN when unloading the module (see at the
    end of the commit message). When a class_dev is embedded in a structure
    then that class_dev is the thing that controls the lifetime of that
    structure, for that reason device managed allocations can't be used here.
    See Documentation/kobject.txt.

    Revert the above patch, so the struct is allocated using kzalloc and we
    have a release function for it that frees the allocated memory, otherwise
    it is broken.

    ------------[ cut here ]------------
    Device 'cros_ec' does not have a release() function, it is broken and must be fixed.
    WARNING: CPU: 3 PID: 3675 at drivers/base/core.c:895 device_release+0x80/0x90
    Modules linked in: btusb btrtl btintel btbcm bluetooth ...
    CPU: 3 PID: 3675 Comm: rmmod Not tainted 4.20.0-rc4 #76
    Hardware name: Google Kevin (DT)
    pstate: 40000005 (nZcv daif -PAN -UAO)
    pc : device_release+0x80/0x90
    lr : device_release+0x80/0x90
    sp : ffff00000c47bc70
    x29: ffff00000c47bc70 x28: ffff8000e86b0d40
    x27: 0000000000000000 x26: 0000000000000000
    x25: 0000000056000000 x24: 0000000000000015
    x23: ffff8000f0bbf860 x22: ffff000000d320a0
    x21: ffff8000ee93e100 x20: ffff8000ed931428
    x19: ffff8000ed931418 x18: 0000000000000020
    x17: 0000000000000000 x16: 0000000000000000
    x15: 0000000000000400 x14: 0000000000000143
    x13: 0000000000000000 x12: 0000000000000400
    x11: 0000000000000157 x10: 0000000000000960
    x9 : ffff00000c47b9b0 x8 : ffff8000e86b1700
    x7 : 0000000000000000 x6 : ffff8000f7d520b8
    x5 : ffff8000f7d520b8 x4 : 0000000000000000
    x3 : ffff8000f7d58e68 x2 : ffff8000e86b0d40
    x1 : 37d859939c964800 x0 : 0000000000000000
    Call trace:
    device_release+0x80/0x90
    kobject_put+0x74/0xe8
    device_unregister+0x20/0x30
    ec_device_remove+0x34/0x48 [cros_ec_dev]
    platform_drv_remove+0x28/0x48
    device_release_driver_internal+0x1a8/0x240
    driver_detach+0x40/0x80
    bus_remove_driver+0x54/0xa8
    driver_unregister+0x2c/0x58
    platform_driver_unregister+0x10/0x18
    cros_ec_dev_exit+0x1c/0x2d8 [cros_ec_dev]
    __arm64_sys_delete_module+0x16c/0x1f8
    el0_svc_common+0x84/0xd8
    el0_svc_handler+0x2c/0x80
    el0_svc+0x8/0xc
    ---[ end trace a57c4625f3c60ae8 ]---

    Cc: stable@vger.kernel.org
    Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
    Signed-off-by: Enric Balletbo i Serra
    Reviewed-by: Guenter Roeck
    Reviewed-by: Dmitry Torokhov
    Signed-off-by: Lee Jones
    Signed-off-by: Greg Kroah-Hartman

    Enric Balletbo i Serra