<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/next/linux-next.git/drivers/counter/microchip-tcb-capture.c, branch master</title>
<subtitle>The linux-next integration testing tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/'/>
<updated>2026-08-02T12:41:51+00:00</updated>
<entry>
<title>counter: microchip-tcb-capture: Fix DT channel validation</title>
<updated>2026-08-02T12:41:51+00:00</updated>
<author>
<name>Babanpreet Singh</name>
<email>bbnpreetsingh@gmail.com</email>
</author>
<published>2026-07-14T04:29:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f1a3a9946aab611dd2200c01ff122f64b033dad2'/>
<id>urn:sha1:f1a3a9946aab611dd2200c01ff122f64b033dad2</id>
<content type='text'>
mchp_tc_probe() reads the devicetree "reg" cell - a u32, per the API
contract of of_property_read_u32_index() - into a signed int, so the
bounds check "channel &gt; 2" fails to reject cell values at or above
0x80000000: reinterpreted as a negative int, they compare below 2 and
pass validation.

A malformed devicetree can therefore drive a negative channel into the
ATMEL_TC_REG() offset arithmetic, making the driver access syscon
regmap offsets outside the TC block's register window, and into the
"t%d_clk" clock-name formatting, where it truncates clk_name (sized
for "t0_clk".."t2_clk").

Declare channel as u32, matching the API contract; the unsigned
comparison then rejects everything except channels 0..2. Adjust the
format specifier to %u accordingly, which also resolves the W=1
warning that exposed the gap:

  microchip-tcb-capture.c:520:56: warning: '%d' directive output may
    be truncated writing between 1 and 11 bytes into a region of size
    6 [-Wformat-truncation=]
  note: directive argument in the range [-2147483648, 2]

No behavior change for well-formed devicetrees: channels 0..2 take
identical paths before and after.

Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
Assisted-by: Claude:claude-fable-5 [gcc W=1]
Signed-off-by: Babanpreet Singh &lt;bbnpreetsingh@gmail.com&gt;
Reviewed-by: Joshua Crofts &lt;joshua.crofts1@gmail.com&gt;
Link: https://lore.kernel.org/r/20260714042910.7-1-bbnpreetsingh@gmail.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Allow shared IRQ for multi-channel TCBs</title>
<updated>2025-10-13T05:56:30+00:00</updated>
<author>
<name>Dharma Balasubiramani</name>
<email>dharma.b@microchip.com</email>
</author>
<published>2025-10-06T10:51:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=109ff654934a4752f8875ded672efd1fbfe4d31d'/>
<id>urn:sha1:109ff654934a4752f8875ded672efd1fbfe4d31d</id>
<content type='text'>
Mark the interrupt as IRQF_SHARED to permit multiple counter channels to
share the same TCB IRQ line.

Each Timer/Counter Block (TCB) instance shares a single IRQ line among its
three internal channels. When multiple counter channels (e.g., counter@0
and counter@1) within the same TCB are enabled, the second call to
devm_request_irq() fails because the IRQ line is already requested by the
first channel.

Cc: stable@vger.kernel.org
Fixes: e5d581396821 ("counter: microchip-tcb-capture: Add IRQ handling")
Signed-off-by: Dharma Balasubiramani &lt;dharma.b@microchip.com&gt;
Reviewed-by: Kamel Bouhara &lt;kamel.bouhara@bootlin.com&gt;
Reviewed-by: Bence Csókás &lt;bence98@sch.bme.hu&gt;
Link: https://lore.kernel.org/r/20251006-microchip-tcb-v1-1-09c19181bb4a@microchip.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Add watch validation support</title>
<updated>2025-05-22T09:40:19+00:00</updated>
<author>
<name>Dharma Balasubiramani</name>
<email>dharma.b@microchip.com</email>
</author>
<published>2025-05-20T15:21:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ae3392c0f12f179b969ce17856ed18bf8d69a35e'/>
<id>urn:sha1:ae3392c0f12f179b969ce17856ed18bf8d69a35e</id>
<content type='text'>
The Timer Counter Block (TCB) exposes several kinds of events to the
Counter framework, but not every event is meaningful on every hardware
channel. Add a `watch_validate()` callback so userspace may register only
the combinations actually supported:

* Channel 0 (COUNTER_MCHP_EVCHN_CV, COUNTER_MCHP_EVCHN_RA)
   - COUNTER_EVENT_CAPTURE
   - COUNTER_EVENT_CHANGE_OF_STATE
   - COUNTER_EVENT_OVERFLOW

* Channel 1 (COUNTER_MCHP_EVCHN_RB)
   - COUNTER_EVENT_CAPTURE

* Channel 2 (COUNTER_MCHP_EVCHN_RC)
   - COUNTER_EVENT_THRESHOLD

Any other request is rejected with `-EINVAL`.

Signed-off-by: Dharma Balasubiramani &lt;dharma.b@microchip.com&gt;
Link: https://lore.kernel.org/r/20250520-counter-tcb-v3-1-4631e2aff7ed@microchip.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'char-misc-6.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc</title>
<updated>2025-04-03T01:03:34+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-04-03T01:03:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a0935e4ca3e1f2d5176a5b60bf6092cd7eba9914'/>
<id>urn:sha1:a0935e4ca3e1f2d5176a5b60bf6092cd7eba9914</id>
<content type='text'>
Pull char/misc fixes from Greg KH:
 "Here are two counter driver fixes that I realized I never sent to you
  for 6.14-final.

  They have been in my for weeks, as well as linux-next, my fault for
  not sending them earlier. They are:

   - bugfix for stm32-lptimer-cnt counter driver

   - bugfix for microchip-tcb-capture counter driver

  Again, these have been in linux-next for weeks with no reported
  issues"

* tag 'char-misc-6.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  counter: microchip-tcb-capture: Fix undefined counter channel state on probe
  counter: stm32-lptimer-cnt: fix error handling when enabling
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Add support for RC Compare</title>
<updated>2025-03-10T09:20:32+00:00</updated>
<author>
<name>William Breathitt Gray</name>
<email>wbg@kernel.org</email>
</author>
<published>2025-03-06T07:05:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ba27a0247b7187af36cb0b1fe7f7a68067ccb555'/>
<id>urn:sha1:ba27a0247b7187af36cb0b1fe7f7a68067ccb555</id>
<content type='text'>
In Capture mode, the RC register serves as a compare register for the
Timer Counter Channel. When a the Counter Value reaches the RC value, a
RC Compare event occurs (COUNTER_EVENT_THRESHOLD). This patch exposes
the RC register to userspace as the 'compare' Count extension, thus
allowing users to configure the threshold condition for these events.

Acked-by: Bence Csókás &lt;csokas.bence@prolan.hu&gt;
Link: https://lore.kernel.org/r/20250306-introduce-compare-component-v1-2-93993b3dca9c@kernel.org
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Add capture extensions for registers RA/RB</title>
<updated>2025-03-07T23:57:18+00:00</updated>
<author>
<name>Bence Csókás</name>
<email>csokas.bence@prolan.hu</email>
</author>
<published>2025-03-06T13:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=1adc6240a80278c613f655b71c6c0d447b2d5932'/>
<id>urn:sha1:1adc6240a80278c613f655b71c6c0d447b2d5932</id>
<content type='text'>
TCB hardware is capable of capturing the timer value to registers RA and
RB. Add these registers as capture extensions.

Signed-off-by: Bence Csókás &lt;csokas.bence@prolan.hu&gt;
Link: https://lore.kernel.org/r/20250306134441.582819-3-csokas.bence@prolan.hu
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Add IRQ handling</title>
<updated>2025-03-07T23:57:02+00:00</updated>
<author>
<name>Bence Csókás</name>
<email>csokas.bence@prolan.hu</email>
</author>
<published>2025-03-06T13:44:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e5d5813968217b99ef2b83f13353967b218e3841'/>
<id>urn:sha1:e5d5813968217b99ef2b83f13353967b218e3841</id>
<content type='text'>
Add interrupt servicing to allow userspace to wait for the following:
* Change-of-state caused by external trigger
* Capture of timer value into RA/RB
* Compare to RC register
* Overflow

Signed-off-by: Bence Csókás &lt;csokas.bence@prolan.hu&gt;
Link: https://lore.kernel.org/r/20250306134441.582819-2-csokas.bence@prolan.hu
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>counter: microchip-tcb-capture: Fix undefined counter channel state on probe</title>
<updated>2025-03-06T14:04:50+00:00</updated>
<author>
<name>William Breathitt Gray</name>
<email>wbg@kernel.org</email>
</author>
<published>2025-03-05T10:01:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c0c9c73434666dc99ee156b25e7e722150bee001'/>
<id>urn:sha1:c0c9c73434666dc99ee156b25e7e722150bee001</id>
<content type='text'>
Hardware initialize of the timer counter channel does not occur on probe
thus leaving the Count in an undefined state until the first
function_write() callback is executed. Fix this by performing the proper
hardware initialization during probe.

Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
Reported-by: Csókás Bence &lt;csokas.bence@prolan.hu&gt;
Closes: https://lore.kernel.org/all/bfa70e78-3cc3-4295-820b-3925c26135cb@prolan.hu/
Link: https://lore.kernel.org/r/20250305-preset-capture-mode-microchip-tcb-capture-v1-1-632c95c6421e@kernel.org
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
</entry>
<entry>
<title>module: Convert symbol namespace to string literal</title>
<updated>2024-12-02T19:34:44+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2024-12-02T14:59:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cdd30ebb1b9f36159d66f088b61aee264e649d7a'/>
<id>urn:sha1:cdd30ebb1b9f36159d66f088b61aee264e649d7a</id>
<content type='text'>
Clean up the existing export namespace code along the same lines of
commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.

Scripted using

  git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
  do
    awk -i inplace '
      /^#define EXPORT_SYMBOL_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /^#define MODULE_IMPORT_NS/ {
        gsub(/__stringify\(ns\)/, "ns");
        print;
        next;
      }
      /MODULE_IMPORT_NS/ {
        $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
      }
      /EXPORT_SYMBOL_NS/ {
        if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
  	if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &amp;&amp;
  	    $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &amp;&amp;
  	    $0 !~ /^my/) {
  	  getline line;
  	  gsub(/[[:space:]]*\\$/, "");
  	  gsub(/[[:space:]]/, "", line);
  	  $0 = $0 " " line;
  	}

  	$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
  		    "\\1(\\2, \"\\3\")", "g");
        }
      }
      { print }' $file;
  done

Requested-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'counter-fixes-for-6.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus</title>
<updated>2023-10-02T11:13:15+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-10-02T11:13:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5d164a022b99f29bfa04c725fba00cab97d6b640'/>
<id>urn:sha1:5d164a022b99f29bfa04c725fba00cab97d6b640</id>
<content type='text'>
William writes:

First set of Counter fixes for 6.6

The counter_get_ext() function would incorrectly refer to the first
element of the extensions array to handle component array extensions
when they are located at a different index; a fix is provided to index
to the correct element in the array for this case. A fix for the
microchip-tcb-capture is provided as well to correct an inverted
internal GCLK logic for clock selection.

* tag 'counter-fixes-for-6.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
  counter: microchip-tcb-capture: Fix the use of internal GCLK logic
  counter: chrdev: fix getting array extensions
</content>
</entry>
</feed>
