Skip to content

Commit b1a6a1a

Browse files
vneethvAlexander Gordeev
authored andcommitted
s390/scm: fix virtual vs physical address confusion
Fix virtual vs physical address confusion (which currently are the same). Signed-off-by: Vineeth Vijayan <[email protected]> Reviewed-by: Peter Oberparleiter <[email protected]> Acked-by: Alexander Gordeev <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent aab1f80 commit b1a6a1a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/s390/block/scm_blk.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/blk-mq.h>
1818
#include <linux/slab.h>
1919
#include <linux/list.h>
20+
#include <linux/io.h>
2021
#include <asm/eadm.h>
2122
#include "scm_blk.h"
2223

@@ -130,7 +131,7 @@ static void scm_request_done(struct scm_request *scmrq)
130131

131132
for (i = 0; i < nr_requests_per_io && scmrq->request[i]; i++) {
132133
msb = &scmrq->aob->msb[i];
133-
aidaw = msb->data_addr;
134+
aidaw = (u64)phys_to_virt(msb->data_addr);
134135

135136
if ((msb->flags & MSB_FLAG_IDA) && aidaw &&
136137
IS_ALIGNED(aidaw, PAGE_SIZE))
@@ -195,12 +196,12 @@ static int scm_request_prepare(struct scm_request *scmrq)
195196
msb->scm_addr = scmdev->address + ((u64) blk_rq_pos(req) << 9);
196197
msb->oc = (rq_data_dir(req) == READ) ? MSB_OC_READ : MSB_OC_WRITE;
197198
msb->flags |= MSB_FLAG_IDA;
198-
msb->data_addr = (u64) aidaw;
199+
msb->data_addr = (u64)virt_to_phys(aidaw);
199200

200201
rq_for_each_segment(bv, req, iter) {
201202
WARN_ON(bv.bv_offset);
202203
msb->blk_count += bv.bv_len >> 12;
203-
aidaw->data_addr = (u64) page_address(bv.bv_page);
204+
aidaw->data_addr = virt_to_phys(page_address(bv.bv_page));
204205
aidaw++;
205206
}
206207

0 commit comments

Comments
 (0)