summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/eadm_sch.c
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2021-06-18 08:39:12 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2022-12-01 10:58:04 +0100
commit5c2e5a0cf5b12c156b0cb07af43b51627c086480 (patch)
treebd5b9271732eff13b5fc28198546086204fdb96a /drivers/s390/cio/eadm_sch.c
parent1143f6f55d967ab414a10a559d58a2700f32a54d (diff)
downloadlinux-5c2e5a0cf5b12c156b0cb07af43b51627c086480.tar.bz2
s390/cio: sort out physical vs virtual pointers usage
This does not fix a real bug, since virtual addresses are currently indentical to physical ones. Use virt_to_phys() for intparm interrupt parameter to convert a 64-bit virtual address to the 32-bit physical address, which is expected to be below 2GB. Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'drivers/s390/cio/eadm_sch.c')
-rw-r--r--drivers/s390/cio/eadm_sch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c
index ab6a7495180a..826364d2facd 100644
--- a/drivers/s390/cio/eadm_sch.c
+++ b/drivers/s390/cio/eadm_sch.c
@@ -15,6 +15,7 @@
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/list.h>
+#include <linux/io.h>
#include <asm/css_chars.h>
#include <asm/debug.h>
@@ -62,8 +63,8 @@ static int eadm_subchannel_start(struct subchannel *sch, struct aob *aob)
int cc;
orb_init(orb);
- orb->eadm.aob = (u32)__pa(aob);
- orb->eadm.intparm = (u32)(addr_t)sch;
+ orb->eadm.aob = (u32)virt_to_phys(aob);
+ orb->eadm.intparm = (u32)virt_to_phys(sch);
orb->eadm.key = PAGE_DEFAULT_KEY >> 4;
EADM_LOG(6, "start");
@@ -146,7 +147,7 @@ static void eadm_subchannel_irq(struct subchannel *sch)
css_sched_sch_todo(sch, SCH_TODO_EVAL);
return;
}
- scm_irq_handler((struct aob *)(unsigned long)scsw->aob, error);
+ scm_irq_handler(phys_to_virt(scsw->aob), error);
private->state = EADM_IDLE;
if (private->completion)
@@ -225,7 +226,7 @@ static int eadm_subchannel_probe(struct subchannel *sch)
private->state = EADM_IDLE;
private->sch = sch;
sch->isc = EADM_SCH_ISC;
- ret = cio_enable_subchannel(sch, (u32)(unsigned long)sch);
+ ret = cio_enable_subchannel(sch, (u32)virt_to_phys(sch));
if (ret) {
set_eadm_private(sch, NULL);
spin_unlock_irq(sch->lock);