[Openipmi-developer] [PATCH 04/23] ipmi:msghandler: Deliver user messages in a work queue

2025-04-24 Thread Corey Minyard
This simplifies the locking and lets us remove some weird event handling code. deliver_response() and friends can now be called from an atomic context. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 41 ++--- 1 file changed, 25 insertions(+), 16 d

[Openipmi-developer] [PATCH 14/23] ipmi:msghandler: Don't check for shutdown when returning responses

2025-04-24 Thread Corey Minyard
The lower level interface shouldn't attempt to unregister if it has a callback in the pending queue. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 34 ++--- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msg

[Openipmi-developer] [PATCH 23/23] ipmi:watchdog: Use the new interface for panic messages

2025-04-24 Thread Corey Minyard
It's available, remove all the duplicate code. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_watchdog.c | 72 --- 1 file changed, 17 insertions(+), 55 deletions(-) diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 01c

[Openipmi-developer] [PATCH 22/23] ipmi:msghandler: Export and fix panic messaging capability

2025-04-24 Thread Corey Minyard
Don't have the other users that do things at panic time (the watchdog) do all this themselves, provide a function to do it. Also, with the new design where most stuff happens at thread context, a few things needed to be fixed to avoid doing locking in a panic context. Signed-off-by: Corey Minyard

[Openipmi-developer] [PATCH 21/23] Documentation:ipmi: Remove comments about interrupt level

2025-04-24 Thread Corey Minyard
Callbacks no longer run at interrupt level or bh, so remove those comments. Signed-off-by: Corey Minyard --- Documentation/driver-api/ipmi.rst | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/driver-api/ipmi.rst b/Documentation/driver-api/ipmi.rst index

[Openipmi-developer] [PATCH 20/23] ipmi:ssif: Fix a shutdown race

2025-04-24 Thread Corey Minyard
It was possible for the SSIF thread to stop and quit before the kthread_stop() call because ssif->stopping was set before the stop. So only exit the SSIF thread is kthread_should_stop() returns true. There is no need to wake the thread, as the wait will be interrupted by kthread_stop(). Signed-o

[Openipmi-developer] [PATCH 18/23] ipmi:si: Rework startup of IPMI devices

2025-04-24 Thread Corey Minyard
It is possible in some situations that IPMI devices won't get started up properly. This change makes it so all non-duplicate devices will get started up. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_si_intf.c | 82 1 file changed, 62 insertions(+), 20

[Openipmi-developer] [PATCH 16/23] ipmi:msghandler: Shut down lower layer first at unregister

2025-04-24 Thread Corey Minyard
This makes sure any outstanding messages are returned to the user before the interface is cleaned up. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/driver

[Openipmi-developer] [PATCH 10/23] ipmi: Add a note about the pretimeout callback

2025-04-24 Thread Corey Minyard
You can't do IPMI calls from the callback, it's called with locks held. Signed-off-by: Corey Minyard --- include/linux/ipmi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 2f74dd90c271..27cd5980bb27 100644 --- a/include/li

[Openipmi-developer] [PATCH 13/23] ipmi:msghandler: Don't acquire a user refcount for queued messages

2025-04-24 Thread Corey Minyard
Messages already have a refcount for the user, so there's no need to account for a new one. As part of this, grab a refcount to the interface when processing received messages. The messages can be freed there, cause the user then the interface to be freed. Signed-off-by: Corey Minyard --- driv

[Openipmi-developer] [PATCH 17/23] ipmi:msghandler: Add a error return from unhandle LAN cmds

2025-04-24 Thread Corey Minyard
If we get a command from a LAN channel, return an error instead of just throwing it away. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/d

[Openipmi-developer] [PATCH 15/23] ipmi:msghandler: Remove proc_fs.h

2025-04-24 Thread Corey Minyard
It's no longer used. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 74a84d9c..927556ca469d 100644 --- a/drivers/char/ipmi/ipmi_msghandler.

[Openipmi-developer] [PATCH 06/23] ipmi:msghandler: Use the system_wq, not system_bh_wq

2025-04-24 Thread Corey Minyard
Everything can be run in thread context now, don't use the bh one. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index

[Openipmi-developer] [PATCH 19/23] ipmi:msghandler: Don't deliver messages to deleted users

2025-04-24 Thread Corey Minyard
Check to see if they have been destroyed before trying to deliver a message. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/

[Openipmi-developer] [PATCH 08/23] ipmi:msghandler: Remove srcu for the ipmi_interfaces list

2025-04-24 Thread Corey Minyard
With reworks srcu is no longer necessary, this simplifies locking a lot. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 194 +++- 1 file changed, 102 insertions(+), 92 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/i

[Openipmi-developer] [PATCH 12/23] ipmi:msghandler: Fix locking around users and interfaces

2025-04-24 Thread Corey Minyard
Now that SRCU is gone from IPMI, it can no longer be sloppy about locking. Use the users mutex now when sending a message, not the big ipmi_interfaces mutex, because it can result in a recursive lock. The users mutex will work because the interface destroy code claims it after setting the interfa

[Openipmi-developer] [PATCH 11/23] ipmi:msghandler: Remove some user level processing in panic mode

2025-04-24 Thread Corey Minyard
When run to completion is set, don't call things that will claim mutexes or call user callbacks. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c

[Openipmi-developer] [PATCH 09/23] ipmi:watchdog: Change lock to mutex

2025-04-24 Thread Corey Minyard
Now that the msghandler does all callbacks in user threads, there is no need to have a lock any more, a mutex will work fine. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_watchdog.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/char/

[Openipmi-developer] [PATCH 07/23] ipmi:msghandler: Remove srcu from the ipmi user structure

2025-04-24 Thread Corey Minyard
With the restructures done, srcu is no longer required, and it's fairly onerous. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 310 1 file changed, 133 insertions(+), 177 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drive

[Openipmi-developer] [PATCH 03/23] ipmi:msghandler: Move timer handling into a work queue

2025-04-24 Thread Corey Minyard
Get all operations that manipulate the interface list into thread context. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msgha

[Openipmi-developer] [PATCH 05/23] ipmi_msghandler: Change the events lock to a mutex

2025-04-24 Thread Corey Minyard
It can only be called from thread context now. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index fc939b5bb7f8..09

[Openipmi-developer] [PATCH 02/23] ipmi:msghandler: Rename recv_work to smi_work

2025-04-24 Thread Corey Minyard
It handles both receive and transmit functions, make the name generic. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msg

[Openipmi-developer] [PATCH 01/23] ipmi:msghandler: Use READ_ONCE on run_to_completion

2025-04-24 Thread Corey Minyard
It needs to be read only once because it's used in lock/unlock scenarios. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msgha

[Openipmi-developer] [PATCH 00/23] ipmi: Remove SRCU and handle the fallout

2025-04-24 Thread Corey Minyard
This patch set switches from SRCU to using normal locks. This required pulling most of the IPMI message handler up to run in kernel threads, which was a good thing, anyway. It also handles some fallout from that change. I didn't have a way to thoroughly test the IPMI driver, most of the work for