aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2024-05-02 15:34:05 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2024-05-02 15:34:05 +1000
commit60f0275a10fe3573d847a0feb12d147f231638cd (patch)
treeb1c7d647f8ef96d9839b2c8c0da8d89eb3721ee6
parent1e24bb65dcd41d2f2593b1356fd578035d03b176 (diff)
parentc5eeb63edac9497f9a0d46d3b75cf8b293771ecf (diff)
downloadlinux-next-60f0275a10fe3573d847a0feb12d147f231638cd.tar.gz
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi.git
Notice: this object is not reachable from any branch.
Notice: this object is not reachable from any branch.
-rw-r--r--drivers/fsi/fsi-sbefifo.c9
-rw-r--r--drivers/fsi/i2cr-scom.c11
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
index 0a98517f395918..0385476bfb03ae 100644
--- a/drivers/fsi/fsi-sbefifo.c
+++ b/drivers/fsi/fsi-sbefifo.c
@@ -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;
diff --git a/drivers/fsi/i2cr-scom.c b/drivers/fsi/i2cr-scom.c
index cb7e02213032cc..8d65c562b488f5 100644
--- a/drivers/fsi/i2cr-scom.c
+++ b/drivers/fsi/i2cr-scom.c
@@ -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,