<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/arch/m68k/kernel/ints.c, branch v6.9-rc4</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v6.9-rc4</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v6.9-rc4'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2023-10-06T08:03:01+00:00</updated>
<entry>
<title>m68k: kernel: Add and use "ints.h"</title>
<updated>2023-10-06T08:03:01+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2023-09-13T14:07:55+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ef69fb4dce17c1e19bef7ba1b34fa37115171fee'/>
<id>urn:sha1:ef69fb4dce17c1e19bef7ba1b34fa37115171fee</id>
<content type='text'>
When building with W=1:

    arch/m68k/kernel/ints.c:165:17: warning: no previous prototype for ‘handle_badint’ [-Wmissing-prototypes]
      165 | asmlinkage void handle_badint(struct pt_regs *regs)
	  |                 ^~~~~~~~~~~~~

Fix this by introducing a new header file "ints.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/ints.c.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/dc65d01ca4c7de94ce814e5b5e1f726fff97566b.1694613528.git.geert@linux-m68k.org
</content>
</entry>
<entry>
<title>m68k: Do not rely on magic indirect includes</title>
<updated>2014-03-05T12:28:32+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2014-03-05T12:28:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=abcfc543bec803a53c5bd2925d3293df4ede84b0'/>
<id>urn:sha1:abcfc543bec803a53c5bd2925d3293df4ede84b0</id>
<content type='text'>
commit: 8f945a33 (genirq: Move kstat_incr_irqs_this_cpu() to core)
unearthed the following:

arch/m68k/kernel/ints.c:34:15: error: variable 'auto_irq_chip' has initializer but incomplete type
arch/m68k/kernel/ints.c:35:2: error: unknown field 'name' specified in initializer
arch/m68k/kernel/ints.c:35:2: warning: excess elements in struct initializer [enabled by default]

The reason is that this file requires linux/irq.h and magically
pulled that in via linux/kernel_stat.h

The commit above got rid of the pointless include of linux/irq.h in
linux/kernel_stat.h and therefor broke the build.

Include linux/irq.h

Reported-by: fengguang.wu@intel.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>m68k: Simplify low level interrupt handling code</title>
<updated>2013-11-13T19:21:46+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-11-11T20:01:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=09f90f6685cd88b6b904c141035d096169958cc4'/>
<id>urn:sha1:09f90f6685cd88b6b904c141035d096169958cc4</id>
<content type='text'>
The low level interrupt entry code of m68k contains the following:

    add_preempt_count(HARDIRQ_OFFSET);

    do_IRQ();
	irq_enter();
	    add_preempt_count(HARDIRQ_OFFSET);
	handle_interrupt();    
	irq_exit();    
	    sub_preempt_count(HARDIRQ_OFFSET);
	    if (in_interrupt())
       	       return; &lt;---- On m68k always taken!
	    if (local_softirq_pending())
       	       do_softirq();

    sub_preempt_count(HARDIRQ_OFFSET);
    if (in_hardirq())
       return;
    if (status_on_stack_has_interrupt_priority_mask &gt; 0)
       return;
    if (local_softirq_pending())
       do_softirq();

    ret_from_exception:
	if (interrupted_context_is_kernel)
	   return:
	....

I tried to find a proper explanation for this, but the changelog is
sparse and there are no mails explaining it further. But obviously
this relates to the interrupt priority levels of the m68k and tries to
be extra clever with nested interrupts. Though this cleverness just
adds code bloat to the interrupt hotpath.

For the common case of non nested interrupts the code runs through two
extra conditionals to the only important one, which checks whether the
return is to kernel or user space.

For the nested case the checks for in_hardirq() and the priority mask
value on stack catch only the case where the nested interrupt happens
inside the hard irq context of the first interrupt. If the nested
interrupt happens while the first interrupt handles soft interrupts,
then these extra checks buy nothing. The nested interrupt will fall
through to the final kernel/user space return check at
ret_from_exception.

