public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq/chip: Fix the warn for non-SMP system
@ 2024-05-16 19:30 Mukesh Ojha
  2024-05-17  8:48 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mukesh Ojha @ 2024-05-16 19:30 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, Mukesh Ojha

__irq_startup_managed() for !SMP system returns IRQ_STARTUP_NORMAL
which may result in a WARNING during enablement of an irq i.e.,
starting a irq while it is not activated.

Fix this by appropriately returning IRQ_STARTUP_MANAGED.

[   11.129246] ------------[ cut here ]------------
[   11.133891] WARNING: CPU: 0 PID: 39 at kernel/irq/chip.c:243 irq_startup+0x87/0x88
[   11.146370] CPU: 0 PID: 39 Comm: kworker/0:5 Tainted: G   OE     5.15.123-perf-gc692140b4d58-dirty #1
[   11.156289] Hardware name: Generic DT based system
[   11.161081] Workqueue: pm pm_runtime_work
[   11.165112] (unwind_backtrace) from [<c0108c37>] (show_stack+0xb/0xc)
[   11.172695] (show_stack) from [<c01154d5>] (__warn+0x8d/0x8e)
[   11.179581] (__warn) from [<c0115525>] (warn_slowpath_fmt+0x4f/0x68)
[   11.187063] (warn_slowpath_fmt) from [<c0146d89>] (irq_startup+0x87/0x88)
[   11.194992] (irq_startup) from [<c0144969>] (enable_irq+0x31/0x70)
[   11.202313] (enable_irq) from [<c05726bb>]

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 kernel/irq/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index dc94e0bf2c94..a243f5ce786c 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -228,7 +228,7 @@ static __always_inline int
 __irq_startup_managed(struct irq_desc *desc, const struct cpumask *aff,
 		      bool force)
 {
-	return IRQ_STARTUP_NORMAL;
+	return IRQ_STARTUP_MANAGED;
 }
 #endif
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] genirq/chip: Fix the warn for non-SMP system
  2024-05-16 19:30 [PATCH] genirq/chip: Fix the warn for non-SMP system Mukesh Ojha
@ 2024-05-17  8:48 ` kernel test robot
  2024-05-17  8:58 ` kernel test robot
  2024-05-23 20:18 ` Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-05-17  8:48 UTC (permalink / raw)
  To: Mukesh Ojha, tglx; +Cc: oe-kbuild-all, linux-kernel, Mukesh Ojha

Hi Mukesh,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/irq/core]
[also build test ERROR on linus/master v6.9 next-20240517]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Mukesh-Ojha/genirq-chip-Fix-the-warn-for-non-SMP-system/20240517-033251
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/1715887825-1031-1-git-send-email-quic_mojha%40quicinc.com
patch subject: [PATCH] genirq/chip: Fix the warn for non-SMP system
config: alpha-allnoconfig (https://download.01.org/0day-ci/archive/20240517/202405171649.ZHgcLqIQ-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240517/202405171649.ZHgcLqIQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405171649.ZHgcLqIQ-lkp@intel.com/

All errors (new ones prefixed by >>):

   alpha-linux-ld: kernel/irq/chip.o: in function `irq_startup':
>> (.text+0x17f8): undefined reference to `irq_do_set_affinity'
>> alpha-linux-ld: (.text+0x1808): undefined reference to `irq_do_set_affinity'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] genirq/chip: Fix the warn for non-SMP system
  2024-05-16 19:30 [PATCH] genirq/chip: Fix the warn for non-SMP system Mukesh Ojha
  2024-05-17  8:48 ` kernel test robot
@ 2024-05-17  8:58 ` kernel test robot
  2024-05-23 20:18 ` Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-05-17  8:58 UTC (permalink / raw)
  To: Mukesh Ojha, tglx; +Cc: oe-kbuild-all, linux-kernel, Mukesh Ojha

Hi Mukesh,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/irq/core]
[also build test ERROR on linus/master v6.9 next-20240517]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Mukesh-Ojha/genirq-chip-Fix-the-warn-for-non-SMP-system/20240517-033251
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/1715887825-1031-1-git-send-email-quic_mojha%40quicinc.com
patch subject: [PATCH] genirq/chip: Fix the warn for non-SMP system
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20240517/202405171655.T2VuGylp-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240517/202405171655.T2VuGylp-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405171655.T2VuGylp-lkp@intel.com/

All errors (new ones prefixed by >>):

   or1k-linux-ld: kernel/irq/chip.o: in function `irq_startup':
>> chip.c:(.text+0x14d8): undefined reference to `irq_do_set_affinity'
>> chip.c:(.text+0x14d8): relocation truncated to fit: R_OR1K_INSN_REL_26 against undefined symbol `irq_do_set_affinity'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] genirq/chip: Fix the warn for non-SMP system
  2024-05-16 19:30 [PATCH] genirq/chip: Fix the warn for non-SMP system Mukesh Ojha
  2024-05-17  8:48 ` kernel test robot
  2024-05-17  8:58 ` kernel test robot
@ 2024-05-23 20:18 ` Thomas Gleixner
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2024-05-23 20:18 UTC (permalink / raw)
  To: Mukesh Ojha; +Cc: linux-kernel

On Fri, May 17 2024 at 01:00, Mukesh Ojha wrote:

We don't fix warnings. We fix the underlying problem.

> __irq_startup_managed() for !SMP system returns IRQ_STARTUP_NORMAL
> which may result in a WARNING during enablement of an irq i.e.,
> starting a irq while it is not activated.
>
> Fix this by appropriately returning IRQ_STARTUP_MANAGED.

What does that fix?

Absolutely nothing because both cases at the call site invoke
__irq_startup() which warns if the interrupt has not been activated yet.

It's not magically activated when __irq_startup_managed() returns
IRQ_STARTUP_MANAGED.

Also if you look at the SMP variant of that function then you might
notice that IRQ_STARTUP_MANAGED is not returned unconditionally. That
function can return IRQ_STARTUP_NORMAL too.

Just for the record. There are no managed interrupts on SMP=n. The code
which can initialize them is not even compiled in.

So I have no idea why you think that this has anything to do with
managed interrupts.

What's worse is that this does not even build on UP because
irq_do_set_affinity() does not exists for SMP=n. It builds today because
the IRQ_STARTUP_MANAGED case is optimized out by the compiler.

Sigh,

        tglx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-23 20:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 19:30 [PATCH] genirq/chip: Fix the warn for non-SMP system Mukesh Ojha
2024-05-17  8:48 ` kernel test robot
2024-05-17  8:58 ` kernel test robot
2024-05-23 20:18 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox