aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/sclp_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/sclp_cmd.c')
-rw-r--r--drivers/s390/char/sclp_cmd.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 49af8eeb90ea..6e8f90f84e49 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -37,6 +37,11 @@ static void sclp_sync_callback(struct sclp_req *req, void *data)
37 37
38int sclp_sync_request(sclp_cmdw_t cmd, void *sccb) 38int sclp_sync_request(sclp_cmdw_t cmd, void *sccb)
39{ 39{
40 return sclp_sync_request_timeout(cmd, sccb, 0);
41}
42
43int sclp_sync_request_timeout(sclp_cmdw_t cmd, void *sccb, int timeout)
44{
40 struct completion completion; 45 struct completion completion;
41 struct sclp_req *request; 46 struct sclp_req *request;
42 int rc; 47 int rc;
@@ -44,6 +49,8 @@ int sclp_sync_request(sclp_cmdw_t cmd, void *sccb)
44 request = kzalloc(sizeof(*request), GFP_KERNEL); 49 request = kzalloc(sizeof(*request), GFP_KERNEL);
45 if (!request) 50 if (!request)
46 return -ENOMEM; 51 return -ENOMEM;
52 if (timeout)
53 request->queue_timeout = timeout;
47 request->command = cmd; 54 request->command = cmd;
48 request->sccb = sccb; 55 request->sccb = sccb;
49 request->status = SCLP_REQ_FILLED; 56 request->status = SCLP_REQ_FILLED;
@@ -110,7 +117,8 @@ int sclp_get_cpu_info(struct sclp_cpu_info *info)
110 if (!sccb) 117 if (!sccb)
111 return -ENOMEM; 118 return -ENOMEM;
112 sccb->header.length = sizeof(*sccb); 119 sccb->header.length = sizeof(*sccb);
113 rc = sclp_sync_request(SCLP_CMDW_READ_CPU_INFO, sccb); 120 rc = sclp_sync_request_timeout(SCLP_CMDW_READ_CPU_INFO, sccb,
121 SCLP_QUEUE_INTERVAL);
114 if (rc) 122 if (rc)
115 goto out; 123 goto out;
116 if (sccb->header.response_code != 0x0010) { 124 if (sccb->header.response_code != 0x0010) {
@@ -144,7 +152,7 @@ static int do_cpu_configure(sclp_cmdw_t cmd)
144 if (!sccb) 152 if (!sccb)
145 return -ENOMEM; 153 return -ENOMEM;
146 sccb->header.length = sizeof(*sccb); 154 sccb->header.length = sizeof(*sccb);
147 rc = sclp_sync_request(cmd, sccb); 155 rc = sclp_sync_request_timeout(cmd, sccb, SCLP_QUEUE_INTERVAL);
148 if (rc) 156 if (rc)
149 goto out; 157 goto out;
150 switch (sccb->header.response_code) { 158 switch (sccb->header.response_code) {
@@ -214,7 +222,7 @@ static int do_assign_storage(sclp_cmdw_t cmd, u16 rn)
214 return -ENOMEM; 222 return -ENOMEM;
215 sccb->header.length = PAGE_SIZE; 223 sccb->header.length = PAGE_SIZE;
216 sccb->rn = rn; 224 sccb->rn = rn;
217 rc = sclp_sync_request(cmd, sccb); 225 rc = sclp_sync_request_timeout(cmd, sccb, SCLP_QUEUE_INTERVAL);
218 if (rc) 226 if (rc)
219 goto out; 227 goto out;
220 switch (sccb->header.response_code) { 228 switch (sccb->header.response_code) {
@@ -269,7 +277,8 @@ static int sclp_attach_storage(u8 id)
269 if (!sccb) 277 if (!sccb)
270 return -ENOMEM; 278 return -ENOMEM;
271 sccb->header.length = PAGE_SIZE; 279 sccb->header.length = PAGE_SIZE;
272 rc = sclp_sync_request(0x00080001 | id << 8, sccb); 280 rc = sclp_sync_request_timeout(0x00080001 | id << 8, sccb,
281 SCLP_QUEUE_INTERVAL);
273 if (rc) 282 if (rc)
274 goto out; 283 goto out;
275 switch (sccb->header.response_code) { 284 switch (sccb->header.response_code) {