hotplug
Subsystems (2)
Greetings :linux-2.6.15-rc7/drivers/pci/hotplug/pciehp_ctrl.c linux-2.6.15-rc7/drivers/pci/hotplug/cpqphp_ctrl.c linux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.c
Replaced lock_kernel() with spinlocks , compile tested ok , using it.
As always if someone knows this patch breaks anything please tell me so.
Signature · 3 lines
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." Socrates
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpci_hotplug_core.c renamed from usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.c +5 -4
@@ -35,6 +35,7 @@#include <linux/smp_lock.h> #include <asm/atomic.h> #include <linux/delay.h> +#include <linux/spinlock.h> #include "pci_hotplug.h" #include "cpci_hotplug.h"
@@ -525,9 +526,9 @@ {int rc; -lock_kernel (); +spin_lock (&event_thread);daemonize ("cpci_hp_eventd" ); -unlock_kernel (); +spin_unlock (&event_thread);dbg ("%s - event thread started" , __FUNCTION__);while (1 ) {
@@ -566,9 +567,9 @@ {int rc; -lock_kernel (); +spin_lock (&poll_thread);daemonize ("cpci_hp_polld" ); -unlock_kernel (); +spin_unlock (&poll_thread);while (1 ) {if (thread_finished ||signal_pending (current))
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpqphp_ctrl.c renamed from usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/cpqphp_ctrl.c +4 -4
@@ -37,6 +37,7 @@#include <linux/wait.h> #include <linux/smp_lock.h> #include <linux/pci.h> +#include <linux/spinlock.h> #include "cpqphp.h" static u32 configure_new_device(struct controller* ctrl, struct pci_func *func,
@@ -1794,12 +1795,11 @@static int event_thread (void * data) {struct controller *ctrl; -lock_kernel (); +spin_lock (&event_thread);daemonize ("phpd_event" ); +spin_unlock (&event_thread); -unlock_kernel (); - -while (1 ) { +while (1 ) {dbg ("!!!!event_thread sleeping\n" );down_interruptible (&event_semaphore);dbg ("event_thread woken finished = %d\n" , event_finished);
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/pciehp_ctrl.c renamed from usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/pciehp_ctrl.c +3 -3
@@ -32,6 +32,7 @@#include <linux/types.h> #include <linux/smp_lock.h> #include <linux/pci.h> +#include <linux/spinlock.h> #include "../pci.h" #include "pciehp.h"
@@ -517,10 +518,9 @@static int event_thread (void * data) {struct controller *ctrl; -lock_kernel (); +spin_lock (&event_thread);daemonize ("pciehpd_event" ); - -unlock_kernel (); +spin_unlock (&event_thread);while (1 ) {dbg ("!!!!event_thread sleeping\n" );
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/shpchp_ctrl.c renamed from usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/shpchp_ctrl.c +3 -2
@@ -32,6 +32,7 @@#include <linux/types.h> #include <linux/smp_lock.h> #include <linux/pci.h> +#include <linux/spinlock.h> #include "../pci.h" #include "shpchp.h"
@@ -693,9 +694,9 @@static int event_thread (void * data) {struct controller *ctrl; -lock_kernel (); +spin_lock (&event_thread);daemonize ("shpchpd_event" ); -unlock_kernel (); +spin_unlock (&event_thread);while (1 ) {dbg ("!!!!event_thread sleeping\n" );
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 1 line · carlos neira
Replaced
lock_kernel()with spinlocks , compile tested ok , using it.
I can only imagine you're either doing this with a uniprocessor kernel or don't actually have the hardware in question.
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpci_hotplug_core.c line 531
Quoted 5 lines
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpci_hotplug_core.c renamed from usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.c +2
-2-lock_kernel (); +spin_lock (&event_thread);daemonize ("cpci_hp_eventd" ); -unlock_kernel (); +spin_unlock (&event_thread);
void daemonize(const char *name, ...)
{
[...]
down(&tty_sem); current->signal->tty = NULL; up(&tty_sem);
The first line of down() is
might_sleep();
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 1 line · carlos neira
Replaced
lock_kernel()with spinlocks , compile tested ok ,
Not true.
CC drivers/pci/hotplug/cpqphp_ctrl.odrivers/pci/hotplug/cpqphp_ctrl.c: In function `event_thread':drivers/pci/hotplug/cpqphp_ctrl.c:1798: warning: passing arg 1 of _spin_lock' from incompatible pointer type drivers/pci/hotplug/cpqphp_ctrl.c:1800: warning: passing arg 1 of _spin_unlock' from incompatible pointer type
Quoted 1 line
using it.
Well, I'm impressed.
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpci_hotplug_core.c line 531
Quoted 12 lines
diff -uN
/usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.c/home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpci_hotplug_core.chome/cneira/Linuxjanitoring/linux-janitorpatching/drivers/pci/hotplug/cpci_hotplug_core.c renamed from usr/src/linux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.c +2
-2@@ -525,9 +526,9 @@ {int rc; -lock_kernel (); +spin_lock (&event_thread);daemonize ("cpci_hp_eventd" ); -unlock_kernel (); +spin_unlock (&event_thread);
static intevent_thread(void *data)
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 6 lines · carlos neira
Greetings :
linux-2.6.15-rc7/drivers/pci/hotplug/pciehp_ctrl.clinux-2.6.15-rc7/drivers/pci/hotplug/cpqphp_ctrl.clinux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.cReplaced
lock_kernel()with spinlocks , compile tested ok , using it.
Do you have a pci hotplug system to test this with?
And as others pointed out, this patch is pretty broken, please consider it rejected.
thanks,
greg k-h
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 9 lines · carlos neira
Greetings :
linux-2.6.15-rc7/drivers/pci/hotplug/pciehp_ctrl.clinux-2.6.15-rc7/drivers/pci/hotplug/cpqphp_ctrl.clinux-2.6.15-rc7/drivers/pci/hotplug/cpci_hotplug_core.cReplaced
lock_kernel()with spinlocks , compile tested ok , using it.As always if someone knows this patch breaks anything please tell me so.
The proper usage of spin_lock is with a spinlock_t *, also, you cannot sleep while holding a spinlock, and daemonize may sleep.
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors