Commit b1a6a1a7 authored by Vineeth Vijayan's avatar Vineeth Vijayan Committed by Alexander Gordeev

s390/scm: fix virtual vs physical address confusion

Fix virtual vs physical address confusion (which currently are the same).
Signed-off-by: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
Acked-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent aab1f809
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/blk-mq.h> #include <linux/blk-mq.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/io.h>
#include <asm/eadm.h> #include <asm/eadm.h>
#include "scm_blk.h" #include "scm_blk.h"
...@@ -130,7 +131,7 @@ static void scm_request_done(struct scm_request *scmrq) ...@@ -130,7 +131,7 @@ static void scm_request_done(struct scm_request *scmrq)
for (i = 0; i < nr_requests_per_io && scmrq->request[i]; i++) { for (i = 0; i < nr_requests_per_io && scmrq->request[i]; i++) {
msb = &scmrq->aob->msb[i]; msb = &scmrq->aob->msb[i];
aidaw = msb->data_addr; aidaw = (u64)phys_to_virt(msb->data_addr);
if ((msb->flags & MSB_FLAG_IDA) && aidaw && if ((msb->flags & MSB_FLAG_IDA) && aidaw &&
IS_ALIGNED(aidaw, PAGE_SIZE)) IS_ALIGNED(aidaw, PAGE_SIZE))
...@@ -195,12 +196,12 @@ static int scm_request_prepare(struct scm_request *scmrq) ...@@ -195,12 +196,12 @@ static int scm_request_prepare(struct scm_request *scmrq)
msb->scm_addr = scmdev->address + ((u64) blk_rq_pos(req) << 9); msb->scm_addr = scmdev->address + ((u64) blk_rq_pos(req) << 9);
msb->oc = (rq_data_dir(req) == READ) ? MSB_OC_READ : MSB_OC_WRITE; msb->oc = (rq_data_dir(req) == READ) ? MSB_OC_READ : MSB_OC_WRITE;
msb->flags |= MSB_FLAG_IDA; msb->flags |= MSB_FLAG_IDA;
msb->data_addr = (u64) aidaw; msb->data_addr = (u64)virt_to_phys(aidaw);
rq_for_each_segment(bv, req, iter) { rq_for_each_segment(bv, req, iter) {
WARN_ON(bv.bv_offset); WARN_ON(bv.bv_offset);
msb->blk_count += bv.bv_len >> 12; msb->blk_count += bv.bv_len >> 12;
aidaw->data_addr = (u64) page_address(bv.bv_page); aidaw->data_addr = virt_to_phys(page_address(bv.bv_page));
aidaw++; aidaw++;
} }
......
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