diff options
author | Mete Durlu <meted@linux.ibm.com> | 2024-07-04 14:10:06 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2024-07-10 19:50:45 +0200 |
commit | df7e714d6d6ca7921be2e5c7d599d9b4aa96d682 (patch) | |
tree | 33ed2e13306cc9d41576554356f8aba7053db730 /arch/s390 | |
parent | bb9be93acb7e6a0fa78919d30e68410c401fe690 (diff) |
s390/diag: Diag204 add busy return errno
When diag204-busy-indication facility is installed, diag204 can return
'8' which means device is busy and no operation is done. Add check for
return codes of diag204 call. Return error codes according to diag204
return codes.
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Tobias Huschle <huschle@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/diag.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c index 9f33dcecbffa..9b65f04c83de 100644 --- a/arch/s390/kernel/diag.c +++ b/arch/s390/kernel/diag.c @@ -185,6 +185,8 @@ int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode) } EXPORT_SYMBOL(diag14); +#define DIAG204_BUSY_RC 8 + static inline int __diag204(unsigned long *subcode, unsigned long size, void *addr) { union register_pair rp = { .even = *subcode, .odd = size }; @@ -223,7 +225,9 @@ int diag204(unsigned long subcode, unsigned long size, void *addr) addr = (void *)pfn_to_phys(vmalloc_to_pfn(addr)); diag_stat_inc(DIAG_STAT_X204); size = __diag204(&subcode, size, addr); - if (subcode) + if (subcode == DIAG204_BUSY_RC) + return -EBUSY; + else if (subcode) return -EOPNOTSUPP; return size; } |