powerpc: Don't use alloc_bootmem in cpm_uart_cpm2.c
This is another alloc_bootmem() -> kzalloc() change, this time to fix the non-fatal badness caused when booting with a cpm2_uart console.
--- drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/cpm_uart/cpm_uart_cpm2.c +1 -1
@@ -132,7 +132,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) memsz =L1_CACHE_ALIGN (pinfo->rx_nrfifos * pinfo->rx_fifosize) +L1_CACHE_ALIGN (pinfo->tx_nrfifos * pinfo->tx_fifosize);if (is_con) { - mem_addr =alloc_bootmem (memsz); + mem_addr =kzalloc (memsz,GFP_NOWAIT ); dma_addr =virt_to_bus (mem_addr); }else
Signature · 1 line
1.5.6.5
Quoted 15 lines · Mark Ware
This is another
alloc_bootmem()->kzalloc()change, this time to fix the non-fatal badness caused when booting with acpm2_uartconsole.Signed-off-by Mark Ware <[email protected]>--- drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/serial/cpm_uart/cpm_uart_cpm2.c +0
-0
drivers/serial/cpm_uart/cpm_uart_cpm2.c int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, · line 138
Quoted 8 lines
drivers/serial/cpm_uart/cpm_uart_cpm2.c +1
-1@@ -132,7 +132,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) memsz =L1_CACHE_ALIGN (pinfo->rx_nrfifos * pinfo->rx_fifosize) +L1_CACHE_ALIGN (pinfo->tx_nrfifos * pinfo->tx_fifosize);if (is_con) { - mem_addr =alloc_bootmem (memsz); + mem_addr =kzalloc (memsz,GFP_NOWAIT ); dma_addr =virt_to_bus (mem_addr); }
Hmm, is dma_alloc_coherent() now available this early as well? If so, we could get rid of the separate "is_con" handling altogether.
-Scott
Quoted 28 lines · Scott Wood
Quoted 15 lines · Mark Ware
This is another
alloc_bootmem()->kzalloc()change, this time to fix the non-fatal badness caused when booting with acpm2_uartconsole.Signed-off-by Mark Ware <[email protected]>--- drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/serial/cpm_uart/cpm_uart_cpm2.c +0
-0drivers/serial/cpm_uart/cpm_uart_cpm2.c int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, · line 138
Quoted 8 lines
drivers/serial/cpm_uart/cpm_uart_cpm2.c +1
-1@@ -132,7 +132,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) memsz =L1_CACHE_ALIGN (pinfo->rx_nrfifos * pinfo->rx_fifosize) +L1_CACHE_ALIGN (pinfo->tx_nrfifos * pinfo->tx_fifosize);if (is_con) { - mem_addr =alloc_bootmem (memsz); + mem_addr =kzalloc (memsz,GFP_NOWAIT ); dma_addr =virt_to_bus (mem_addr); }Hmm, is
dma_alloc_coherent()now available this early as well? If so, we could get rid of the separate "is_con" handling altogether.
Quoted 2 lines
-Scott
This was my first thought as well, but calling dma_alloc_coherent() on a console resulted in a hang on boot before any console output. I have no actual proof, but it seems likely that it is not available at that point in the boot.
Regards,
Mark
Kumar Gala
AppliedQuoted 8 lines · Mark Ware
This is another
alloc_bootmem()->kzalloc()change, this time to fix the non-fatal badness caused when booting with acpm2_uartconsole.Signed-off-by Mark Ware <[email protected]>---
drivers/serial/cpm_uart/cpm_uart_cpm2.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)
applied to merge (had to fix up patch by hand).
- k