23 Jul, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Acked-by: Rob Herring
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200708165856.15322-1-grandmaster@al2klimov.de

    Alexander A. Klimov
     

23 May, 2020

1 commit

  • omap_dm_timer_prepare() is setting up the parent 32KHz clock. This
    prepare() gets called by request_timer in the client's driver. Because of
    this, the timer clock parent that is set with assigned-clock-parent is being
    overwritten. So drop this default setting of parent in prepare().

    Signed-off-by: Lokesh Vutla
    Reviewed-by: Suman Anna
    Acked-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200427172831.16546-1-lokeshvutla@ti.com

    Lokesh Vutla
     

16 Mar, 2020

7 commits

  • Daniel Lezcano
     
  • dm timer ops set_load() api allows to configure the load value and to
    set the auto reload feature. But auto reload feature is independent of
    load value and should be part of configuring pwm. This way pwm can be
    disabled by disabling auto reload feature using set_pwm() so that the
    current pwm cycle will be completed. Else pwm disabling causes the
    cycle to be stopped abruptly.

    Signed-off-by: Lokesh Vutla
    Acked-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200305082715.15861-7-lokeshvutla@ti.com

    Lokesh Vutla
     
  • omap_dm_timer_ops provide support to configure the pwm but there is no
    support to get the current status. For configuring pwm it is advised to
    check the current hw status instead of relying on pwm framework. So
    implement a new timer ops to get the current status of pwm.

    Signed-off-by: Lokesh Vutla
    Acked-by: Tony Lindgen
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200305082715.15861-6-lokeshvutla@ti.com

    Lokesh Vutla
     
  • Write to trigger register(OMAP_TIMER_TRIGGER_REG) will load the value
    in Load register(OMAP_TIMER_LOAD_REG) into Counter register
    (OMAP_TIMER_COUNTER_REG).

    omap_dm_timer_set_load() writes into trigger register every time load
    register is updated. When timer is configured in pwm mode, this causes
    disruption in current pwm cycle, which is not expected especially when
    pwm is used as PPS signal for synchronized PTP clocks. So do not write
    into trigger register on updating the period.

    Tested-by: Tony Lindgren
    Signed-off-by: Lokesh Vutla
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200305082715.15861-5-lokeshvutla@ti.com

    Lokesh Vutla
     
  • omap_dm_timer_enable() restores the entire context(including counter)
    based on 2 conditions:
    - If get_context_loss_count is populated and context is lost.
    - If get_context_loss_count is not populated update unconditionally.

    Case2 has a side effect of updating the counter register even though
    context is not lost. When timer is configured in pwm mode, this is
    causing undesired behaviour in the pwm period.

    Instead of using get_context_loss_count call back, implement cpu_pm
    notifier with context save and restore support. And delete the
    get_context_loss_count callback all together.

    Suggested-by: Tony Lindgren
    Signed-off-by: Lokesh Vutla
    [tony@atomide.com: removed pm_runtime calls from cpuidle calls]
    Signed-off-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200316111453.15441-1-lokeshvutla@ti.com

    Lokesh Vutla
     
  • Let's add runtime_suspend and resume functions and atomic enabled
    flag. This way we can use these when converting to use cpuidle
    for saving and restoring device context.

    And we need to maintain the driver state in the driver as documented
    in "9. Autosuspend, or automatically-delayed suspends" in the
    Documentation/power/runtime_pm.rst document related to using driver
    private lock and races with runtime_suspend().

    Signed-off-by: Tony Lindgren
    Signed-off-by: Lokesh Vutla
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200305082715.15861-3-lokeshvutla@ti.com

    Tony Lindgren
     
  • Use SPDX-License-Identifier instead of a verbose license text.

    Signed-off-by: Lokesh Vutla
    Acked-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200305082715.15861-2-lokeshvutla@ti.com

    Lokesh Vutla
     

27 Feb, 2020

