mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] use proper address translation functions in Dell RBU
@ 2009-11-20 13:46 Jan Beulich
  2009-11-20 14:07 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2009-11-20 13:46 UTC (permalink / raw)
  To: Douglas_Warzecha; +Cc: linux-kernel

virt_to_bus() ought to be used (in particular for Xen compatibility).

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 drivers/firmware/dell_rbu.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- linux-2.6.32-rc8/drivers/firmware/dell_rbu.c	2009-03-24 00:12:14.000000000 +0100
+++ 2.6.32-rc8-dell-rbu/drivers/firmware/dell_rbu.c	2009-10-26 16:34:16.000000000 +0100
@@ -170,7 +170,7 @@ static int create_packet(void *data, siz
 			goto out_alloc_packet_array;
 		}
 
-		if ((unsigned long)virt_to_phys(packet_data_temp_buf)
+		if ((unsigned long)virt_to_bus(packet_data_temp_buf)
 				< allocation_floor) {
 			pr_debug("packet 0x%lx below floor at 0x%lx.\n",
 					(unsigned long)virt_to_phys(
@@ -185,7 +185,7 @@ static int create_packet(void *data, siz
 	newpacket->data = packet_data_temp_buf;
 
 	pr_debug("create_packet: newpacket at physical addr %lx\n",
-		(unsigned long)virt_to_phys(newpacket->data));
+		(unsigned long)virt_to_bus(newpacket->data));
 
 	/* packets may not have fixed size */
 	newpacket->length = length;
@@ -204,7 +204,7 @@ out_alloc_packet_array:
 	/* always free packet array */
 	for (;idx>0;idx--) {
 		pr_debug("freeing unused packet below floor 0x%lx.\n",
-			(unsigned long)virt_to_phys(
+			(unsigned long)virt_to_bus(
 				invalid_addr_packet_array[idx-1]));
 		free_pages((unsigned long)invalid_addr_packet_array[idx-1],
 			ordernum);
@@ -438,7 +438,7 @@ static int img_update_realloc(unsigned l
 		(unsigned char *) __get_free_pages(GFP_KERNEL, ordernum);
 
 	img_buf_phys_addr =
-		(unsigned long) virt_to_phys(image_update_buffer);
+		(unsigned long) virt_to_bus(image_update_buffer);
 
 	if (img_buf_phys_addr > BIOS_SCAN_LIMIT) {
 		free_pages((unsigned long) image_update_buffer, ordernum);




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-20 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-20 13:46 [PATCH] use proper address translation functions in Dell RBU Jan Beulich
2009-11-20 14:07 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®