serial: samsung: Continue to work if DMA request fails
Subsystems (3)
Krzysztof Kozlowski
maintainerPATCH 1/1 serial: samsung: Continue to work if DMA request fails
If DMA is not available (even when configured in DeviceTree), the driver will fail the startup procedure thus making serial console not available.
For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
[ 1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
...
[ 11.435732] samsung-uart 13800000.serial: DMA request failed
[ 72.963893] samsung-uart 13800000.serial: DMA request failed
[ 73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000DMA is not necessary for serial to work, so continue with UART startup after emitting a warning.
--- drivers/tty/serial/samsung.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/tty/serial/samsung.c +4 -2
@@ -1031,8 +1031,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)if (ourport->dma) { ret =s3c24xx_serial_request_dma (ourport);if (ret <0 ) { -dev_warn (port->dev,"DMA request failed\n" ); -return ret; +dev_warn (port->dev, +"DMA request failed, DMA will not be used\n" ); +devm_kfree (port->dev, ourport->dma); + ourport->dma =NULL ; } }
Signature · 1 line
2.9.3
Hello Krzysztof,
Quoted 26 lines · Krzysztof Kozlowski
If DMA is not available (even when configured in DeviceTree), the driver will fail the startup procedure thus making serial console not available.
For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
[ 1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000 ... [ 11.435732] samsung-uart 13800000.serial: DMA request failed [ 72.963893] samsung-uart 13800000.serial: DMA request failed [ 73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=00000000DMA is not necessary for serial to work, so continue with UART startup after emitting a warning.
Fixes Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")Cc <[email protected]>Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/tty/serial/samsung.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/tty/serial/samsung.c +0
-0
drivers/tty/serial/samsung.c static int s3c64xx_serial_startup(struct uart_port *port) · line 1037
Quoted 9 lines
drivers/tty/serial/samsung.c +4
-2@@ -1031,8 +1031,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)if (ourport->dma) { ret =3c24xx_serial_request_dma(ourport);if (ret <0 ) { -dev_warn (port->dev,"DMA request failed\n" ); -return ret; +dev_warn (port->dev, +"DMA request failed, DMA will not be used\n" ); +devm_kfree (port->dev, ourport->dma); + ourport->dma =ULL ;
This line looks odd. Did you want to assign NULL here? Also, whitespace on both sides of '='?
- Tobias
Quoted 4 lines
drivers/tty/serial/samsung.c +0
-0} }
Krzysztof Kozlowski
maintainerQuoted 24 lines · Tobias Jakobi
Hello Krzysztof,
Quoted 21 lines · Krzysztof Kozlowski
If DMA is not available (even when configured in DeviceTree), the driver will fail the startup procedure thus making serial console not available.
For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
[ 1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000 ... [ 11.435732] samsung-uart 13800000.serial: DMA request failed [ 72.963893] samsung-uart 13800000.serial: DMA request failed [ 73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=00000000DMA is not necessary for serial to work, so continue with UART startup after emitting a warning.
Fixes Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")Cc <[email protected]>Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/tty/serial/samsung.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
drivers/tty/serial/samsung.c +0
-0drivers/tty/serial/samsung.c static int s3c64xx_serial_startup(struct uart_port *port) · line 1037
Quoted 9 lines
drivers/tty/serial/samsung.c +4
-2@@ -1031,8 +1031,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)if (ourport->dma) { ret =3c24xx_serial_request_dma(ourport);if (ret <0 ) { -dev_warn (port->dev,"DMA request failed\n" ); -return ret; +dev_warn (port->dev, +"DMA request failed, DMA will not be used\n" ); +devm_kfree (port->dev, ourport->dma); + ourport->dma =ULL ;This line looks odd. Did you want to assign NULL here? Also, whitespace on both sides of '='?
Ugh, I must ate it by mistake somehow because my git contains proper "NULL" here.
Thanks for pointing this, I'll resend v3.
Best regards,
Krzysztof