Skip to contentSkip to conversation

use proper address translation functions in DCDBAS

PATCH In review Jan Beulich 2 participants 2 messages Nov 20, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use proper address translation functions in DCDBAS

In one case, the properly translated address is already available, in the other virt_to_bus() ought to be used (in particular for Xen compatibility).

---
 drivers/firmware/dcdbas.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/dcdbas.c +2 -2
@@ -106,7 +106,7 @@ static int smi_data_buf_realloc(unsigned
 	/* set up new buffer for use */
 	smi_data_buf = buf;
 	smi_data_buf_handle = handle;
-	smi_data_buf_phys_addr = (u32) virt_to_phys(buf);
+	smi_data_buf_phys_addr = (u32) handle;
 	smi_data_buf_size = size;
 
 	dev_dbg(&dcdbas_pdev->dev, "%s: phys: %x size: %lu\n",
@@ -319,7 +319,7 @@ static ssize_t smi_request_store(struct 
 		break;
 	case 1:
 		/* Calling Interface SMI */
-		smi_cmd->ebx = (u32) virt_to_phys(smi_cmd->command_buffer);
+		smi_cmd->ebx = (u32) virt_to_bus(smi_cmd->command_buffer);
 		ret = dcdbas_smi_request(smi_cmd);
 		if (!ret)
 			ret = count;
#1 lore raw
Quoted 3 lines · On Fri, 20 Nov 2009 13:46:00 +0000 "Jan Beulich" <[email protected]> wrote:

In one case, the properly translated address is already available, in the other virt_to_bus() ought to be used (in particular for Xen compatibility).

Same again - these are physical CPU memory views so virt_to_bus is wrong.