mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 00:32:00 +00:00
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi.git
This commit is contained in:
commit
002dc8bac5
@ -113,7 +113,7 @@ enum sbe_state
|
||||
#define SBEFIFO_TIMEOUT_IN_RSP 1000
|
||||
|
||||
/* Other constants */
|
||||
#define SBEFIFO_MAX_USER_CMD_LEN (0x100000 + PAGE_SIZE)
|
||||
#define SBEFIFO_MAX_USER_CMD_LEN (0x400000 + PAGE_SIZE)
|
||||
#define SBEFIFO_RESET_MAGIC 0x52534554 /* "RSET" */
|
||||
|
||||
struct sbefifo {
|
||||
@ -882,6 +882,13 @@ static ssize_t sbefifo_user_write(struct file *file, const char __user *buf,
|
||||
|
||||
mutex_lock(&user->file_lock);
|
||||
|
||||
/* If previous write command is still pending then free it. It is safe
|
||||
* to do that because read cannot be in progress since we hold the
|
||||
* lock.
|
||||
*/
|
||||
if (user->pending_cmd)
|
||||
sbefifo_release_command(user);
|
||||
|
||||
/* Can we use the pre-allocate buffer ? If not, allocate */
|
||||
if (len <= PAGE_SIZE)
|
||||
user->pending_cmd = user->cmd_page;
|
||||
|
@ -73,9 +73,18 @@ static ssize_t i2cr_scom_write(struct file *filep, const char __user *buf, size_
|
||||
return len;
|
||||
}
|
||||
|
||||
static int i2cr_scom_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct i2cr_scom *scom = container_of(inode->i_cdev, struct i2cr_scom, cdev);
|
||||
|
||||
file->private_data = scom;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct file_operations i2cr_scom_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = simple_open,
|
||||
.open = i2cr_scom_open,
|
||||
.llseek = i2cr_scom_llseek,
|
||||
.read = i2cr_scom_read,
|
||||
.write = i2cr_scom_write,
|
||||
|
Loading…
Reference in New Issue
Block a user