mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
s390/tape: fix virtual vs physical address confusion
Fix virtual vs physical address confusion and use new dma types and helper functions to allow for type checking. This does not fix a bug since virtual and physical address spaces are currently the same. Tested-by: Jan Höppner <hoeppner@linux.ibm.com> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
1b2ac5a6d6
commit
e8be820134
@ -305,7 +305,9 @@ tape_ccw_cc(struct ccw1 *ccw, __u8 cmd_code, __u16 memsize, void *cda)
|
||||
ccw->cmd_code = cmd_code;
|
||||
ccw->flags = CCW_FLAG_CC;
|
||||
ccw->count = memsize;
|
||||
ccw->cda = (__u32)(addr_t) cda;
|
||||
ccw->cda = 0;
|
||||
if (cda)
|
||||
ccw->cda = virt_to_dma32(cda);
|
||||
return ccw + 1;
|
||||
}
|
||||
|
||||
@ -315,7 +317,9 @@ tape_ccw_end(struct ccw1 *ccw, __u8 cmd_code, __u16 memsize, void *cda)
|
||||
ccw->cmd_code = cmd_code;
|
||||
ccw->flags = 0;
|
||||
ccw->count = memsize;
|
||||
ccw->cda = (__u32)(addr_t) cda;
|
||||
ccw->cda = 0;
|
||||
if (cda)
|
||||
ccw->cda = virt_to_dma32(cda);
|
||||
return ccw + 1;
|
||||
}
|
||||
|
||||
@ -325,7 +329,7 @@ tape_ccw_cmd(struct ccw1 *ccw, __u8 cmd_code)
|
||||
ccw->cmd_code = cmd_code;
|
||||
ccw->flags = 0;
|
||||
ccw->count = 0;
|
||||
ccw->cda = (__u32)(addr_t) &ccw->cmd_code;
|
||||
ccw->cda = virt_to_dma32(&ccw->cmd_code);
|
||||
return ccw + 1;
|
||||
}
|
||||
|
||||
@ -336,7 +340,7 @@ tape_ccw_repeat(struct ccw1 *ccw, __u8 cmd_code, int count)
|
||||
ccw->cmd_code = cmd_code;
|
||||
ccw->flags = CCW_FLAG_CC;
|
||||
ccw->count = 0;
|
||||
ccw->cda = (__u32)(addr_t) &ccw->cmd_code;
|
||||
ccw->cda = virt_to_dma32(&ccw->cmd_code);
|
||||
ccw++;
|
||||
}
|
||||
return ccw;
|
||||
|
Loading…
Reference in New Issue
Block a user