Re: [PATCH] serial_core: fix uart PORT_UNKNOWN handling
From: gregkh@xxxxxxxxxxxxxxxxxxx
Date: Wed Apr 16 2014 - 16:26:09 EST
On Wed, Apr 09, 2014 at 05:06:24PM +0200, Thomas Pfaff wrote:
>
> On Wed, 9 Apr 2014, One Thousand Gnomes wrote:
>
> > On Wed, 9 Apr 2014 13:22:14 +0200
> > Thomas Pfaff <tpfaff@xxxxxxx> wrote:
> >
> > > 1. uart_change_pm ist called during uart_open and calls the uart pm function
> > > without checking for PORT_UNKNOWN.
> >
> > Removing this breaks other parts of the code assume that the port will be
> > powered up (notably setserial paths). So it makes sense that
> > uart_change_pm for a "none" port is a no-op but needs logic in the
> > setserial path to power up a port when we move none->known and power it
> > down on known->none
> >
>
> Then why not move uart_change_pm into uart_port_startup, where it will be called
> when needed ?
> A reworked patch is below.
>
> > > 2. uart_shutdown is called from uart_set_info and does not check it either.
> >
> > I don't see why this one matters. We would have done
> >
> > uart_startup
> > uart_port_startup
> > uport->type == PORT_UNKNOWN
> > return 1;
> > ASYNCB_INITIALIZED is not set
> >
> > uart_shutdown
> > ASYNCB_INITIALISED is not set
> > Skip call to uart_port_shutdown
> >
> > So that code looks correct to me.
>
> I agree, i have overlooked this.
>
> Signed-off-by: Thomas Pfaff <tpfaff@xxxxxxx>
Can you resend this in a format that I can apply this in?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/