2 commits

  • The function omap_dm_timer_of_set_source() was originally added in
    commit 31a7448f4fa8a ("ARM: OMAP: dmtimer: Add clock source from DT"),
    and is designed to set a clock source from DT using the clocks property
    of a timer node. This design choice is okay for clk provider nodes but
    otherwise is a bad design as typically the clocks property is used to
    specify the functional clocks for a device, and not its parents.

    The timer nodes now all define a timer functional clock after the
    conversion to ti-sysc and the new clkctrl layout, and this results
    in an attempt to set the same functional clock as its parent when a
    consumer driver attempts to acquire any of these timers in the
    omap_dm_timer_prepare() function. This was masked and worked around
    in commit 983a5a43ec25 ("clocksource: timer-ti-dm: Fix pwm dmtimer
    usage of fck reparenting"). Fix all of this by simply dropping the
    entire function.

    Any DT configuration of clock sources should be achieved using
    assigned-clocks and assigned-clock-parents properties provided
    by the Common Clock Framework.

    Cc: Tony Lindgren
    Cc: Tero Kristo
    Cc: Neil Armstrong
    Cc: H. Nikolaus Schaller
    Cc: Bartosz Golaszewski
    Cc: Keerthy
    Cc: Ladislav Michl
    Cc: Pavel Machek
    Cc: Sebastian Reichel
    Signed-off-by: Suman Anna
    Tested-by: Lokesh Vutla
    Tested-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200213053504.22638-1-s-anna@ti.com

    Suman Anna
     
  • Write to trigger register(OMAP_TIMER_TRIGGER_REG) will load the value
    in Load register(OMAP_TIMER_LOAD_REG) into Counter register
    (OMAP_TIMER_COUNTER_REG).

    omap_dm_timer_set_load() writes into trigger register every time load
    register is updated. When timer is configured in pwm mode, this causes
    disruption in current pwm cycle, which is not expected especially when
    pwm is used as PPS signal for synchronized PTP clocks. So do not write
    into trigger register on updating the period.

    Signed-off-by: Lokesh Vutla
    Tested-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200224050753.17784-3-lokeshvutla@ti.com

    Lokesh Vutla
     

17 Jan, 2020

3 commits

  • Clean-up commit 8c82723414d5 ("clocksource/drivers/timer-ti-dm: Switch to
    platform_get_irq") caused a regression where we now try to access
    uninitialized data for timer:

    drivers/clocksource/timer-ti-dm.c: In function 'omap_dm_timer_probe':
    drivers/clocksource/timer-ti-dm.c:798:13: warning: 'timer' may be used
    uninitialized in this function [-Wmaybe-uninitialized]

    On boot we now get:

    Unable to handle kernel NULL pointer dereference at virtual address
    00000004
    ...
    (omap_dm_timer_probe) from [] (platform_drv_probe+0x48/0x98)
    (platform_drv_probe) from [] (really_probe+0x1dc/0x348)
    (really_probe) from [] (driver_probe_device+0x5c/0x160)

    Let's fix the issue by moving platform_get_irq to happen after timer has
    been allocated.

    Fixes: bc83caddf17b ("clocksource/drivers/timer-ti-dm: Switch to platform_get_irq")
    Cc: Yangtao Li
    Signed-off-by: Tony Lindgren
    Acked-by: Olof Johansson
    Acked-by: Yangtao Li
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20200106203700.21009-1-tony@atomide.com

    Tony Lindgren
     
  • platform_get_resource(pdev, IORESOURCE_IRQ) is not recommended for
    requesting IRQ's resources, as they can be not ready yet. Using
    platform_get_irq() instead is preferred for getting IRQ even if it
    was not retrieved earlier.

    Signed-off-by: Yangtao Li
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20191221173027.30716-5-tiny.windzz@gmail.com

    Yangtao Li
     
  • Use devm_platform_ioremap_resource() to simplify code, which
    wraps 'platform_get_resource' and 'devm_ioremap_resource' in a
    single helper.

    Signed-off-by: Yangtao Li
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/20191221173027.30716-4-tiny.windzz@gmail.com

    Yangtao Li
     

24 May, 2019

1 commit


09 May, 2019

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - allow users to invoke 'make' out of the source tree

    - refactor scripts/mkmakefile

    - deprecate KBUILD_SRC, which was used to track the source tree
    location for O= build.

    - fix recordmcount.pl in case objdump output is localized

    - turn unresolved symbols in external modules to errors from warnings
    by default; pass KBUILD_MODPOST_WARN=1 to get them back to warnings

    - generate modules.builtin.modinfo to collect .modinfo data from
    built-in modules

    - misc Makefile cleanups

    * tag 'kbuild-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (21 commits)
    .gitignore: add more all*.config patterns
    moduleparam: Save information about built-in modules in separate file
    Remove MODULE_ALIAS() calls that take undefined macro
    .gitignore: add leading and trailing slashes to generated directories
    scripts/tags.sh: fix direct execution of scripts/tags.sh
    scripts: override locale from environment when running recordmcount.pl
    samples: kobject: allow CONFIG_SAMPLE_KOBJECT to become y
    samples: seccomp: turn CONFIG_SAMPLE_SECCOMP into a bool option
    kbuild: move Documentation to vmlinux-alldirs
    kbuild: move samples/ to KBUILD_VMLINUX_OBJS
    modpost: make KBUILD_MODPOST_WARN also configurable for external modules
    kbuild: check arch/$(SRCARCH)/include/generated before out-of-tree build
    kbuild: remove unneeded dependency for include/config/kernel.release
    memory: squash drivers/memory/Makefile.asm-offsets
    kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build
    kbuild: mkmakefile: generate a simple wrapper of top Makefile
    kbuild: mkmakefile: do not check the generated Makefile marker
    kbuild: allow Kbuild to start from any directory
    kbuild: pass $(MAKECMDGOALS) to sub-make as is
    kbuild: fix warning "overriding recipe for target 'Makefile'"
    ...

    Linus Torvalds
     

07 May, 2019

1 commit

  • These files do not define (USBHS_)DRIVER_NAME. Yet, they can be
    successfully compiled because they are never built as a module by
    anyone, i.e, the MODULE_ALIAS() calls are always no-op.

    A problem showed up when a patch "moduleparam: Save information about
    built-in modules in separate file" was applied. With this new feature,
    MODULE_*() will be populated even if the callers are built-in.

    To avoid the build errors, the lines referencing to the undefined
    macro must be removed.

    The complete fix is to remove all MODULE_* and #include
    like many "make ... explicitly non-modular" commits did.

    For now, I am touching only the offending lines.

    Reported-by: Stephen Rothwell
    Signed-off-by: Masahiro Yamada
    Acked-by: Daniel Lezcano
    Acked-by: Tony Lindgren

    Masahiro Yamada
     

16 Apr, 2019

1 commit

  • Commit 008258d995a6 ("clocksource/drivers/timer-ti-dm: Make
    omap_dm_timer_set_load_start() static") made omap_dm_time_set_load_start
    static because its prototype was not defined in a header. Unfortunately,
    this causes a build warning on multi_v7_defconfig because this function
    is not used anywhere in this translation unit:

    drivers/clocksource/timer-ti-dm.c:589:12: error: unused function
    'omap_dm_timer_set_load_start' [-Werror,-Wunused-function]

    In fact, omap_dm_timer_set_load_start hasn't been used anywhere since
    commit f190be7f39a5 ("staging: tidspbridge: remove driver") and the
    prototype was removed in commit 592ea6bd1fad ("clocksource: timer-ti-dm:
    Make unexported functions static"), which is probably where this should
    have happened.

    Fixes: 592ea6bd1fad ("clocksource: timer-ti-dm: Make unexported functions static")
    Fixes: 008258d995a6 ("clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static")
    Signed-off-by: Nathan Chancellor
    Acked-by: Tony Lindgren
    Signed-off-by: Daniel Lezcano

    Nathan Chancellor
     

23 Mar, 2019

1 commit


29 Jan, 2019

2 commits

  • Tony Lindgren
     
  • Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
    them with ti-sysc") started producing a warning for pwm-omap-dmtimer:

    WARNING: CPU: 0 PID: 77 at drivers/bus/omap_l3_noc.c:147
    l3_interrupt_handler+0x2f8/0x388
    44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4PER2 (Idle):
    Data Access in Supervisor mode during Functional access
    ...
    __pm_runtime_idle
    omap_dm_timer_disable
    pwm_omap_dmtimer_start
    pwm_omap_dmtimer_enable
    pwm_apply_state
    pwm_vibrator_start
    pwm_vibrator_play_work

    This is because the timer that pwm-omap-dmtimer is using is now being
    probed with ti-sysc interconnect target module instead of omap_device
    and the ti-sysc quirk for SYSC_QUIRK_LEGACY_IDLE is not fully
    compatible with what omap_device has been doing.

    We could fix this by reverting the timer changes and have the timer
    probe again with omap_device. Or we could add more quirk handling to
    ti-sysc driver. But as these options don't work nicely as longer term
    solutions, let's just make timers probe with ti-sysc without any
    quirks.

    To do this, all we need to do is remove quirks for timers for ti-sysc,
    and drop the bogus pm_runtime_irq_safe() flag for timer-ti-dm.

    We should not use pm_runtime_irq_safe() anyways for drivers as it will
    take a permanent use count on the parent device blocking the parent
    devices from idling and has been forcing ti-sysc driver to use a
    quirk flag.

    Note that we will move the timer data to DEBUG section later on in
    clean-up patches.

    Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc")
    Cc: Andy Shevchenko
    Cc: Bartosz Golaszewski
    Cc: Daniel Lezcano
    Cc: H. Nikolaus Schaller
    Cc: Keerthy
    Cc: Ladislav Michl
    Cc: Pavel Machek
    Cc: Sebastian Reichel
    Cc: Tero Kristo
    Cc: Thierry Reding
    Cc: Thomas Gleixner
    Reported-by: H. Nikolaus Schaller
    Tested-By: Andreas Kemnade
    Tested-By: H. Nikolaus Schaller
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     

23 Jan, 2019

1 commit

  • Commit 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe
    them with ti-sysc") moved some omap4 timers to probe with ti-sysc
    interconnect target module. Turns out this broke pwm-omap-dmtimer
    where we now try to reparent the clock to itself with the following:

    omap_dm_timer_of_set_source: failed to set parent

    With ti-sysc, we can now configure the clock sources in the dts
    with assigned-clocks and assigned-clock-parents. So we should be able
    to remove omap_dm_timer_of_set_source with clean-up patches later on.
    But for now, let's just fix it first by checking if parent and fck
    are the same and bail out of so.

    Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc")
    Cc: Bartosz Golaszewski
    Cc: Daniel Lezcano
    Cc: H. Nikolaus Schaller
    Cc: Keerthy
    Cc: Ladislav Michl
    Cc: Pavel Machek
    Cc: Sebastian Reichel
    Cc: Tero Kristo
    Cc: Thierry Reding
    Cc: Thomas Gleixner
    Reported-by: H. Nikolaus Schaller
    Tested-By: Andreas Kemnade
    Tested-By: H. Nikolaus Schaller
    Signed-off-by: Tony Lindgren

    Tony Lindgren
     

19 Dec, 2018

1 commit


01 Mar, 2018

3 commits


23 Feb, 2018

3 commits