Skip to content

clocksource: davinci-timer: new driver

Bartosz Golaszewski linux-arm-kernel lkml 10 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 0 repliesNew
  2. v4 posting 2/211 patches 10 repliesSuperseded
  3. v3 posting 2/211 patches 11 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v4 posting 1/237 patches19 repliesSuperseded
v3 posting 1/237 patches5 repliesSuperseded
v2 posting 4/433 patches15 repliesSuperseded
v2 posting 3/433 patches4 repliesSuperseded
v2 posting 2/433 patches0 repliesSuperseded
v2 posting 1/412 patches18 repliesSuperseded
v135 patches62 repliesSuperseded

v1 -> v2 from the cover letter

- changed the format of the copyright notice
- removed all mentiones of the periodic timer setting
- added caching of the TCR register value so that its updating doesn't require a read
- split the timer configuration for clock events into the set_state_oneshot() and set_state_shutdown() callbacks

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2clocksource: davinci-timer: add support for clockeventsdrivers/clocksource/Kconfig drivers/clocksource/Makefile drivers/clocksource/timer-davinci.c +1 more+334 -00 replies
2/2clocksource: timer-davinci: add support for clocksourcedrivers/clocksource/timer-davinci.c+85 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH v8 0/2] clocksource: davinci-timer: new driver

From: Bartosz Golaszewski <[email protected]>

Now that we have an agreement on the driver and only minor issues are left to fix, I'm dropping the RFC tag and continuing the numbering from before RFCs.

This is the davinci clocksource driver but it with a sparse warning fixed and with a small tweak to kzalloc() call.

RFC history:

v1 -> v2:
- changed the format of the copyright notice
- removed all mentiones of the periodic timer setting
- added caching of the TCR register value so that its updating doesn't require a read
- split the timer configuration for clock events into the set_state_oneshot() and set_state_shutdown() callbacks

v2 -> v3:
- tim34, if used, should run in periodic mode for clocksource, now fixed
- dropped all the configuration variables from struct davinci_clockevent as clockevent always uses tim12
- dropped caching of the TCR register with the following reasoning: on systems using tim34 for clocksource, the TCR register is only touched by the clock driver and we know that we need to keep tim34 in periodic mode; on da830 the RTOS running on the DSP may modify the TCR register but we on the other hand never change its settings when only using tim12
- subsequently the whole routine for TCR updating was dropped
- dropped the shift variable from most places
- added separate routines for initializing clocksource for da830 and all other systems
- sprinkled a bunch of comments all over the driver to explain things that caused confusion before

Changes since last RFC:

- fixed the following sparse warning:

Quoted 3 lines
Quoted 3 lines

drivers/clocksource/timer-davinci.c:198:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] <asn:2> *base @@ got oderef] <asn:2> *base @@
drivers/clocksource/timer-davinci.c:198:14: sparse: expected void [noderef] <asn:2> *base
drivers/clocksource/timer-davinci.c:198:14: sparse: got struct resource *

- added the __GFP_NOFAIL flag to kzalloc() call so that we don't get warnings about not freeing the memory later

Bartosz Golaszewski (2):
clocksource: davinci-timer: add support for clockevents
clocksource: timer-davinci: add support for clocksource

 drivers/clocksource/Kconfig         |   5 +
 drivers/clocksource/Makefile        |   1 +
 drivers/clocksource/timer-davinci.c | 369 ++++++++++++++++++++++++++++
 include/clocksource/timer-davinci.h |  44 ++++
 4 files changed, 419 insertions(+)
 create mode 100644 drivers/clocksource/timer-davinci.c
 create mode 100644 include/clocksource/timer-davinci.h
Signature · 1 line
2.21.0