[PATCH] U6715 platform serial driver It's a generic driver for all U6XXX platform

Russell King - ARM Linux linux at arm.linux.org.uk
Sat Jul 31 06:59:46 EDT 2010


On Thu, Jul 29, 2010 at 05:26:32PM +0200, Philippe Langlais wrote:
> +unsigned int u6_serial8250_enable_clock(struct uart_port *port)
> +{
> +	struct u6_uart *uart_u6 = port->private_data;
> +
> +	if (!uart_u6)
> +		return uart_enable_clock(port);
> +
> +	if (IS_ERR(uart_u6->uartClk)) {
> +		pr_warning("%s - uart clock failed error:%ld\n",
> +		       __func__, PTR_ERR(uart_u6->uartClk));
> +		return PTR_ERR(uart_u6->uartClk);
> +	}
> +
> +	if (clk_get_usecount(uart_u6->uartClk) == 0)
> +		clk_enable(uart_u6->uartClk);

This breaks the atomic update nature of the use count of clocks, and breaks
the model that the driver should only ever enable the clock if it needs it.
I think instead you need to track whether the driver enabled or disabled
its own clock.



More information about the linux-arm-kernel mailing list