Anyway here I only share my opinion. It is not my role to give the direction. > >> And What about using the "software flow control" instead? [1] >> >> [1] https://en.wikipedia.org/wiki/Software_flow_control >> >>> Â Â Â Â Â Â return 0; >>> @@ -137,6 +152,7 @@ static int rpmsg_eptdev_open(struct inode *inode, >>> struct file *filp) >>> Â Â Â Â Â Â Â Â Â return -EINVAL; >>> Â Â Â Â Â } >>> Â +Â Â Â ept->sig_cb = rpmsg_sigs_cb; >>> Â Â Â Â Â eptdev->ept = ept; >>> Â Â Â Â Â filp->private_data = eptdev; >>> Â @@ -155,6 +171,7 @@ static int rpmsg_eptdev_release(struct inode >>> *inode, struct file *filp) >>> Â Â Â Â Â Â Â Â Â eptdev->ept = NULL; >>> Â Â Â Â Â } >>> Â Â Â Â Â mutex_unlock(&eptdev->ept_lock); >>> +Â Â Â eptdev->sig_pending = false; >>> Â Â Â Â Â Â /* Discard all SKBs */ >>> Â Â Â Â Â skb_queue_purge(&eptdev->queue); >>> @@ -265,6 +282,9 @@ static __poll_t rpmsg_eptdev_poll(struct file >>> *filp, poll_table *wait) >>> Â Â Â Â Â if (!skb_queue_empty(&eptdev->queue)) >>> Â Â Â Â Â Â Â Â Â mask |= EPOLLIN | EPOLLRDNORM; >>> Â +Â Â Â if (eptdev->sig_pending) >>> +Â Â Â Â Â Â Â mask |= EPOLLPRI; >>> + >>> Â Â Â Â Â mask |= rpmsg_poll(eptdev->ept, filp, wait); >>> Â Â Â Â Â Â return mask; >>> @@ -274,11 +294,30 @@ static long rpmsg_eptdev_ioctl(struct file *fp, >>> unsigned int cmd, >>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned long arg) >>> Â { >>> Â Â Â Â Â struct rpmsg_eptdev *eptdev = fp->private_data; >>> +Â Â Â bool set; >>> +Â Â Â u32 val; >>> +Â Â Â int ret; >>> Â -Â Â Â if (cmd != RPMSG_DESTROY_EPT_IOCTL) >>> -Â Â Â Â Â Â Â return -EINVAL; >>> +Â Â Â switch (cmd) { >>> +Â Â Â case TIOCMGET: >>> +Â Â Â Â Â Â Â eptdev->sig_pending = false; >>> +Â Â Â Â Â Â Â ret = put_user(eptdev->rsigs, (int __user *)arg); >>> +Â Â Â Â Â Â Â break; >>> +Â Â Â case TIOCMSET: >>> +Â Â Â Â Â Â Â ret = get_user(val, (int __user *)arg); >>> +Â Â Â Â Â Â Â if (ret) >>> +Â Â Â Â Â Â Â Â Â Â Â break; >>> +Â Â Â Â Â Â Â set = (val & TIOCM_DTR) ? true : false; >>> +Â Â Â Â Â Â Â ret = rpmsg_set_flow_control(eptdev->ept, set); >>> +Â Â Â Â Â Â Â break; >> Could this directly be handled by the driver on open close? >> If application wants to suspend the link it could just close de >> /dev/rpmsgX. > All clients may not require setting flow control. Agree, but this could be conditioned by rpdrv->signals, right? And this could avoid to expose controls - in open/close the rpmsg_set_flow_control would be called, - in rpmsg_eptdev_write_iter an error would be returned ( or 0) if remote side has suspended the transmission. But perhaps you need more that a ON/OFF flow control? Regards, Arnaud >> Â Regards, >> Arnaud >> >>> +Â Â Â case RPMSG_DESTROY_EPT_IOCTL: >>> +Â Â Â Â Â Â Â ret = rpmsg_eptdev_destroy(&eptdev->dev, NULL); >>> +Â Â Â Â Â Â Â break; >>> +Â Â Â default: >>> +Â Â Â Â Â Â Â ret = -EINVAL; >>> +Â Â Â } >>> Â -Â Â Â return rpmsg_eptdev_destroy(&eptdev->dev, NULL); >>> +Â Â Â return ret; >>> Â } >>> Â Â static const struct file_operations rpmsg_eptdev_fops = {