08 Oct, 2020

1 commit

  • * tag 'v5.4.70': (3051 commits)
    Linux 5.4.70
    netfilter: ctnetlink: add a range check for l3/l4 protonum
    ep_create_wakeup_source(): dentry name can change under you...
    ...

    Conflicts:
    arch/arm/mach-imx/pm-imx6.c
    arch/arm64/boot/dts/freescale/imx8mm-evk.dts
    arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
    drivers/crypto/caam/caamalg.c
    drivers/gpu/drm/imx/dw_hdmi-imx.c
    drivers/gpu/drm/imx/imx-ldb.c
    drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/net/ethernet/freescale/enetc/enetc.c
    drivers/net/ethernet/freescale/enetc/enetc_pf.c
    drivers/thermal/imx_thermal.c
    drivers/usb/cdns3/ep0.c
    drivers/xen/swiotlb-xen.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c

    Signed-off-by: Jason Liu

    Jason Liu
     

21 Aug, 2020

1 commit

  • [ Upstream commit 6ced5ff0be8e94871ba846dfbddf69d21363f3d7 ]

    Handle clk_get_rate() returning 0 to avoid possible division by zero.

    Fixes: daa5abc41c80 ("pwm: Add support for Broadcom iProc PWM controller")
    Signed-off-by: Rayagonda Kokatanur
    Signed-off-by: Scott Branden
    Reviewed-by: Ray Jui
    Reviewed-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Rayagonda Kokatanur
     

16 Jul, 2020

