lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1299512600-29047-5-git-send-email-haojian.zhuang@marvell.com>
Date:	Mon,  7 Mar 2011 23:43:13 +0800
From:	Haojian Zhuang <haojian.zhuang@...vell.com>
To:	johnpol@....mipt.ru, sameo@...ux.intel.com, a.zummo@...ertech.it,
	lrg@...mlogic.co.uk, broonie@...nsource.wolfsonmicro.com,
	dmitry.torokhov@...il.com, dtor@...l.ru, rpurdie@...ys.net,
	linux-kernel@...r.kernel.org
Cc:	Haojian Zhuang <haojian.zhuang@...vell.com>
Subject: [PATCH] mfd: add workqueue thread into 88pm860x

Create workqueue thread in 88pm860x driver since 88pm860x driver
needs to handle event in workqueue.

Avoid to use system workqueue since i2c operation cost a lot of
time. It would impact system performance.

Signed-off-by: Haojian Zhuang <haojian.zhuang@...vell.com>
---
 drivers/mfd/88pm860x-core.c  |   12 ++++++++++++
 include/linux/mfd/88pm860x.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 9c511c1..42c4fa2 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -766,11 +766,21 @@ static void __devinit device_8607_init(struct pm860x_chip *chip,
 	if (ret < 0)
 		goto out;
 
+	chip->monitor_wqueue = create_singlethread_workqueue("88pm860x");
+	if (!chip->monitor_wqueue) {
+		ret = -ESRCH;
+		goto out_work;
+	}
+
 	device_regulator_init(chip, i2c, pdata);
 	device_onkey_init(chip, i2c, pdata);
 	device_touch_init(chip, i2c, pdata);
 	device_power_init(chip, i2c, pdata);
 	device_codec_init(chip, i2c, pdata);
+	return;
+
+out_work:
+	device_irq_exit(chip);
 out:
 	return;
 }
@@ -807,6 +817,8 @@ int __devinit pm860x_device_init(struct pm860x_chip *chip,
 
 void __devexit pm860x_device_exit(struct pm860x_chip *chip)
 {
+	flush_workqueue(chip->monitor_wqueue);
+	destroy_workqueue(chip->monitor_wqueue);
 	device_irq_exit(chip);
 	mfd_remove_devices(chip->dev);
 }
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index a6f6f81..87df510 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -301,6 +301,7 @@ struct pm860x_chip {
 	struct mutex		irq_lock;
 	struct i2c_client	*client;
 	struct i2c_client	*companion;	/* companion chip client */
+	struct workqueue_struct	*monitor_wqueue;
 
 	int			buck3_double;	/* DVC ramp slope double */
 	unsigned short		companion_addr;
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