Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336964
b: refs/heads/master
c: 744f0f2
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Nov 15, 2012
1 parent 40ea7a9 commit 0fd3909
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a562d5c25aa48c23774ab8d60bfd3bbcbca4bf1d
refs/heads/master: 744f0f2f424d374b233cea5f9b34caa851543755
19 changes: 19 additions & 0 deletions trunk/drivers/misc/mei/amthif.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,25 @@ void mei_amthif_run_next_cmd(struct mei_device *dev)
}
}


unsigned int mei_amthif_poll(struct mei_device *dev,
struct file *file, poll_table *wait)
{
unsigned int mask = 0;
mutex_unlock(&dev->device_lock);
poll_wait(file, &dev->iamthif_cl.wait, wait);
mutex_lock(&dev->device_lock);
if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE &&
dev->iamthif_file_object == file) {
mask |= (POLLIN | POLLRDNORM);
dev_dbg(&dev->pdev->dev, "run next amthi cb\n");
mei_amthif_run_next_cmd(dev);
}
return mask;
}



/**
* mei_amthif_irq_process_completed - processes completed iamthif operation.
*
Expand Down
10 changes: 1 addition & 9 deletions trunk/drivers/misc/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,7 @@ static unsigned int mei_poll(struct file *file, poll_table *wait)


if (cl == &dev->iamthif_cl) {
mutex_unlock(&dev->device_lock);
poll_wait(file, &dev->iamthif_cl.wait, wait);
mutex_lock(&dev->device_lock);
if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE &&
dev->iamthif_file_object == file) {
mask |= (POLLIN | POLLRDNORM);
dev_dbg(&dev->pdev->dev, "run next amthi cb\n");
mei_amthif_run_next_cmd(dev);
}
mask = mei_amthif_poll(dev, file, wait);
goto out;
}

Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/misc/mei/mei_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <linux/types.h>
#include <linux/watchdog.h>
#include <linux/poll.h>
#include <linux/mei.h>
#include "hw.h"

Expand Down Expand Up @@ -387,7 +388,10 @@ void mei_amthif_host_init(struct mei_device *dev);
int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *priv_cb);

int mei_amthif_read(struct mei_device *dev, struct file *file,
char __user *ubuf, size_t length, loff_t *offset);
char __user *ubuf, size_t length, loff_t *offset);

unsigned int mei_amthif_poll(struct mei_device *dev,
struct file *file, poll_table *wait);

int mei_amthif_release(struct mei_device *dev, struct file *file);

Expand Down

0 comments on commit 0fd3909

Please sign in to comment.