diff options
author | Peter Oberparleiter <oberpar@linux.ibm.com> | 2022-09-26 16:56:04 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2022-10-10 10:15:10 +0200 |
commit | bf18140d30541c2c1e5c0f57879634f3d0d04912 (patch) | |
tree | e2262b24434363982790b447024478181207cf52 /drivers/s390/char/vmur.h | |
parent | s390/vmur: remove unnecessary BUG statement (diff) | |
download | linux-bf18140d30541c2c1e5c0f57879634f3d0d04912.tar.xz linux-bf18140d30541c2c1e5c0f57879634f3d0d04912.zip |
s390/vmur: generate uevent on unsolicited device end
When a traditional channel-attached device transitions from not-ready to
ready state, an unsolicited DEVICE END I/O interrupt is raised. This
happens for example when a new file arrives in the z/VM virtual reader
device.
Change the Linux kernel to generate a change uevent when such an
interrupt occurs for any online unit record devices supported by the
vmur driver. This can be useful to automatically trigger processing of
files as they arrive in the reader device.
A sample udev rule for running a program when this event occurs looks as
follows:
ENV{DRIVER}=="vmur", ACTION=="change", ENV{EVENT}=="unsol_de", \
RUN{program}="/path/to/program"
The rule can be tested using the following steps:
1. Set reader device online (assuming default reader device number 000c)
$ chzdev -ea 0.0.000c
2. Force a ready-state transition using z/VM's READY CP command
$ vmcp ready 000c
Suggested-by: Alan Altmark <Alan_Altmark@us.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/char/vmur.h')
-rw-r--r-- | drivers/s390/char/vmur.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h index 608b0719ce17..92d17d7cb47b 100644 --- a/drivers/s390/char/vmur.h +++ b/drivers/s390/char/vmur.h @@ -13,6 +13,7 @@ #define _VMUR_H_ #include <linux/refcount.h> +#include <linux/workqueue.h> #define DEV_CLASS_UR_I 0x20 /* diag210 unit record input device class */ #define DEV_CLASS_UR_O 0x10 /* diag210 unit record output device class */ @@ -76,6 +77,7 @@ struct urdev { wait_queue_head_t wait; /* wait queue to serialize open */ int open_flag; /* "urdev is open" flag */ spinlock_t open_lock; /* serialize critical sections */ + struct work_struct uevent_work; /* work to send uevent */ }; /* |