arch_cpu_read_write_register: error return fix.
Fixed an issue where errors generated in arch_cpu_read_write_register() are not transmitted to the caller. Change-Id: I05d7d872eab834918220cf18f628aee37208a156 Fujitsu: POSTK_DEBUG_TEMP_FIX_94
This commit is contained in:
committed by
Dominique Martinet
parent
583cb94667
commit
190039f5d9
@@ -3284,6 +3284,7 @@ long __mcctrl_control(ihk_os_t os, unsigned int req, unsigned long arg,
|
||||
struct mcctrl_os_cpu_response {
|
||||
int done;
|
||||
unsigned long val;
|
||||
int err;
|
||||
wait_queue_head_t wq;
|
||||
};
|
||||
|
||||
@@ -3362,6 +3363,7 @@ void mcctrl_os_read_write_cpu_response(ihk_os_t os,
|
||||
|
||||
resp->val = pisp->desc.val;
|
||||
resp->done = 1;
|
||||
resp->err = pisp->err;
|
||||
wake_up_interruptible(&resp->wq);
|
||||
}
|
||||
|
||||
@@ -3380,6 +3382,7 @@ int __mcctrl_os_read_write_cpu_register(ihk_os_t os, int cpu,
|
||||
isp.resp = &resp;
|
||||
|
||||
resp.done = 0;
|
||||
resp.err = 0;
|
||||
init_waitqueue_head(&resp.wq);
|
||||
|
||||
mb();
|
||||
@@ -3396,6 +3399,12 @@ int __mcctrl_os_read_write_cpu_register(ihk_os_t os, int cpu,
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = resp.err;
|
||||
if (ret != 0) {
|
||||
printk("%s: ERROR receive: %d\n", __FUNCTION__, resp.err);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Update if read */
|
||||
if (ret == 0 && op == MCCTRL_OS_CPU_READ_REGISTER) {
|
||||
desc->val = resp.val;
|
||||
|
||||
Reference in New Issue
Block a user