Commit df7e714d authored by Mete Durlu's avatar Mete Durlu Committed by Vasily Gorbik

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: default avatarHeiko Carstens <hca@linux.ibm.com>
Reviewed-by: default avatarTobias Huschle <huschle@linux.ibm.com>
Signed-off-by: default avatarMete Durlu <meted@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent bb9be93a
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment