Skip to content

Commit df7e714

Browse files
NickJackolsonVasily Gorbik
authored andcommitted
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 <[email protected]> Reviewed-by: Tobias Huschle <[email protected]> Signed-off-by: Mete Durlu <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent bb9be93 commit df7e714

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/s390/kernel/diag.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode)
185185
}
186186
EXPORT_SYMBOL(diag14);
187187

188+
#define DIAG204_BUSY_RC 8
189+
188190
static inline int __diag204(unsigned long *subcode, unsigned long size, void *addr)
189191
{
190192
union register_pair rp = { .even = *subcode, .odd = size };
@@ -223,7 +225,9 @@ int diag204(unsigned long subcode, unsigned long size, void *addr)
223225
addr = (void *)pfn_to_phys(vmalloc_to_pfn(addr));
224226
diag_stat_inc(DIAG_STAT_X204);
225227
size = __diag204(&subcode, size, addr);
226-
if (subcode)
228+
if (subcode == DIAG204_BUSY_RC)
229+
return -EBUSY;
230+
else if (subcode)
227231
return -EOPNOTSUPP;
228232
return size;
229233
}

0 commit comments

Comments
 (0)