Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0da3336f authored by Heiko Stübner's avatar Heiko Stübner Committed by Greg Kroah-Hartman
Browse files

serial: samsung: move clock deactivation below uart registration



Commit 60e93575 (serial: samsung: enable clock before clearing pending
interrupts during init) added handling of the controller clock during init.

On most systems this clock is also one of the baud_clock sources and
possibly used by the earlycon and thus already enabled by the bootloader.

Therefore a gap exists between s3c24xx_serial_init_port disabling the
clock and an attached console reenabling it, making the transition from
earlycon to regular console possibly hang the system - as seen on my
S3C2442 based Freerunner today.

Therefore move the disabling of the clock from s3c24xx_serial_init_port
below the uart port registration, effectively creating an overlap and
keeping the clock running non-stop if the console wants to grab this port.

Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dc1ccc48
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1209,7 +1209,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,

	/* reset the fifos (and setup the uart) */
	s3c24xx_serial_resetport(port, cfg);
	clk_disable_unprepare(ourport->clk);
	return 0;
}

@@ -1287,6 +1286,13 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
	uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
	platform_set_drvdata(pdev, &ourport->port);

	/*
	 * Deactivate the clock enabled in s3c24xx_serial_init_port here,
	 * so that a potential re-enablement through the pm-callback overlaps
	 * and keeps the clock enabled in this case.
	 */
	clk_disable_unprepare(ourport->clk);

#ifdef CONFIG_SAMSUNG_CLOCK
	ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
	if (ret < 0)