[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100113134445.010d4f1c@lxorguk.ukuu.org.uk>
Date: Wed, 13 Jan 2010 13:44:45 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Chaithrika U S <chaithrika@...com>
Cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
davinci-linux-open-source@...ux.davincidsp.com,
khilman@...prootsystems.com, akpm@...ux-foundation.org,
Chaithrika U S <chaithrika@...com>
Subject: Re: [PATCH] serial: 8250: Add cpufreq support
> +static int serial8250_cpufreq_transition(struct notifier_block *nb,
> + unsigned long val, void *data)
> +{
> + struct uart_8250_port *p;
> + struct uart_port *uport;
> +
> + p = container_of(nb, struct uart_8250_port, freq_transition);
> + uport = &p->port;
> +
> + if (IS_ERR(p->clk))
> + goto cpu_freq_exit;
> +
> + if (p->port.uartclk == clk_get_rate(p->clk))
> + goto cpu_freq_exit;
> +
> + p->port.uartclk = clk_get_rate(p->clk);
> + if (val == CPUFREQ_POSTCHANGE) {
> + struct ktermios *termios;
> + struct tty_struct *tty;
> + if (uport->state == NULL)
> + goto cpu_freq_exit;
> +
> + tty = uport->state->port.tty;
Need locking on port->tty.
> + if (tty == NULL)
> + goto cpu_freq_exit;
> +
Need locking on tty->termios
I'd say this is also probably at the wrong level - why not do it at the
uart_port level instead (ie move the code you have into serial_core using
uart_port) - you've made it all nicely generic already.
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists