IPMI watchdog pre-timeout interrupt on FreeBSD - freebsd

I tried to enable watchdog through IPMI on FreeBSD 7.
According to IPMI spec v2.0. It's able to set NMI interrupt by set pre-timeout action bit.
The timeout action returns correct, but there is no response with NMI interrupt.
I wander whether it need other configuration somewhere else.
Any suggestions?
Thanks.

FreeBSD watchdogd daemon is what you want. It initialises correspondent device (ichwd or amdsbwd - it should show up in your dmesg if you had enabled it) or uses software watchdog.

Related

How can I check a specific irq is disabled in linux kernel?

I have a question about irq in linux kernel.
I enable a irq using request_threaded_irq(..). But sometimes we need to disable irq using disable_irq().
Depending on the situation, it may be necessary to enable it again.
Can I check a specific irq is already enabled before enable irq? To prevent enable again.
Is there any api to check a specific irq is enabled or disabled?
Thank you

Linux: Force a PCIe MSI interrupt to trigger from the command line

Background
I am having an issue where on a 32-bit Linux kernel my PCIe driver, with multi-MSI, and custom hardware device would work perfectly, now I've moved to a 64-bit iMX8MM CPU and MSI interrupts no longer trigger. The driver registers the interrupts correctly without any errors and I can view the output of cat /proc/interrupts and see all MSI vectors listed for my driver along with their interrupt count, which is zero. There is a bridge but /sys/bus/pci/devices/<address>/msi_bus has a 1 so it is enabled. Everything from lspci -vv looks in order and CONFIG_PCI_MSI was applied to the kernel. I am able to read and write memory buffers on the PCIe device so communications works correctly, I just can't get MSI interrupts to trigger. This is the exact same driver code running on the 32-bit CPU, which worked, and was recompiled on the new 64-bit CPU.
Question
How do I force an MSI interrupt on the system to see if Linux will pick it up and execute my code? From lspci -vv I can see the MSI address and I know the MSI vector value to write. So where do I write this on the system? I've looked at /dev/mem and other areas where I could hopefully do an echo 0x1 > <address>, or some other command line function, to write a value and trigger it. Where/how do I write to trigger a specific MSI interrupt?
An MSI can’t be triggered by a CPU; the dword write that triggers the interrupt is only recognized as an interrupt when it comes from a device.
A CPU can initiate an interrupt in a similar way by writing to the local APIC ICR register. This can only be done from the kernel, and as far as I know there is no existing kernel service to allow injecting an arbitrary interrupt. Maybe you can add a service to your kernel driver to do it. (Note, as a temporary debugging aid; this would be terribly inappropriate to leave in place in a driver.)
The fields of the ICR aren’t identical to those of an MSI, but they are similar. It should be straightforward to compare the documentation for the two to map one to the other.

Linux software watchdog configuration

I need to configure linux software watchdog (enabled in kernel configuration - CONFIG_SOFT_WATCHDOG=y, which gives me a new device /dev/watchdog1) such that if enabled and if a watchdog timeout occurs, it can launch a script/binary, instead of rebooting the system. My platform uses systemd and not init and I do not see a watchdog.conf file in /etc
Could not find a solution in how to use linux software watchdog. However, one comment says that " it is very possible to restart single or multiple processes after the watchdog signals that the systems is hanging - you can even ABORT the reboot or do a SOFT-reboot, one is able to configure "test" and "repair"-scripts / binaries which do whatever you want them to do."
How/Where can I configure /dev/watchdog1 so that it launches a script/binary instead of rebooting the system?
Eventually resorting to looking at the kernel source for watchdog drivers helped clear things for me. There is no way to configure /dev/watchdog1 or a kernel watchdog driver (hardware or software(softdog)), to be precise, to launch a script/binary instead of causing a system reboot. For this purpose, if feasible, you will have to write your own watchdog driver. The "launching script/binary" configuration that I was led to chase is associated with application space "watchdog daemon" (and has nothing to do with kernel's watchdog driver's configuration/behavior) which can launch a custom script to test your system health and try to fix things before a system reboot is necessary.

How we can check NAPI feature is enabled or not in linux?

I want to check NAPI feature is enabled in our linux or not. we are using bnx2 driver.
Our linux os is RHEL5 and kernel is 2.6.18-164.el5PAE
If anyone knows please help.
Thanks in Advance
Just generate continuous network traffic to the network interface using a traffic generator. Make sure *not to generate back traffic through the interface. Then do:
watch cat /proc/interrupts | grep bnx2
You will see the interrupt line statistics that the bnx2 driver has registered on.
Does the interrupt count keep rising in relation to the packet rate? then NAPI is off. Is the interrupt count steady or rises much slowly then the packet rate? NAPI is on.
Note that a shared interrupt line with some other device/driver may complicate the test.

resume/suspend enery star linux from command line

I have an ssh connection to a linux machine which is hibernated after some non-activity time.
I want to make it resume, how do I do that?
(writing to /dev/mouse to simulate mouse movement didn't do the trick)
A machine that is hibernating cannot come out of sleep without pressing the power button, or sending a magic packet if the ethernet adaptor has Wake On Lan (WOL) capability and the motherboard supports that. WOL packets can only be generated on the local network, not remotely from other networks.
-Adam
In addition to what Adam has stated, some motherboards support waking from various states when an interrupt is triggered.
The key here is which state you are referring to as hibernation; are you talking about an extremely low-power mode in hardware, or software hibernation where core memory is written to disk and the machine is turned off completely? If the latter, WOL is the only possibility; if the former, than you can tell your motherboard to watch for interrupts from various sources and you can use some other means to trigger a wake-up.
A good starting point for reading is the Wake-On-LAN article on Wikipedia.
To accomplish WOL you need a few things:
First, check the BIOS of the machine you're waking to see if it supports WOL. If it does, make sure it's turned on.
Then get a program that can send WOL packets:
In linux: sudo apt-get install wakeonlan
For windows just find one to download using google. There are probably 100 different apps that do it, I don't use Windows so I don't have one to reference.
If you want to receive WOL packets from outside of your local network. Configure your router to forward port 9 to 255.255.255.255 (IP Broadcast-To-All address).
For some really useful info on the WOL protocol as well as a sample capture file that can be loaded in wireshark, see this article.

Resources