Hi Wang Bowen, Xiang Xiao

The RPMsg fs and tty works wonderful with the linux drivers I received from 
you. 
I was wondering if there are any updates on the linux drivers since the NuttX 
drivers do get updates quite often. It would be great if you could share these 
updates.

On the rpmsg fs driver in linux I made a small fix on the file flags mapping in 
rpmsgfs_open_handler(). In NuttX the O_RDONLY symbol resolves to bit 0(value 1) 
but in linux it has the value 0.
When you open a file in NuttX with O_RDWR then on linux it would result in 
opening the file as write-only.

Below change fixed it.

diff --git a/drivers/rpmsg/rpmsg_fs.c b/drivers/rpmsg/rpmsg_fs.c
index 3cd35196f408..f354c6ac5ab4 100755
--- a/drivers/rpmsg/rpmsg_fs.c
+++ b/drivers/rpmsg/rpmsg_fs.c
@@ -283,12 +283,15 @@ static int rpmsgfs_open_handler(struct rpmsg_device 
*rpdev,
        struct rpmsgfs *priv = dev_get_drvdata(&rpdev->dev);
        struct rpmsgfs_open *msg = data;
        struct file *filp;
-       int id, flags = 0;
+       int id, flags = O_RDONLY;
+
+       if (msg->flags & RPMSGFS_O_WRONLY) {
+               if (msg->flags & RPMSGFS_O_RDONLY)
+                       flags = O_RDWR;
+               else
+                       flags = O_WRONLY;
+       }

-       if (msg->flags & RPMSGFS_O_RDONLY)
-               flags |= O_RDONLY;
-       if (msg->flags & RPMSGFS_O_WRONLY)
-               flags |= O_WRONLY;
        if (msg->flags & RPMSGFS_O_CREAT)
                flags |= O_CREAT;
        if (msg->flags & RPMSGFS_O_EXCL)


Kind regards,
Andre

> -----Original Message-----
> From: Bowen Wang <bowenwa...@gmail.com>
> Sent: Thursday, 27 June 2024 11:26
> To: dev@nuttx.apache.org
> Subject: Re: [EXT] Re: RPMsg FS on NuttX and Linux
> 
>       Caution: This is an external email. Please take care when clicking links
> or opening attachments. When in doubt, report the message using the
> 'Report this email' button
> 
> Hi Andre,
> 
> The attachment is the patch for rpmsgfs, we only implement the rpmsgfs
> server side in linux for now, rpmsgfs client side in linux is still under
> development.
> 
> So we can access the Linux‘s file system in NuttX, but in Linux, we can't 
> mount
> the Vela's file system.
> 
> 
> Kind regards,
> 
> Wang Bowen
> 
> Andre Heinemans <andre.heinem...@nxp.com
> <mailto:andre.heinem...@nxp.com> > 于2024年6月27日周四 17:12写道:
> 
> 
>       Hi Bowen,
> 
>       I am using 6.6.3. But it would be okay for me if I receive the patches
> for version 5.15. I will try to adapt them.
> 
>       Thanks in advance!
> 
>       Kind regards,
>       Andre
> 
>       -----Original Message-----
>       From: Bowen Wang <bowenwa...@gmail.com
> <mailto:bowenwa...@gmail.com> >
>       Sent: Thursday, 27 June 2024 03:46
>       To: dev@nuttx.apache.org <mailto:dev@nuttx.apache.org>
>       Subject: [EXT] Re: RPMsg FS on NuttX and Linux
> 
>       Caution: This is an external email. Please take care when clicking links
> or opening attachments. When in doubt, report the message using the
> 'Report this email' button
> 
> 
>       Hi, Andre
> 
>       Which Linux version are you using?
>       We have adapted RPMSGFS on 5.4 and 5.15. We are not sure if it
> meets your requirements.
> 
>       Kind regards,
>       Wang Bowen
> 
>       Xiang Xiao <xiaoxiang781...@gmail.com
> <mailto:xiaoxiang781...@gmail.com> > 于2024年6月25日周二 22:47写道:
> 
>       > rpmsg_fs isn't upstreamed to the Linux community yet. Bowen
> could give
>       > you a patch to try.
>       >
>       > On Tue, Jun 25, 2024 at 8:44 PM Andre Heinemans
>       > <andre.heinem...@nxp.com
> <mailto:andre.heinem...@nxp.com> >
>       > wrote:
>       >
>       > > Hi,
>       > >
>       > > I am searching for a solution to share a disk or directory on a
>       > > Linux
>       > host
>       > > and make it accessible in NuttX through RPMsg. It looks like
>       > > CONFIG_FS_RPMSGFS is the feature I need. According to this
> NuttX
>       > > channel video
>       > > (https://www.youtube.com/watch?v=-YLAQlJR1vA
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> youtube.com%2Fwatch%3Fv%3D-
> YLAQlJR1vA&data=05%7C02%7Candre.heinemans%40nxp.com%7C7b20118b
> 5af34936356e08dc968b5405%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C638550772355433038%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7
> C%7C&sdata=wNH%2FytC3N7YXDeP8Cff3UZ3JeMbwpFIqaNWezneeoJ0%3D&
> reserved=0> )  various RPMsg services in Nuttx are supported in Linux
> including RPMsg FS.
>       > >
>       > > So, I tried setting this up but couldn’t find the correct linux
>       > > module that is able to interact with this service.
>       > >
>       > > When I try to mount a directory with
>       > > nsh> mount -t rpmsgfs -o cpu=netcore,fs=/mnt /mnt
>       > >
>       > > Some interaction happens. See linux dmesg log:
>       > > [   61.086471] virtio_rpmsg_bus virtio0: creating channel
>       > > rpmsgfs-0x2000c1c8 addr 0x401
>       > >
>       > > But it seems no linux driver is listening to that channel. When I
>       > > try to access the mounted directory in NuttX then nsh freezes.
>       > >
>       > > What do I need to do on Linux to support this service? Do I maybe
>       > > need a patch or a different fork?
>       > >
>       > > Kind regards,
>       > > Andre
>       > >
>       >
> 

Reply via email to