1 commit

  • When commit 9017dc4fbd59 ("pwm: jz4740: Enhance precision in calculation
    of duty cycle") from v5.8-rc1 was backported to v5.4.x its dependency on
    commit ce1f9cece057 ("pwm: jz4740: Use clocks from TCU driver") was not
    noticed which made the pwm-jz4740 driver fail to build.

    As ce1f9cece057 depends on still more rework, just backport a small part
    of this commit to make the driver build again. (There is no dependency
    on the functionality introduced in ce1f9cece057, just the rate variable
    is needed.)

    Signed-off-by: Uwe Kleine-König
    Reported-by: H. Nikolaus Schaller
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     

24 Jun, 2020

2 commits

  • commit 9017dc4fbd59c09463019ce494cfe36d654495a8 upstream.

    Calculating the hardware value for the duty from the hardware value of
    the period resulted in a precision loss versus calculating it from the
    clock rate directly.

    (Also remove a cast that doesn't really need to be here)

    Fixes: f6b8a5700057 ("pwm: Add Ingenic JZ4740 support")
    Cc:
    Suggested-by: Uwe Kleine-König
    Reviewed-by: Uwe Kleine-König
    Signed-off-by: Paul Cercueil
    Signed-off-by: Thierry Reding
    [ukl: backport to v5.4.y and adapt commit log accordingly]
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Greg Kroah-Hartman

    Paul Cercueil
     
  • [ Upstream commit ca162ce98110b98e7d97b7157328d34dcfdd40a9 ]

    Even in failed case of pm_runtime_get_sync(), the usage_count is
    incremented. In order to keep the usage_count with correct value call
    appropriate pm_runtime_put().

    Signed-off-by: Navid Emamdoost
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Navid Emamdoost
     

19 Jun, 2020

1 commit

  • * tag 'v5.4.47': (2193 commits)
    Linux 5.4.47
    KVM: arm64: Save the host's PtrAuth keys in non-preemptible context
    KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception
    ...

    Conflicts:
    arch/arm/boot/dts/imx6qdl.dtsi
    arch/arm/mach-imx/Kconfig
    arch/arm/mach-imx/common.h
    arch/arm/mach-imx/suspend-imx6.S
    arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
    arch/powerpc/include/asm/cacheflush.h
    drivers/cpufreq/imx6q-cpufreq.c
    drivers/dma/imx-sdma.c
    drivers/edac/synopsys_edac.c
    drivers/firmware/imx/imx-scu.c
    drivers/net/ethernet/freescale/fec.h
    drivers/net/ethernet/freescale/fec_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/phy_device.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/usb/cdns3/gadget.c
    drivers/usb/dwc3/gadget.c
    include/uapi/linux/dma-buf.h

    Signed-off-by: Jason Liu

    Jason Liu
     

29 Apr, 2020

3 commits

  • [ Upstream commit 2c25b07e5ec119cab609e41407a1fb3fa61442f5 ]

    The newer 2711 and 7211 chips have two PWM controllers and failure to
    dynamically allocate the PWM base would prevent the second PWM
    controller instance being probed for succeeding with an -EEXIST error
    from alloc_pwms().

    Fixes: e5a06dc5ac1f ("pwm: Add BCM2835 PWM driver")
    Signed-off-by: Florian Fainelli
    Acked-by: Uwe Kleine-König
    Reviewed-by: Nicolas Saenz Julienne
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Florian Fainelli
     
  • [ Upstream commit d5a3c7a4536e1329a758e14340efd0e65252bd3d ]

    Runtime PM should be enabled before calling pwmchip_add(), as PWM users
    can appear immediately after the PWM chip has been added.
    Likewise, Runtime PM should always be disabled after the removal of the
    PWM chip, even if the latter failed.

    Fixes: 99b82abb0a35b073 ("pwm: Add Renesas TPU PWM driver")
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     
  • [ Upstream commit 1451a3eed24b5fd6a604683f0b6995e0e7e16c79 ]

    Runtime PM should be enabled before calling pwmchip_add(), as PWM users
    can appear immediately after the PWM chip has been added.
    Likewise, Runtime PM should be disabled after the removal of the PWM
    chip.

    Fixes: ed6c1476bf7f16d5 ("pwm: Add support for R-Car PWM Timer")
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Uwe Kleine-König
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     

21 Apr, 2020

1 commit

  • commit 9cc5f232a4b6a0ef6e9b57876d61b88f61bdd7c2 upstream.

    This driver allows pwms to be requested as gpios via gpiolib. Obviously,
    it should not be allowed to request a GPIO when its corresponding PWM is
    already requested (and vice versa). So it requires some exclusion code.

    Given that the PWMm and GPIO cores are not synchronized with respect to
    each other, this exclusion code will also require proper
    synchronization.

    Such a mechanism was in place, but was inadvertently removed by Uwe's
    clean-up in commit e926b12c611c ("pwm: Clear chip_data in pwm_put()").

    Upon revisiting the synchronization mechanism, we found that
    theoretically, it could allow two threads to successfully request
    conflicting PWMs/GPIOs.

    Replace with a bitmap which tracks PWMs in-use, plus a mutex. As long as
    PWM and GPIO's respective request/free functions modify the in-use
    bitmap while holding the mutex, proper synchronization will be
    guaranteed.

    Reported-by: YueHaibing
    Fixes: e926b12c611c ("pwm: Clear chip_data in pwm_put()")
    Cc: Mika Westerberg
    Cc: Uwe Kleine-König
    Cc: YueHaibing
    Link: https://lkml.org/lkml/2019/5/31/963
    Signed-off-by: Sven Van Asbroeck
    Reviewed-by: Mika Westerberg
    [cg: Tested on an i.MX6Q board with two NXP PCA9685 chips]
    Tested-by: Clemens Gruber
    Reviewed-by: Sven Van Asbroeck # cg's rebase
    Link: https://lore.kernel.org/lkml/20200330160238.GD2817345@ulmo/
    Signed-off-by: Thierry Reding
    Signed-off-by: Greg Kroah-Hartman

    Sven Van Asbroeck
     

08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

05 Mar, 2020

1 commit

  • commit c7cb3a1dd53f63c64fb2b567d0be130b92a44d91 upstream.

    This was found by coccicheck:

    drivers/pwm/pwm-omap-dmtimer.c:304:2-8: ERROR: missing put_device;
    call of_find_device_by_node on line 255, but without a corresponding
    object release within this function.

    Reported-by: Markus Elfring
    Fixes: 6604c6556db9 ("pwm: Add PWM driver for OMAP using dual-mode timers")
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     

24 Feb, 2020

3 commits

  • [ Upstream commit 9871abffc81048e20f02e15d6aa4558a44ad53ea ]

    Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/pwm/pwm-pca9685.c: In function ‘pca9685_pwm_gpio_free’:
    drivers/pwm/pwm-pca9685.c:162:21: warning: variable ‘pwm’ set but not used [-Wunused-but-set-variable]

    It is never used, and so can be removed. In that case, hold and release
    the lock 'pca->lock' can be removed since nothing will be done between
    them.

    Fixes: e926b12c611c ("pwm: Clear chip_data in pwm_put()")
    Signed-off-by: yu kuai
    Acked-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    yu kuai
     
  • [ Upstream commit 43efdc8f0e6d7088ec61bd55a73bf853f002d043 ]

    In the old code (e.g.) mutex_destroy() was called before
    pwmchip_remove(). Between these two calls it is possible that a PWM
    callback is used which tries to grab the mutex.

    Fixes: 6604c6556db9 ("pwm: Add PWM driver for OMAP using dual-mode timers")
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Uwe Kleine-König
     
  • [ Upstream commit c4cf7aa57eb83b108d2d9c6c37c143388fee2a4d ]

    Instead of doing error handling in the middle of ->probe(), move error
    handling and freeing the reference to timer to the end.

    This fixes a resource leak as dm_timer wasn't freed when allocating
    *omap failed.

    Implementation note: The put: label was never reached without a goto and
    ret being unequal to 0, so the removed return statement is fine.

    Fixes: 6604c6556db9 ("pwm: Add PWM driver for OMAP using dual-mode timers")
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Uwe Kleine-König
     

26 Jan, 2020

1 commit

  • [ Upstream commit 50cc7e3e4f26e3bf5ed74a8d061195c4d2161b8b ]

    Since 5.4-rc1, pwm_apply_state calls ->get_state after ->apply
    if available, and this revealed an issue with integer precision
    when calculating duty_cycle and period for the currently set
    state in ->get_state callback.

    This issue manifested in broken backlight on several Allwinner
    based devices.

    Previously this worked, because ->apply updated the passed state
    directly.

    Fixes: deb9c462f4e53 ("pwm: sun4i: Don't update the state for the caller of pwm_apply_state")
    Signed-off-by: Ondrej Jirman
    Acked-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    Signed-off-by: Sasha Levin

    Ondrej Jirman
     

30 Dec, 2019

1 commit


25 Nov, 2019

1 commit


09 Nov, 2019

1 commit


21 Oct, 2019

1 commit

  • It turns out that commit 01ccf903edd6 ("pwm: Let pwm_get_state() return
    the last implemented state") causes backlight failures on a number of
    boards. The reason is that some of the drivers do not write the full
    state through to the hardware registers, which means that ->get_state()
    subsequently does not return the correct state. Consumers which rely on
    pwm_get_state() returning the current state will therefore get confused
    and subsequently try to program a bad state.

    Before this change can be made, existing drivers need to be more
    carefully audited and fixed to behave as the framework expects. Until
    then, keep the original behaviour of returning the software state that
    was applied rather than reading the state back from hardware.

    Reviewed-by: Uwe Kleine-König
    Tested-by: Enric Balletbo i Serra
    Tested-by: Michal Vokáč
    Signed-off-by: Thierry Reding

    Thierry Reding
     

28 Sep, 2019

1 commit

  • …erry.reding/linux-pwm

    Pull pwm updates from Thierry Reding:
    "Besides one new driver being added for the PWM controller found in
    various Spreadtrum SoCs, this series of changes brings a slew of,
    mostly minor, fixes and cleanups for existing drivers, as well as some
    enhancements to the core code.

    Lastly, Uwe is added to the PWM subsystem entry of the MAINTAINERS
    file, making official his role as a reviewer"

    * tag 'pwm/for-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (34 commits)
    MAINTAINERS: Add myself as reviewer for the PWM subsystem
    MAINTAINERS: Add patchwork link for PWM entry
    MAINTAINERS: Add a selection of PWM related keywords to the PWM entry
    pwm: mediatek: Add MT7629 compatible string
    dt-bindings: pwm: Update bindings for MT7629 SoC
    pwm: mediatek: Update license and switch to SPDX tag
    pwm: mediatek: Use pwm_mediatek as common prefix
    pwm: mediatek: Allocate the clks array dynamically
    pwm: mediatek: Remove the has_clks field
    pwm: mediatek: Drop the check for of_device_get_match_data()
    pwm: atmel: Consolidate driver data initialization
    pwm: atmel: Remove unneeded check for match data
    pwm: atmel: Remove platform_device_id and use only dt bindings
    pwm: stm32-lp: Add check in case requested period cannot be achieved
    pwm: Ensure pwm_apply_state() doesn't modify the state argument
    pwm: fsl-ftm: Don't update the state for the caller of pwm_apply_state()
    pwm: sun4i: Don't update the state for the caller of pwm_apply_state()
    pwm: rockchip: Don't update the state for the caller of pwm_apply_state()
    pwm: Let pwm_get_state() return the last implemented state
    pwm: Introduce local struct pwm_chip in pwm_apply_state()
    ...

    Linus Torvalds
     

26 Sep, 2019

1 commit


25 Sep, 2019

4 commits

  • Add SPDX identifiers to pwm-mediatek.c. Update MODULE_LICENSE to
    correctly reflect the GNU General Public License v2.0.

    Signed-off-by: Ryder Lee
    Signed-off-by: Sam Shih
    Reviewed-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding

    Sam Shih
     
  • Use pwm_mediatek as common prefix to match the filename. No functional
    change intended.

    Signed-off-by: Ryder Lee
    Signed-off-by: Sam Shih
    Acked-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding

    Sam Shih
     
  • Instead of using fixed size of arrays, allocate the memory for them
    based on the number of PWMs specified for each SoC generation.

    Signed-off-by: Ryder Lee
    Signed-off-by: Sam Shih
    Reviewed-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding

    Sam Shih
     
  • We can use fixed clocks to repair mt7628 PWM during configure from
    userspace. The SoC is legacy MIPS and has no complex clock tree. Because
    we can get the clock frequency for period calculation from fixed clocks
    specified in DT, we can remove the has_clock field, and directly use
    devm_clk_get() and clk_get_rate().

    Signed-off-by: Ryder Lee
    Signed-off-by: Sam Shih
    Acked-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding

    Sam Shih
     

21 Sep, 2019

14 commits