Skip to contentSkip to conversation

Sonypi: use synchronize_irq instead of sycnronize_sched

PATCH In review Dmitry Torokhov 2 participants 4 messages Oct 31, 2007 – Nov 20, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Sonypi: use synchronize_irq instead of sycnronize_sched

Hi Mattia,

It looks like you are also looking after sonypi...

Signature · 27 lines
Dmitry

Subject: Sonypi: use synchronize_irq instead of sycnronize_sched
From: Dmitry Torokhov <[email protected]>

We know exactly what IRQ we are using, so synchronize_irq()
suits much better. Plus synchronize_sched() will not work
for us in -rt kernels.

Signed-off-by: Dmitry Torokhov <[email protected]>
---
 drivers/char/sonypi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/char/sonypi.c
===================================================================
--- linux.orig/drivers/char/sonypi.c
+++ linux/drivers/char/sonypi.c
@@ -1432,7 +1432,7 @@ static int __devexit sonypi_remove(struc
 {
 	sonypi_disable();
 
-	synchronize_sched();  /* Allow sonypi interrupt to complete. */
+	synchronize_irq(sonypi_device.irq);
 	flush_scheduled_work();
 
 	if (useinput) {
#1 lore raw

PATCH 2/2 Sonypi: fit input devices into sysfs tree

Subject: Sonypi: fit input devices into sysfs tree
From: Dmitry Torokhov <[email protected]>

Properly set up parent on input devices registered by sonypi.

---
 drivers/char/sonypi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/char/sonypi.c +4 -2
Index: linux/drivers/char/sonypi.c
===================================================================
@@ -1163,7 +1163,7 @@ static struct acpi_driver sonypi_acpi_dr
 };
 #endif
 
-static int __devinit sonypi_create_input_devices(void)
+static int __devinit sonypi_create_input_devices(struct platform_device *pdev)
 {
 	struct input_dev *jog_dev;
 	struct input_dev *key_dev;
@@ -1177,6 +1177,7 @@ static int __devinit sonypi_create_input
 	jog_dev->name = "Sony Vaio Jogdial";
 	jog_dev->id.bustype = BUS_ISA;
 	jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
+	jog_dev->dev.parent = &pdev->dev;
 
 	jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
 	jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
@@ -1191,6 +1192,7 @@ static int __devinit sonypi_create_input
 	key_dev->name = "Sony Vaio Keys";
 	key_dev->id.bustype = BUS_ISA;
 	key_dev->id.vendor = PCI_VENDOR_ID_SONY;
+	key_dev->dev.parent = &pdev->dev;
 
 	/* Initialize the Input Drivers: special keys */
 	key_dev->evbit[0] = BIT_MASK(EV_KEY);
@@ -1385,7 +1387,7 @@ static int __devinit sonypi_probe(struct
 
 	if (useinput) {
 
-		error = sonypi_create_input_devices();
+		error = sonypi_create_input_devices(dev);
 		if (error) {
 			printk(KERN_ERR
 				"sonypi: failed to create input devices\n");
maintainer Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] Sonypi: fit input devices into sysfs tree

Quoted 6 lines · Dmitry Torokhov

Subject: Sonypi: fit input devices into sysfs tree
From: Dmitry Torokhov <[email protected]>

Properly set up parent on input devices registered by sonypi.

Quoted 43 lines
---
 drivers/char/sonypi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux/drivers/char/sonypi.c
===================================================================

drivers/char/sonypi.c +4 -2
@@ -1163,7 +1163,7 @@ static struct acpi_driver sonypi_acpi_dr
 };
 #endif
 
-static int __devinit sonypi_create_input_devices(void)
+static int __devinit sonypi_create_input_devices(struct platform_device *pdev)
 {
 	struct input_dev *jog_dev;
 	struct input_dev *key_dev;
@@ -1177,6 +1177,7 @@ static int __devinit sonypi_create_input
 	jog_dev->name = "Sony Vaio Jogdial";
 	jog_dev->id.bustype = BUS_ISA;
 	jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
+	jog_dev->dev.parent = &pdev->dev;
 
 	jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
 	jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
@@ -1191,6 +1192,7 @@ static int __devinit sonypi_create_input
 	key_dev->name = "Sony Vaio Keys";
 	key_dev->id.bustype = BUS_ISA;
 	key_dev->id.vendor = PCI_VENDOR_ID_SONY;
+	key_dev->dev.parent = &pdev->dev;
 
 	/* Initialize the Input Drivers: special keys */
 	key_dev->evbit[0] = BIT_MASK(EV_KEY);
@@ -1385,7 +1387,7 @@ static int __devinit sonypi_probe(struct
 
 	if (useinput) {
 
-		error = sonypi_create_input_devices();
+		error = sonypi_create_input_devices(dev);
 		if (error) {
 			printk(KERN_ERR
 				"sonypi: failed to create input devices\n");
Signature · 2 lines
mattia
:wq!
maintainer Acked-by on v1 1/2
#3 lore raw
In reply to Dmitry Torokhov
Quoted 15 lines · Dmitry Torokhov

Hi Mattia,

It looks like you are also looking after sonypi...

Signature · 10 lines
Dmitry

Subject: Sonypi: use synchronize_irq instead of sycnronize_sched
From: Dmitry Torokhov <[email protected]>

We know exactly what IRQ we are using, so synchronize_irq()
suits much better. Plus synchronize_sched() will not work
for us in -rt kernels.

Signed-off-by: Dmitry Torokhov <[email protected]>
Quoted 18 lines
---
 drivers/char/sonypi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/char/sonypi.c
===================================================================

drivers/char/sonypi.c +1 -1
@@ -1432,7 +1432,7 @@ static int __devexit sonypi_remove(struc
 {
 	sonypi_disable();
 
-	synchronize_sched();  /* Allow sonypi interrupt to complete. */
+	synchronize_irq(sonypi_device.irq);
 	flush_scheduled_work();
 
 	if (useinput) {
Signature · 2 lines
mattia
:wq!