mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Chaithrika U S <chaithrika@ti.com>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com,
	khilman@deeprootsystems.com, akpm@linux-foundation.org,
	Chaithrika U S <chaithrika@ti.com>
Subject: Re: [PATCH] serial: 8250: Add cpufreq support
Date: Wed, 13 Jan 2010 13:44:45 +0000	[thread overview]
Message-ID: <20100113134445.010d4f1c@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1263386121-6644-1-git-send-email-chaithrika@ti.com>

> +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

  reply	other threads:[~2010-01-13 13:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13 12:35 Chaithrika U S
2010-01-13 13:44 ` Alan Cox [this message]
2010-01-18 13:17   ` Chaithrika U S
2012-04-03  6:03 Shankarmurthy, Akshay
2012-04-03  9:55 ` Alan Cox
2012-04-05 10:40   ` Shankarmurthy, Akshay
2012-04-05 10:53     ` Alan Cox
2012-04-12  5:21       ` Shankarmurthy, Akshay
2012-04-12  9:47         ` Alan Cox
2012-04-17  9:43           ` Shankarmurthy, Akshay
2012-04-18 19:47             ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100113134445.010d4f1c@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=chaithrika@ti.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®