Commit c0bd3960 authored by Heiko Carstens's avatar Heiko Carstens

s390/dasd: use new address translation helpers

Use virt_to_dma32() and friends to properly convert virtual to physical and
physical to virtual addresses so that "make C=1" does not generate any
warnings anymore.
Reviewed-by: default avatarStefan Haberland <sth@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent bdd0ab97
...@@ -3976,7 +3976,7 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, ...@@ -3976,7 +3976,7 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
ccw = cqr->cpaddr; ccw = cqr->cpaddr;
ccw->cmd_code = CCW_CMD_RDC; ccw->cmd_code = CCW_CMD_RDC;
ccw->cda = (__u32)virt_to_phys(cqr->data); ccw->cda = virt_to_dma32(cqr->data);
ccw->flags = 0; ccw->flags = 0;
ccw->count = rdc_buffer_size; ccw->count = rdc_buffer_size;
cqr->startdev = device; cqr->startdev = device;
...@@ -4020,7 +4020,7 @@ char *dasd_get_sense(struct irb *irb) ...@@ -4020,7 +4020,7 @@ char *dasd_get_sense(struct irb *irb)
if (scsw_is_tm(&irb->scsw) && (irb->scsw.tm.fcxs == 0x01)) { if (scsw_is_tm(&irb->scsw) && (irb->scsw.tm.fcxs == 0x01)) {
if (irb->scsw.tm.tcw) if (irb->scsw.tm.tcw)
tsb = tcw_get_tsb(phys_to_virt(irb->scsw.tm.tcw)); tsb = tcw_get_tsb(dma32_to_virt(irb->scsw.tm.tcw));
if (tsb && tsb->length == 64 && tsb->flags) if (tsb && tsb->length == 64 && tsb->flags)
switch (tsb->flags & 0x07) { switch (tsb->flags & 0x07) {
case 1: /* tsa_iostat */ case 1: /* tsa_iostat */
......
...@@ -216,7 +216,7 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier) ...@@ -216,7 +216,7 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier)
memset(ccw, 0, sizeof(struct ccw1)); memset(ccw, 0, sizeof(struct ccw1));
ccw->cmd_code = CCW_CMD_DCTL; ccw->cmd_code = CCW_CMD_DCTL;
ccw->count = 4; ccw->count = 4;
ccw->cda = (__u32)virt_to_phys(DCTL_data); ccw->cda = virt_to_dma32(DCTL_data);
dctl_cqr->flags = erp->flags; dctl_cqr->flags = erp->flags;
dctl_cqr->function = dasd_3990_erp_DCTL; dctl_cqr->function = dasd_3990_erp_DCTL;
dctl_cqr->refers = erp; dctl_cqr->refers = erp;
...@@ -1589,7 +1589,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1589,7 +1589,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
{ {
struct dasd_device *device = default_erp->startdev; struct dasd_device *device = default_erp->startdev;
__u32 cpa = 0; dma32_t cpa = 0;
struct dasd_ccw_req *cqr; struct dasd_ccw_req *cqr;
struct dasd_ccw_req *erp; struct dasd_ccw_req *erp;
struct DE_eckd_data *DE_data; struct DE_eckd_data *DE_data;
...@@ -1693,7 +1693,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1693,7 +1693,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT; ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT;
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)virt_to_phys(DE_data); ccw->cda = virt_to_dma32(DE_data);
/* create LO ccw */ /* create LO ccw */
ccw++; ccw++;
...@@ -1701,7 +1701,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1701,7 +1701,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD; ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD;
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)virt_to_phys(LO_data); ccw->cda = virt_to_dma32(LO_data);
/* TIC to the failed ccw */ /* TIC to the failed ccw */
ccw++; ccw++;
...@@ -1747,7 +1747,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense) ...@@ -1747,7 +1747,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
{ {
struct dasd_device *device = previous_erp->startdev; struct dasd_device *device = previous_erp->startdev;
__u32 cpa = 0; dma32_t cpa = 0;
struct dasd_ccw_req *cqr; struct dasd_ccw_req *cqr;
struct dasd_ccw_req *erp; struct dasd_ccw_req *erp;
char *LO_data; /* struct LO_eckd_data */ char *LO_data; /* struct LO_eckd_data */
...@@ -2386,7 +2386,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) ...@@ -2386,7 +2386,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
tcw = erp->cpaddr; tcw = erp->cpaddr;
tsb = (struct tsb *) &tcw[1]; tsb = (struct tsb *) &tcw[1];
*tcw = *((struct tcw *)cqr->cpaddr); *tcw = *((struct tcw *)cqr->cpaddr);
tcw->tsb = virt_to_phys(tsb); tcw->tsb = virt_to_dma64(tsb);
} else if (ccw->cmd_code == DASD_ECKD_CCW_PSF) { } else if (ccw->cmd_code == DASD_ECKD_CCW_PSF) {
/* PSF cannot be chained from NOOP/TIC */ /* PSF cannot be chained from NOOP/TIC */
erp->cpaddr = cqr->cpaddr; erp->cpaddr = cqr->cpaddr;
...@@ -2397,7 +2397,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) ...@@ -2397,7 +2397,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw++; ccw++;
ccw->cmd_code = CCW_CMD_TIC; ccw->cmd_code = CCW_CMD_TIC;
ccw->cda = (__u32)virt_to_phys(cqr->cpaddr); ccw->cda = virt_to_dma32(cqr->cpaddr);
} }
erp->flags = cqr->flags; erp->flags = cqr->flags;
......
...@@ -435,7 +435,7 @@ static int read_unit_address_configuration(struct dasd_device *device, ...@@ -435,7 +435,7 @@ static int read_unit_address_configuration(struct dasd_device *device,
ccw->cmd_code = DASD_ECKD_CCW_PSF; ccw->cmd_code = DASD_ECKD_CCW_PSF;
ccw->count = sizeof(struct dasd_psf_prssd_data); ccw->count = sizeof(struct dasd_psf_prssd_data);
ccw->flags |= CCW_FLAG_CC; ccw->flags |= CCW_FLAG_CC;
ccw->cda = (__u32)virt_to_phys(prssdp); ccw->cda = virt_to_dma32(prssdp);
/* Read Subsystem Data - feature codes */ /* Read Subsystem Data - feature codes */
memset(lcu->uac, 0, sizeof(*(lcu->uac))); memset(lcu->uac, 0, sizeof(*(lcu->uac)));
...@@ -443,7 +443,7 @@ static int read_unit_address_configuration(struct dasd_device *device, ...@@ -443,7 +443,7 @@ static int read_unit_address_configuration(struct dasd_device *device,
ccw++; ccw++;
ccw->cmd_code = DASD_ECKD_CCW_RSSD; ccw->cmd_code = DASD_ECKD_CCW_RSSD;
ccw->count = sizeof(*(lcu->uac)); ccw->count = sizeof(*(lcu->uac));
ccw->cda = (__u32)virt_to_phys(lcu->uac); ccw->cda = virt_to_dma32(lcu->uac);
cqr->buildclk = get_tod_clock(); cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED; cqr->status = DASD_CQR_FILLED;
...@@ -739,7 +739,7 @@ static int reset_summary_unit_check(struct alias_lcu *lcu, ...@@ -739,7 +739,7 @@ static int reset_summary_unit_check(struct alias_lcu *lcu,
ccw->cmd_code = DASD_ECKD_CCW_RSCK; ccw->cmd_code = DASD_ECKD_CCW_RSCK;
ccw->flags = CCW_FLAG_SLI; ccw->flags = CCW_FLAG_SLI;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)virt_to_phys(cqr->data); ccw->cda = virt_to_dma32(cqr->data);
((char *)cqr->data)[0] = reason; ((char *)cqr->data)[0] = reason;
clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
......
This diff is collapsed.
...@@ -485,7 +485,7 @@ int dasd_eer_enable(struct dasd_device *device) ...@@ -485,7 +485,7 @@ int dasd_eer_enable(struct dasd_device *device)
ccw->cmd_code = DASD_ECKD_CCW_SNSS; ccw->cmd_code = DASD_ECKD_CCW_SNSS;
ccw->count = SNSS_DATA_SIZE; ccw->count = SNSS_DATA_SIZE;
ccw->flags = 0; ccw->flags = 0;
ccw->cda = (__u32)virt_to_phys(cqr->data); ccw->cda = virt_to_dma32(cqr->data);
cqr->buildclk = get_tod_clock(); cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED; cqr->status = DASD_CQR_FILLED;
......
...@@ -78,7 +78,7 @@ define_extent(struct ccw1 * ccw, struct DE_fba_data *data, int rw, ...@@ -78,7 +78,7 @@ define_extent(struct ccw1 * ccw, struct DE_fba_data *data, int rw,
ccw->cmd_code = DASD_FBA_CCW_DEFINE_EXTENT; ccw->cmd_code = DASD_FBA_CCW_DEFINE_EXTENT;
ccw->flags = 0; ccw->flags = 0;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)virt_to_phys(data); ccw->cda = virt_to_dma32(data);
memset(data, 0, sizeof (struct DE_fba_data)); memset(data, 0, sizeof (struct DE_fba_data));
if (rw == WRITE) if (rw == WRITE)
(data->mask).perm = 0x0; (data->mask).perm = 0x0;
...@@ -98,7 +98,7 @@ locate_record(struct ccw1 * ccw, struct LO_fba_data *data, int rw, ...@@ -98,7 +98,7 @@ locate_record(struct ccw1 * ccw, struct LO_fba_data *data, int rw,
ccw->cmd_code = DASD_FBA_CCW_LOCATE; ccw->cmd_code = DASD_FBA_CCW_LOCATE;
ccw->flags = 0; ccw->flags = 0;
ccw->count = 8; ccw->count = 8;
ccw->cda = (__u32)virt_to_phys(data); ccw->cda = virt_to_dma32(data);
memset(data, 0, sizeof (struct LO_fba_data)); memset(data, 0, sizeof (struct LO_fba_data));
if (rw == WRITE) if (rw == WRITE)
data->operation.cmd = 0x5; data->operation.cmd = 0x5;
...@@ -257,7 +257,7 @@ static void ccw_write_zero(struct ccw1 *ccw, int count) ...@@ -257,7 +257,7 @@ static void ccw_write_zero(struct ccw1 *ccw, int count)
ccw->cmd_code = DASD_FBA_CCW_WRITE; ccw->cmd_code = DASD_FBA_CCW_WRITE;
ccw->flags |= CCW_FLAG_SLI; ccw->flags |= CCW_FLAG_SLI;
ccw->count = count; ccw->count = count;
ccw->cda = (__u32)virt_to_phys(dasd_fba_zero_page); ccw->cda = virt_to_dma32(dasd_fba_zero_page);
} }
/* /*
...@@ -523,11 +523,11 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular( ...@@ -523,11 +523,11 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular(
ccw->cmd_code = cmd; ccw->cmd_code = cmd;
ccw->count = block->bp_block; ccw->count = block->bp_block;
if (idal_is_needed(dst, blksize)) { if (idal_is_needed(dst, blksize)) {
ccw->cda = (__u32)virt_to_phys(idaws); ccw->cda = virt_to_dma32(idaws);
ccw->flags = CCW_FLAG_IDA; ccw->flags = CCW_FLAG_IDA;
idaws = idal_create_words(idaws, dst, blksize); idaws = idal_create_words(idaws, dst, blksize);
} else { } else {
ccw->cda = (__u32)virt_to_phys(dst); ccw->cda = virt_to_dma32(dst);
ccw->flags = 0; ccw->flags = 0;
} }
ccw++; ccw++;
...@@ -585,9 +585,9 @@ dasd_fba_free_cp(struct dasd_ccw_req *cqr, struct request *req) ...@@ -585,9 +585,9 @@ dasd_fba_free_cp(struct dasd_ccw_req *cqr, struct request *req)
ccw++; ccw++;
if (dst) { if (dst) {
if (ccw->flags & CCW_FLAG_IDA) if (ccw->flags & CCW_FLAG_IDA)
cda = *((char **)phys_to_virt(ccw->cda)); cda = *((char **)dma32_to_virt(ccw->cda));
else else
cda = phys_to_virt(ccw->cda); cda = dma32_to_virt(ccw->cda);
if (dst != cda) { if (dst != cda) {
if (rq_data_dir(req) == READ) if (rq_data_dir(req) == READ)
memcpy(dst, cda, bv.bv_len); memcpy(dst, cda, bv.bv_len);
...@@ -672,7 +672,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -672,7 +672,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len += sprintf(page + len, "in req: %px CS: 0x%02X DS: 0x%02X\n", len += sprintf(page + len, "in req: %px CS: 0x%02X DS: 0x%02X\n",
req, irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); req, irb->scsw.cmd.cstat, irb->scsw.cmd.dstat);
len += sprintf(page + len, "Failing CCW: %px\n", len += sprintf(page + len, "Failing CCW: %px\n",
(void *) (addr_t) irb->scsw.cmd.cpa); (void *)(u64)dma32_to_u32(irb->scsw.cmd.cpa));
if (irb->esw.esw0.erw.cons) { if (irb->esw.esw0.erw.cons) {
for (sl = 0; sl < 4; sl++) { for (sl = 0; sl < 4; sl++) {
len += sprintf(page + len, "Sense(hex) %2d-%2d:", len += sprintf(page + len, "Sense(hex) %2d-%2d:",
...@@ -701,7 +701,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -701,7 +701,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
for (count = 0; count < 32 && count < act->count; for (count = 0; count < 32 && count < act->count;
count += sizeof(int)) count += sizeof(int))
len += sprintf(page + len, " %08X", len += sprintf(page + len, " %08X",
((int *)phys_to_virt(act->cda)) ((int *)dma32_to_virt(act->cda))
[(count>>2)]); [(count>>2)]);
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
act++; act++;
...@@ -710,18 +710,18 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -710,18 +710,18 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
/* print failing CCW area */ /* print failing CCW area */
len = 0; len = 0;
if (act < ((struct ccw1 *)phys_to_virt(irb->scsw.cmd.cpa)) - 2) { if (act < ((struct ccw1 *)dma32_to_virt(irb->scsw.cmd.cpa)) - 2) {
act = ((struct ccw1 *)phys_to_virt(irb->scsw.cmd.cpa)) - 2; act = ((struct ccw1 *)dma32_to_virt(irb->scsw.cmd.cpa)) - 2;
len += sprintf(page + len, "......\n"); len += sprintf(page + len, "......\n");
} }
end = min((struct ccw1 *)phys_to_virt(irb->scsw.cmd.cpa) + 2, last); end = min((struct ccw1 *)dma32_to_virt(irb->scsw.cmd.cpa) + 2, last);
while (act <= end) { while (act <= end) {
len += sprintf(page + len, "CCW %px: %08X %08X DAT:", len += sprintf(page + len, "CCW %px: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]); act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count; for (count = 0; count < 32 && count < act->count;
count += sizeof(int)) count += sizeof(int))
len += sprintf(page + len, " %08X", len += sprintf(page + len, " %08X",
((int *)phys_to_virt(act->cda)) ((int *)dma32_to_virt(act->cda))
[(count>>2)]); [(count>>2)]);
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
act++; act++;
...@@ -738,7 +738,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -738,7 +738,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
for (count = 0; count < 32 && count < act->count; for (count = 0; count < 32 && count < act->count;
count += sizeof(int)) count += sizeof(int))
len += sprintf(page + len, " %08X", len += sprintf(page + len, " %08X",
((int *)phys_to_virt(act->cda)) ((int *)dma32_to_virt(act->cda))
[(count>>2)]); [(count>>2)]);
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
act++; act++;
......
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