aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/hvc
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2011-09-13 07:22:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-20 01:53:24 -0400
commitac07a4a57f7408922a0b3d4dcb87104fe8a3d8ca (patch)
treea3eede543ce5d626a34066c2690bff6c4568df8b /drivers/tty/hvc
parent8bdafa39a47265bc029838b35cc6585f69224afa (diff)
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: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/tty/hvc')
-rw-r--r--drivers/tty/hvc/hvcs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 4c8b66546930..39291665eca3 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -1532,7 +1532,7 @@ static int __devinit hvcs_initialize(void)
1532 goto register_fail; 1532 goto register_fail;
1533 } 1533 }
1534 1534
1535 hvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL); 1535 hvcs_pi_buff = (unsigned long *) __get_free_page(GFP_KERNEL);
1536 if (!hvcs_pi_buff) { 1536 if (!hvcs_pi_buff) {
1537 rc = -ENOMEM; 1537 rc = -ENOMEM;
1538 goto buff_alloc_fail; 1538 goto buff_alloc_fail;
@@ -1548,7 +1548,7 @@ static int __devinit hvcs_initialize(void)
1548 return 0; 1548 return 0;
1549 1549
1550kthread_fail: 1550kthread_fail:
1551 kfree(hvcs_pi_buff); 1551 free_page((unsigned long)hvcs_pi_buff);
1552buff_alloc_fail: 1552buff_alloc_fail:
1553 tty_unregister_driver(hvcs_tty_driver); 1553 tty_unregister_driver(hvcs_tty_driver);
1554register_fail: 1554register_fail:
@@ -1597,7 +1597,7 @@ static void __exit hvcs_module_exit(void)
1597 kthread_stop(hvcs_task); 1597 kthread_stop(hvcs_task);
1598 1598
1599 spin_lock(&hvcs_pi_lock); 1599 spin_lock(&hvcs_pi_lock);
1600 kfree(hvcs_pi_buff); 1600 free_page((unsigned long)hvcs_pi_buff);
1601 hvcs_pi_buff = NULL; 1601 hvcs_pi_buff = NULL;
1602 spin_unlock(&hvcs_pi_lock); 1602 spin_unlock(&hvcs_pi_lock);
1603 1603