提交 ac07a4a5 编写于 作者: B Brian King 提交者: Benjamin Herrenschmidt

hvcs: Ensure page aligned partner info buffer

The Power platform requires the partner info buffer to be page aligned
otherwise it will fail the partner info hcall with H_PARAMETER. Switch
from using kmalloc to allocate this buffer to __get_free_page to ensure
page alignment.
Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 8bdafa39
...@@ -1532,7 +1532,7 @@ static int __devinit hvcs_initialize(void) ...@@ -1532,7 +1532,7 @@ static int __devinit hvcs_initialize(void)
goto register_fail; goto register_fail;
} }
hvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL); hvcs_pi_buff = (unsigned long *) __get_free_page(GFP_KERNEL);
if (!hvcs_pi_buff) { if (!hvcs_pi_buff) {
rc = -ENOMEM; rc = -ENOMEM;
goto buff_alloc_fail; goto buff_alloc_fail;
...@@ -1548,7 +1548,7 @@ static int __devinit hvcs_initialize(void) ...@@ -1548,7 +1548,7 @@ static int __devinit hvcs_initialize(void)
return 0; return 0;
kthread_fail: kthread_fail:
kfree(hvcs_pi_buff); free_page((unsigned long)hvcs_pi_buff);
buff_alloc_fail: buff_alloc_fail:
tty_unregister_driver(hvcs_tty_driver); tty_unregister_driver(hvcs_tty_driver);
register_fail: register_fail:
...@@ -1597,7 +1597,7 @@ static void __exit hvcs_module_exit(void) ...@@ -1597,7 +1597,7 @@ static void __exit hvcs_module_exit(void)
kthread_stop(hvcs_task); kthread_stop(hvcs_task);
spin_lock(&hvcs_pi_lock); spin_lock(&hvcs_pi_lock);
kfree(hvcs_pi_buff); free_page((unsigned long)hvcs_pi_buff);
hvcs_pi_buff = NULL; hvcs_pi_buff = NULL;
spin_unlock(&hvcs_pi_lock); spin_unlock(&hvcs_pi_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册