lkml.org 
[lkml]   [2012]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] serial: 8250: Add cpufreq support
On Thu, 5 Apr 2012 10:40:55 +0000
"Shankarmurthy, Akshay" <akshay.s@ti.com> wrote:

> Hi,
>
> On Tue, Apr 03, 2012 at 15:25:30, Alan Cox wrote:
> > > This patch was submitted 2 years ago but didn't make it to the mainline. Now i am reposting it.
> >
> > Can you fix it instead of just reposting it ?
> >
> >
> > > +#ifdef CONFIG_CPU_FREQ
> > > +static int serial8250_cpufreq_transition(struct notifier_block *nb,
> > > + unsigned long val, void *data)
> > > +{
> > > + struct uart_8250_port *p;
> > > + struct uart_port *uport;
> >
> > What is your locking model ?
> >
>
> I will have a look at this and add the lock if necessary.

At the very least you need reference counts held on the tty struct and to
allow for the tty having vanished under you.

> >
> > > +static inline void serial8250_cpufreq_deregister(struct uart_8250_port *p)
> >
> > unregister
>
> Ok. I will change it.
>
> >
> > > + ret = serial8250_cpufreq_register(uart);
> > > + if (ret < 0)
> > > + printk(KERN_ERR "Failed to add cpufreq notifier\n");
> >
> > Why do this for devices that don't care.
>
> This is taken care in the code. If the device's frequency doesn't change after the
> change in the cpu frequency then it doesn't go for execution of the function "serial8250_set_termios".

But you still call each function and walk the list for each port on each
CPU transition. There are people with 128 ports in their systems and the
cpu frequency change is latency critical.

Nothing should even be getting registered in such cases.


\
 
 \ /
  Last update: 2012-04-05 12:53    [W:0.537 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site