--- v7
+++ v2
@@ -19,20 +19,17 @@
Length of 4K buffer n used
Only one buffer is used right now because of max payload size is
-4048 bytes. writev() can be used in future when supported more
+4088 bytes. writev() can be used in future when supported more
than one buffer.
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
-Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
-Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>
-Tested-by: Shashank MS <shashank.gowda@in.ibm.com>
---
- arch/powerpc/platforms/pseries/papr-hvpipe.c | 118 ++++++++++++++++++-
+ arch/powerpc/platforms/pseries/papr-hvpipe.c | 120 ++++++++++++++++++-
arch/powerpc/platforms/pseries/papr-hvpipe.h | 7 ++
- 2 files changed, 124 insertions(+), 1 deletion(-)
+ 2 files changed, 126 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/papr-hvpipe.c b/arch/powerpc/platforms/pseries/papr-hvpipe.c
-index aca905189cf2..9f2bac71bab1 100644
+index 5768d072859d..c30f4d75e645 100644
--- a/arch/powerpc/platforms/pseries/papr-hvpipe.c
+++ b/arch/powerpc/platforms/pseries/papr-hvpipe.c
@@ -14,6 +14,7 @@
@@ -78,7 +75,7 @@
+ ret = -EINVAL;
+ break;
+ case RTAS_HVPIPE_CLOSED:
-+ ret = -EPIPE;
++ ret = -EACCES;
+ break;
+ case RTAS_FUNC_NOT_SUPPORTED:
+ ret = -EOPNOTSUPP;
@@ -95,13 +92,13 @@
static struct hvpipe_source_info *hvpipe_find_source(u32 srcID)
{
struct hvpipe_source_info *src_info;
-@@ -78,11 +124,81 @@ static ssize_t papr_hvpipe_handle_write(struct file *file,
+@@ -78,11 +124,83 @@ static ssize_t papr_hvpipe_handle_write(struct file *file,
const char __user *buf, size_t size, loff_t *off)
{
struct hvpipe_source_info *src_info = file->private_data;
+ struct rtas_work_area *work_area, *work_buf;
+ unsigned long ret, len;
-+ __be64 *area_be;
++ char *area_buf;
if (!src_info)
return -EIO;
@@ -148,19 +145,21 @@
+ ret = -ENOMEM;
+ goto out;
+ }
-+ area_be = (__be64 *)rtas_work_area_raw_buf(work_area);
++ area_buf = rtas_work_area_raw_buf(work_area);
+ /* header */
-+ area_be[0] = cpu_to_be64(len);
++ *(u64 *)area_buf = cpu_to_be64(len);
++ area_buf += sizeof(u64);
+
+ work_buf = rtas_work_area_alloc(SZ_4K);
-+ if (!work_buf) {
++ if (!area_buf) {
+ ret = -ENOMEM;
+ goto out_work;
+ }
+ /* First buffer address */
-+ area_be[1] = cpu_to_be64(rtas_work_area_phys(work_buf));
++ *(u64 *)area_buf = cpu_to_be64(rtas_work_area_phys(work_buf));
++ area_buf += sizeof(u64);
+ /* First buffer address length */
-+ area_be[2] = cpu_to_be64(size);
++ *(u64 *)area_buf = cpu_to_be64(size);
+
+ if (!copy_from_user(rtas_work_area_raw_buf(work_buf), buf, size)) {
+ ret = rtas_ibm_send_hvpipe_msg(work_area, src_info->srcID);
@@ -197,6 +196,6 @@
struct hvpipe_source_info {
struct list_head list; /* list of sources */
--
-2.50.1
-
-
+2.43.5
+
+