WSL2-Linux-Kernel/drivers/char/ipmi
Haiyue Wang dc0f0a026d ipmi: kcs_bmc: fix IRQ exception if the channel is not open
When kcs_bmc_handle_event calls kcs_force_abort function to handle the
not open (no user running) KCS channel transaction, the returned status
value -ENODEV causes the low level IRQ handler indicating that the irq
was not for him by returning IRQ_NONE. After some time, this IRQ will
be treated to be spurious one, and the exception dump happens.

   irq 30: nobody cared (try booting with the "irqpoll" option)
   CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.15-npcm750 #1
   Hardware name: NPCMX50 Chip family
   [<c010b264>] (unwind_backtrace) from [<c0106930>] (show_stack+0x20/0x24)
   [<c0106930>] (show_stack) from [<c03dad38>] (dump_stack+0x8c/0xa0)
   [<c03dad38>] (dump_stack) from [<c0168810>] (__report_bad_irq+0x3c/0xdc)
   [<c0168810>] (__report_bad_irq) from [<c0168c34>] (note_interrupt+0x29c/0x2ec)
   [<c0168c34>] (note_interrupt) from [<c0165c80>] (handle_irq_event_percpu+0x5c/0x68)
   [<c0165c80>] (handle_irq_event_percpu) from [<c0165cd4>] (handle_irq_event+0x48/0x6c)
   [<c0165cd4>] (handle_irq_event) from [<c0169664>] (handle_fasteoi_irq+0xc8/0x198)
   [<c0169664>] (handle_fasteoi_irq) from [<c016529c>] (__handle_domain_irq+0x90/0xe8)
   [<c016529c>] (__handle_domain_irq) from [<c01014bc>] (gic_handle_irq+0x58/0x9c)
   [<c01014bc>] (gic_handle_irq) from [<c010752c>] (__irq_svc+0x6c/0x90)
   Exception stack(0xc0a01de8 to 0xc0a01e30)
   1de0:                   00002080 c0a6fbc0 00000000 00000000 00000000 c096d294
   1e00: 00000000 00000001 dc406400 f03ff100 00000082 c0a01e94 c0a6fbc0 c0a01e38
   1e20: 00200102 c01015bc 60000113 ffffffff
   [<c010752c>] (__irq_svc) from [<c01015bc>] (__do_softirq+0xbc/0x358)
   [<c01015bc>] (__do_softirq) from [<c011c798>] (irq_exit+0xb8/0xec)
   [<c011c798>] (irq_exit) from [<c01652a0>] (__handle_domain_irq+0x94/0xe8)
   [<c01652a0>] (__handle_domain_irq) from [<c01014bc>] (gic_handle_irq+0x58/0x9c)
   [<c01014bc>] (gic_handle_irq) from [<c010752c>] (__irq_svc+0x6c/0x90)
   Exception stack(0xc0a01ef8 to 0xc0a01f40)
   1ee0:                                                       00000000 000003ae
   1f00: dcc0f338 c0111060 c0a00000 c0a0cc44 c0a0cbe4 c0a1c22b c07bc218 00000001
   1f20: dcffca40 c0a01f54 c0a01f58 c0a01f48 c0103524 c0103528 60000013 ffffffff
   [<c010752c>] (__irq_svc) from [<c0103528>] (arch_cpu_idle+0x48/0x4c)
   [<c0103528>] (arch_cpu_idle) from [<c0681390>] (default_idle_call+0x30/0x3c)
   [<c0681390>] (default_idle_call) from [<c0156f24>] (do_idle+0xc8/0x134)
   [<c0156f24>] (do_idle) from [<c015722c>] (cpu_startup_entry+0x28/0x2c)
   [<c015722c>] (cpu_startup_entry) from [<c067ad74>] (rest_init+0x84/0x88)
   [<c067ad74>] (rest_init) from [<c0900d44>] (start_kernel+0x388/0x394)
   [<c0900d44>] (start_kernel) from [<0000807c>] (0x807c)
   handlers:
   [<c041c5dc>] npcm7xx_kcs_irq
   Disabling IRQ #30

It needs to change the returned status from -ENODEV to 0. The -ENODEV
was originally used to tell the low level IRQ handler that no user was
running, but not consider the IRQ handling desgin.

And multiple KCS channels share one IRQ handler, it needs to check the
IBF flag before doing force abort. If the IBF is set, after handling,
return 0 to low level IRQ handler to indicate that the IRQ is handled.

Signed-off-by: Haiyue Wang <haiyue.wang@linux.intel.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2018-06-24 18:11:39 -05:00
..
Kconfig ipmi: Remove the proc interface 2018-05-09 12:21:46 -05:00
Makefile ipmi: add an NPCM7xx KCS BMC driver 2018-04-18 10:23:12 -05:00
bt-bmc.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_bt_sm.c ipmi:bt: Set the timeout before doing a capabilities check 2018-05-22 13:48:30 -05:00
ipmi_devintf.c ipmi_devintf: Add an error return on invalid ioctls 2018-04-18 10:23:04 -05:00
ipmi_dmi.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_dmi.h ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_kcs_sm.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_msghandler.c ipmi: Properly release srcu locks on error conditions 2018-05-24 15:08:30 -05:00
ipmi_powernv.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_poweroff.c ipmi: Rename ipmi_user_t to struct ipmi_user * 2018-04-18 10:22:55 -05:00
ipmi_si.h ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_hardcode.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_hotmod.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_intf.c ipmi: Cleanup oops on initialization failure 2018-06-24 18:11:38 -05:00
ipmi_si_mem_io.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_parisc.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_pci.c ipmi:pci: Blacklist a Realtek "IPMI" device 2018-03-13 06:58:47 -05:00
ipmi_si_platform.c ipmi: Remove ACPI SPMI probing from the system interface driver 2018-03-12 07:03:06 -05:00
ipmi_si_port_io.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_sm.h ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_smic_sm.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_ssif.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
ipmi_watchdog.c ipmi: Rename ipmi_user_t to struct ipmi_user * 2018-04-18 10:22:55 -05:00
kcs_bmc.c ipmi: kcs_bmc: fix IRQ exception if the channel is not open 2018-06-24 18:11:39 -05:00
kcs_bmc.h ipmi: kcs_bmc: coding-style fixes and use new poll type 2018-02-26 09:49:21 -06:00
kcs_bmc_aspeed.c ipmi: kcs_bmc: coding-style fixes and use new poll type 2018-02-26 09:49:21 -06:00
kcs_bmc_npcm7xx.c ipmi: NPCM7xx KCS BMC: enable interrupt to the host 2018-05-23 08:29:23 -05:00