summaryrefslogtreecommitdiffstats
path: root/drivers/hid/intel-ish-hid/ipc
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2019-03-05 15:42:51 +0100
committerJiri Kosina <jkosina@suse.cz>2019-03-05 15:42:51 +0100
commit9f66d83ed704bc9ac0f09eb744f8e76a81006eb9 (patch)
treee9a9a84797e440bb14c340d8671159cffe535cc4 /drivers/hid/intel-ish-hid/ipc
parentMerge branch 'for-5.1/ish' into for-linus (diff)
parentHID: intel-ish-hid: remove data[128] usage on stack when sending HBM request (diff)
downloadlinux-9f66d83ed704bc9ac0f09eb744f8e76a81006eb9.tar.xz
linux-9f66d83ed704bc9ac0f09eb744f8e76a81006eb9.zip
Merge branch 'for-5.1/i2c-hid' into for-linus
Fix dmesg flood for Elan touchpanels which are too slow to assert IRQ from Kai-Heng Feng
Diffstat (limited to 'drivers/hid/intel-ish-hid/ipc')
-rw-r--r--drivers/hid/intel-ish-hid/ipc/ipc.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
index 45e33c7ba9a6..96e869118db3 100644
--- a/drivers/hid/intel-ish-hid/ipc/ipc.c
+++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
@@ -259,33 +259,22 @@ static int write_ipc_from_queue(struct ishtp_device *dev)
int i;
void (*ipc_send_compl)(void *);
void *ipc_send_compl_prm;
- static int out_ipc_locked;
- unsigned long out_ipc_flags;
if (dev->dev_state == ISHTP_DEV_DISABLED)
- return -EINVAL;
+ return -EINVAL;
- spin_lock_irqsave(&dev->out_ipc_spinlock, out_ipc_flags);
- if (out_ipc_locked) {
- spin_unlock_irqrestore(&dev->out_ipc_spinlock, out_ipc_flags);
- return -EBUSY;
- }
- out_ipc_locked = 1;
+ spin_lock_irqsave(&dev->wr_processing_spinlock, flags);
if (!ish_is_input_ready(dev)) {
- out_ipc_locked = 0;
- spin_unlock_irqrestore(&dev->out_ipc_spinlock, out_ipc_flags);
+ spin_unlock_irqrestore(&dev->wr_processing_spinlock, flags);
return -EBUSY;
}
- spin_unlock_irqrestore(&dev->out_ipc_spinlock, out_ipc_flags);
- spin_lock_irqsave(&dev->wr_processing_spinlock, flags);
/*
* if tx send list is empty - return 0;
* may happen, as RX_COMPLETE handler doesn't check list emptiness.
*/
if (list_empty(&dev->wr_processing_list)) {
spin_unlock_irqrestore(&dev->wr_processing_spinlock, flags);
- out_ipc_locked = 0;
return 0;
}
@@ -328,6 +317,8 @@ static int write_ipc_from_queue(struct ishtp_device *dev)
memcpy(&reg, &r_buf[length >> 2], rem);
ish_reg_write(dev, reg_addr, reg);
}
+ ish_reg_write(dev, IPC_REG_HOST2ISH_DRBL, doorbell_val);
+
/* Flush writes to msg registers and doorbell */
ish_reg_read(dev, IPC_REG_ISH_HOST_FWSTS);
@@ -335,9 +326,6 @@ static int write_ipc_from_queue(struct ishtp_device *dev)
++dev->ipc_tx_cnt;
dev->ipc_tx_bytes_cnt += IPC_HEADER_GET_LENGTH(doorbell_val);
- ish_reg_write(dev, IPC_REG_HOST2ISH_DRBL, doorbell_val);
- out_ipc_locked = 0;
-
ipc_send_compl = ipc_link->ipc_send_compl;
ipc_send_compl_prm = ipc_link->ipc_send_compl_prm;
list_del_init(&ipc_link->link);
@@ -917,7 +905,6 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev)
init_waitqueue_head(&dev->wait_hw_ready);
spin_lock_init(&dev->wr_processing_spinlock);
- spin_lock_init(&dev->out_ipc_spinlock);
/* Init IPC processing and free lists */
INIT_LIST_HEAD(&dev->wr_processing_list);