aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/heci/heci_init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-19 17:48:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-19 17:48:32 -0700
commitfb20871a54961b82d35303b43452928186c1361d (patch)
tree1beeb39e45eda1c8b5893090904b583fceeb07ef /drivers/staging/heci/heci_init.c
parentbee89ab228e6f51c4ddd3481b9bd491859a8ee7b (diff)
parentc7a5d70796379e3d51d0c652fbe1634b81d3bbd5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (342 commits) Staging: comedi: fix build errors Staging: udlfb: update to version 0.2.3 Staging: udlfb: fix some sparse warnings. Staging: udlfb: clean up checkpatch warnings in udlfb.c Staging: udlfb: clean up checkpatch warnings in udlfb.h Staging: udlfb: add udlfb driver to build Staging: add udlfb driver Staging: pata_rdc: remove pointless comments Staging: pata_rdc: remove DRIVER macros Staging: pata_rdc: remove dbgprintf macro Staging: pata_rdc: remove broken flag Staging: pata_rdc: fix build warnings Staging: pata_rdc: use PCI_DEVICE Staging: pata_rdc: remove function prototypes Staging: pata_rdc: coding style fixes Staging: pata_rdc: convert code to work in 2.6.29 Staging: pata_rdc: add driver to the build system Staging: add pata_rdc driver Staging: remove obsolete serqt_usb driver Staging: serqt_usb2 add the driver to the build ...
Diffstat (limited to 'drivers/staging/heci/heci_init.c')
-rw-r--r--drivers/staging/heci/heci_init.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/staging/heci/heci_init.c b/drivers/staging/heci/heci_init.c
index a8a0da910cf..31fd891c099 100644
--- a/drivers/staging/heci/heci_init.c
+++ b/drivers/staging/heci/heci_init.c
@@ -249,7 +249,7 @@ int heci_hw_init(struct iamt_heci_device *dev)
if ((dev->host_hw_state & H_IS) == H_IS) {
/* acknowledge interrupt and stop interupts */
- heci_set_csr_register(dev);
+ heci_csr_clear_his(dev);
}
dev->recvd_msg = 0;
DBG("reset in start the heci device.\n");
@@ -354,7 +354,7 @@ void heci_reset(struct iamt_heci_device *dev, int interrupts)
dev->host_hw_state &= ~H_RST;
dev->host_hw_state |= H_IG;
- write_heci_register(dev, H_CSR, dev->host_hw_state);
+ heci_set_csr_register(dev);
DBG("currently saved host_hw_state = 0x%08x.\n",
dev->host_hw_state);
@@ -998,8 +998,12 @@ int heci_disconnect_host_client(struct iamt_heci_device *dev,
if ((!dev) || (!file_ext))
return -ENODEV;
- if (file_ext->state != HECI_FILE_DISCONNECTING)
+ spin_lock_bh(&dev->device_lock);
+ if (file_ext->state != HECI_FILE_DISCONNECTING) {
+ spin_unlock_bh(&dev->device_lock);
return 0;
+ }
+ spin_unlock_bh(&dev->device_lock);
priv_cb = kzalloc(sizeof(struct heci_cb_private), GFP_KERNEL);
if (!priv_cb)
@@ -1012,6 +1016,7 @@ int heci_disconnect_host_client(struct iamt_heci_device *dev,
if (dev->host_buffer_is_empty) {
dev->host_buffer_is_empty = 0;
if (heci_disconnect(dev, file_ext)) {
+ mdelay(10); /* Wait for hardware disconnection ready */
list_add_tail(&priv_cb->cb_list,
&dev->ctrl_rd_list.heci_cb.cb_list);
} else {
@@ -1030,6 +1035,8 @@ int heci_disconnect_host_client(struct iamt_heci_device *dev,
err = wait_event_timeout(dev->wait_recvd_msg,
(HECI_FILE_DISCONNECTED == file_ext->state),
timeout * HZ);
+
+ spin_lock_bh(&dev->device_lock);
if (HECI_FILE_DISCONNECTED == file_ext->state) {
rets = 0;
DBG("successfully disconnected from fw client.\n");
@@ -1044,7 +1051,6 @@ int heci_disconnect_host_client(struct iamt_heci_device *dev,
DBG("failed to disconnect from fw client.\n");
}
- spin_lock_bh(&dev->device_lock);
heci_flush_list(&dev->ctrl_rd_list, file_ext);
heci_flush_list(&dev->ctrl_wr_list, file_ext);
spin_unlock_bh(&dev->device_lock);