diff --git a/kernel/busses/i2c-piix4.c b/kernel/busses/i2c-piix4.c index 8aa06bbb..aaa18d81 100644 --- a/kernel/busses/i2c-piix4.c +++ b/kernel/busses/i2c-piix4.c @@ -110,7 +110,7 @@ int piix4_setup(void) do PIIX4_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, PIIX4_dev); - while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3); + while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3)); if(PIIX4_dev == NULL) { #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ for (i = 0; @@ -194,8 +194,8 @@ END: void piix4_do_pause( unsigned int amount ) { current->state = TASK_INTERRUPTIBLE; - current->timeout = jiffies + amount; - schedule(); + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(amount); } /* Another internally used function */ diff --git a/kernel/compat.h b/kernel/compat.h index 0c21b1de..fbf9170a 100644 --- a/kernel/compat.h +++ b/kernel/compat.h @@ -49,6 +49,11 @@ #define get_user_data(to,from) get_user(to,from) #endif +/* Add a scheduling fix for the new code in kernel 2.1.127 */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,127)) +#define schedule_timeout(x) ( current->timeout = jiffies + (x), schedule() ) +#endif + /* If the new PCI interface is not present, fall back on the old PCI BIOS interface. We also define some things to unite both interfaces. Not very nice, but it works like a charm. diff --git a/kernel/include/compat.h b/kernel/include/compat.h index 0c21b1de..fbf9170a 100644 --- a/kernel/include/compat.h +++ b/kernel/include/compat.h @@ -49,6 +49,11 @@ #define get_user_data(to,from) get_user(to,from) #endif +/* Add a scheduling fix for the new code in kernel 2.1.127 */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,127)) +#define schedule_timeout(x) ( current->timeout = jiffies + (x), schedule() ) +#endif + /* If the new PCI interface is not present, fall back on the old PCI BIOS interface. We also define some things to unite both interfaces. Not very nice, but it works like a charm. diff --git a/src/compat.h b/src/compat.h index 0c21b1de..fbf9170a 100644 --- a/src/compat.h +++ b/src/compat.h @@ -49,6 +49,11 @@ #define get_user_data(to,from) get_user(to,from) #endif +/* Add a scheduling fix for the new code in kernel 2.1.127 */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,127)) +#define schedule_timeout(x) ( current->timeout = jiffies + (x), schedule() ) +#endif + /* If the new PCI interface is not present, fall back on the old PCI BIOS interface. We also define some things to unite both interfaces. Not very nice, but it works like a charm. diff --git a/src/piix4.c b/src/piix4.c index 8aa06bbb..aaa18d81 100644 --- a/src/piix4.c +++ b/src/piix4.c @@ -110,7 +110,7 @@ int piix4_setup(void) do PIIX4_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, PIIX4_dev); - while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3); + while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3)); if(PIIX4_dev == NULL) { #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ for (i = 0; @@ -194,8 +194,8 @@ END: void piix4_do_pause( unsigned int amount ) { current->state = TASK_INTERRUPTIBLE; - current->timeout = jiffies + amount; - schedule(); + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(amount); } /* Another internally used function */