Changing the code flow in the following way:

    do_IRQ();
	irq_enter();
	    add_preempt_count(HARDIRQ_OFFSET);
	handle_interrupt();    
	irq_exit();    
	    sub_preempt_count(HARDIRQ_OFFSET);
	    if (in_interrupt())
       	       return;
	    if (local_softirq_pending())
       	       do_softirq();

    ret_from_exception:
	if (interrupted_context_is_kernel)
	   return:

makes the region protected by the hardirq count slightly smaller and
the softirq handling is invoked with a minimal deeper stack. But
otherwise it's completely functional equivalent and saves 104 bytes of
text in arch/m68k/kernel/entry.o.

This modification allows us further to get rid of the limitations
which m68k puts on the preempt_count layout, so we can make the
preempt count bits completely generic.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Michael Schmitz &lt;schmitz@biophys.uni-duesseldorf.de&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Linux/m68k &lt;linux-m68k@vger.kernel.org&gt;
Cc: Andreas Schwab &lt;schwab@linux-m68k.org&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1311112052360.30673@ionos.tec.linutronix.de
</content>
</entry>
<entry>
<title>m68k/irq: Vector ints need a valid interrupt handler</title>
<updated>2013-06-24T17:44:19+00:00</updated>
<author>
<name>Thomas Bogendoerfer</name>
<email>tsbogend@alpha.franken.de</email>
</author>
<published>2013-06-03T10:53:01+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=378f7ca6aa2269519b825246e63f81f95f10a63b'/>
<id>urn:sha1:378f7ca6aa2269519b825246e63f81f95f10a63b</id>
<content type='text'>
To get vectored interrupts working we need to switch from the default
handler handle_bad_irq() to something more sensible. Tested on a MVME177
board.

Signed-off-by: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt;
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>Disintegrate asm/system.h for M68K</title>
<updated>2012-03-28T17:30:02+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2012-03-28T17:30:02+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=803f69144f0d48863c68f9d111b56849c7cef5bb'/>
<id>urn:sha1:803f69144f0d48863c68f9d111b56849c7cef5bb</id>
<content type='text'>
Disintegrate asm/system.h for M68K.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Greg Ungerer &lt;gerg@uclinux.org&gt;
cc: linux-m68k@lists.linux-m68k.org
</content>
</entry>
<entry>
<title>m68k/irq: Remove obsolete support for user vector interrupt fixups</title>
<updated>2011-11-08T21:35:52+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-09-11T09:54:50+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f30a6484f1bcb410d0af0c24f34b8e3d92682a05'/>
<id>urn:sha1:f30a6484f1bcb410d0af0c24f34b8e3d92682a05</id>
<content type='text'>
It was used on Apollo only, before its conversion to genirq.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>m68k/irq: Remove obsolete m68k irq framework</title>
<updated>2011-11-08T21:35:52+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-09-11T09:28:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d890d73995257b4e10cdd7d55bad80e34a71ba22'/>
<id>urn:sha1:d890d73995257b4e10cdd7d55bad80e34a71ba22</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>m68k/irq: Add genirq support</title>
<updated>2011-11-08T21:35:49+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-04-21T20:50:52+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4936f63cb790e265eb30a1e1630bb90bd6af0e7a'/>
<id>urn:sha1:4936f63cb790e265eb30a1e1630bb90bd6af0e7a</id>
<content type='text'>
Disabled on all platforms for now

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
[v1] Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>m68k/irq: Remove obsolete IRQ_FLG_* users</title>
<updated>2011-11-08T21:35:48+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-07-13T20:33:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5a2394534b160ce18f9a705cf9de40e77648f8a2'/>
<id>urn:sha1:5a2394534b160ce18f9a705cf9de40e77648f8a2</id>
<content type='text'>
The m68k core irq code stopped honoring these flags during the irq
restructuring in 2006.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>m68k/irq: Rename {,__}m68k_handle_int()</title>
<updated>2011-11-08T21:35:48+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-07-01T18:39:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1425df87c25b15400c9f26d57821bcfe01286b2a'/>
<id>urn:sha1:1425df87c25b15400c9f26d57821bcfe01286b2a</id>
<content type='text'>
  - Rename m68k_handle_int() to generic_handle_irq(), and drop the unneeded
    asmlinkage,
  - Rename __m68k_handle_int() to do_IRQ().

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
</feed>
