Commit 25fab9eb authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Linus Torvalds

[PATCH] s390: fix sclp memory corruption in tty pages list

When the sclp interface takes very long to serve a request, the sclp core
driver will report a failed request to the sclp tty driver even though the
request is still being processed by the sclp interface.  Eventually the sclp
interface completes the request and updates some fields in the request buffer
which leads to a corrupted tty pages list.  The next time function
sclp_tty_write_room is called, the corrupted list will be traversed, resulting
in an oops.

To avoid this remove the busy retry limit and increase retry intervals.
Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e6f3601a
...@@ -85,11 +85,10 @@ static volatile enum sclp_mask_state_t { ...@@ -85,11 +85,10 @@ static volatile enum sclp_mask_state_t {
/* Maximum retry counts */ /* Maximum retry counts */
#define SCLP_INIT_RETRY 3 #define SCLP_INIT_RETRY 3
#define SCLP_MASK_RETRY 3 #define SCLP_MASK_RETRY 3
#define SCLP_REQUEST_RETRY 3
/* Timeout intervals in seconds.*/ /* Timeout intervals in seconds.*/
#define SCLP_BUSY_INTERVAL 2 #define SCLP_BUSY_INTERVAL 10
#define SCLP_RETRY_INTERVAL 5 #define SCLP_RETRY_INTERVAL 15
static void sclp_process_queue(void); static void sclp_process_queue(void);
static int sclp_init_mask(int calculate); static int sclp_init_mask(int calculate);
...@@ -153,11 +152,9 @@ __sclp_start_request(struct sclp_req *req) ...@@ -153,11 +152,9 @@ __sclp_start_request(struct sclp_req *req)
if (sclp_running_state != sclp_running_state_idle) if (sclp_running_state != sclp_running_state_idle)
return 0; return 0;
del_timer(&sclp_request_timer); del_timer(&sclp_request_timer);
if (req->start_count <= SCLP_REQUEST_RETRY) {
rc = service_call(req->command, req->sccb); rc = service_call(req->command, req->sccb);
req->start_count++; req->start_count++;
} else
rc = -EIO;
if (rc == 0) { if (rc == 0) {
/* Sucessfully started request */ /* Sucessfully started request */
req->status = SCLP_REQ_RUNNING; req->status = SCLP_REQ_RUNNING;
......
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